Commit Graph

31 Commits

Author SHA1 Message Date
jab 7b4d1df5fb Add pre-commit hooks + changes to appease them 2017-11-21 10:35:56 -05:00
jab f72c16c074 address the few remaining uncovered lines 2017-11-20 23:28:14 -05:00
jab 51c75d2bb0 another round of refinements
- Make OrderedBidict.__eq__ always order-insensitive.
  Add OrderedBidict.equals_order_sensitive for order-sensitive comparison.
  Drop OrderedBidict.ordered_cls and bidict.compat.Reversible.

- Add test coverage for bidict.metadata.

- Use setuptools_scm for automatic version discovery from source control.
  Drop bidict/VERSION file and associated machinery.

- Ditch testing macOS on Travis, it's just too slow.
  Testing on Linux should suffice.

- Ditch using pyenv on Travis to save time and complexity.
  Travis now has a better set of Python versions available out-of-the-box.

- Add support for "python setup.py test" and use that on Travis.
2017-11-20 22:27:27 -05:00
jab 64ed7278d8
more API and code improvements
including:
- simplify type hierarchy, merging the frozen types into the base types
- upgrade to latest hypothesis (3.38.0)
- use Reversible for order-sensitive FrozenOrderedBidict.__eq__
- fix bug where bidict._on_dup_kv was not set to ON_DUP_VAL as documented
- drop leading underscore from attrs that should be public
- improve setup.py/metadata
- rename DuplicationBehavior -> DuplicationPolicy
- drop ON_DUP_VAL duplication policy in preference to just using None
- reduce ordered bidict memory usage and speed up copy
2017-11-19 22:24:08 -05:00
jab 22f4e78d09
numerous fixes and improvements (#43)
- .travis.yml and setup.py tweaks
- add regression tests for -O bug and document fix
- Make OrderedBidict equality comparison order-sensitive in more cases.
- Add bidict.BidictBase.ordered class attribute.
- Replacing OrderedBidictBase._should_compare_order_sensitive()
  with OrderedBidictBase.should_compare_order_sensitive_to().
- Revert the optimizations in v0.13.0 to make FrozenOrderedBidict instances
  that have the same items in different order have different hash values.
- Remove FrozenBidictBase.
- Remove frozenbidict._USE_ITEMSVIEW_HASH and
  frozenorderedbidict._HASH_NITEMS_MAX
2017-11-17 22:35:40 -05:00
jab 033083ca26
various code and CI improvements + dependency updates (#42) 2017-11-16 15:44:51 -05:00
jab 050e61e0f7 update to latest deps; tests + docs improvements 2017-10-11 10:26:22 -04:00
jab e87a6c31c3 update deps, --cov-branch 2017-05-10 14:35:23 -04:00
jab 6f5dbd4d5b tweak @knaperek's improvements from #41 + thanks 2017-03-15 15:45:40 -04:00
Jozef Knaperek 287719c22d Add test for oldstyle class handling 2017-03-15 15:16:18 -04:00
jab 887e078907 squashed changes for 0.13.0
- support Python 3.6, refactor CI/test setup, increase test coverage
- refactor BidirectionalMapping, BidictBase, OrderedBidictBase,
  FrozenBidictBase, and subclasses
- move frozenorderedbidict into _frozen and looseorderedbidict into _loose
- register bidict as a virtual subclass of MutableMapping rather than
  inheriting from it directly. This makes it clearer that it does not use any
  of the concrete generic methods that MutableMapping provides.
- improve performance and flexibility of frozenbidict and
  frozenorderedbidict hashing
- docs, including new type-hierarchy.png diagram
- rm unused imap, ifilter, izip_longest from compat, add PYPY
- update to latest versions of dependencies
- restore benchmarking on travis
2017-01-09 10:37:31 -05:00
jab efead14781 appease new flake8 rule (E305) 2016-11-21 00:54:31 -05:00
jab ffa4266737 clean up hypothesis tests
- Remove ordering checks from test_consistency_after_mutation().
  Should now be covered by test_putall().
- Remove commented out code for testing bidicts with other immutable values
  besides integers.
2016-07-03 17:36:15 -04:00
jab 8ebec833a6 add back assume for len(pruned) in hypothesis tests 2016-07-03 11:34:32 -04:00
jab b4e8f860a2 more concise OrderedBidirectionalMapping.__eq__ impl
and add tests for comparing to unordered dicts to test_equality
2016-06-30 12:48:48 -04:00
jab 62eabc3473 run benchmarks on orderedbidict as well as bidict 2016-06-29 23:50:35 -04:00
jab 476bdc77b9 test_overwriting_putall_withdup -> test_forceupdate_withdup 2016-06-29 22:04:18 -04:00
jab 4f36e8c3ba fix test_consistency for orderedbidict.forceupdate() 2016-06-29 19:47:24 -04:00
jab 79228b78e3 squashed changes for 0.12.0 2016-06-28 00:05:23 -04:00
jab c4ae97dd8b several improvements to test setup
- use latest patch releases of all python versions via pyenv
- use caching to speed up travis builds
- peg to latest versions of test deps (including hypothesis 2.0)
- set hypothesis to strict
- explicitly set average_size on strategies that accept it
- drop pypy3, not worth supporting till it catches up to cpython
- only pass --cov for python27 and 35; with other versions, it slows down
  hypothesis data generation so much, the health checks fail
- refactor tox and travis setup to use new test.sh helper script
2016-01-26 19:28:43 -05:00
jab 27160477ad add support for ordered bidict types 2015-12-25 14:13:03 -05:00
jab 2074f4b0d8 implement stricter 1-to-1 checking + many fixes + improvements
See the changelog for full details.

Closes #21.
2015-12-20 22:05:22 -05:00
jab 49d50aa82c drop support for slice and ~ syntax
closes #19
2015-11-25 17:52:54 -05:00
jab 00e9307a63 test collapse in __init__ 2015-11-25 03:23:55 -05:00
jab d7551dbf67 remove bidict.invert
closes #20
2015-11-24 23:29:22 -05:00
jab a9e36a30b3 add __version__ attribute 2015-06-06 11:59:15 -04:00
jab 34ae95f926 increase test coverage, fix compare to OrderedDict 2015-05-26 12:29:48 -04:00
jab 9e98dbb2cc add failing tests demonstrating None-slice issue
also switch from xfail to assume when WORKAROUND_NAN_BUG is True
to still test hypothesis-generated inputs that don't contain nan
2015-05-04 11:08:27 -04:00
TomV 5ef0a8ae2c refactor _fwd_slice with tests 2015-04-29 20:26:50 +01:00
jab f31a193e55 split hypothesis test into smaller individual tests 2015-04-29 14:29:35 -04:00
jab fe7e7217cb refactor, tests + docs improvements
- break up single bidict.py module into multiple separate modules inside
  "bidict" package
  - new bidict.util and bidict.compat modules
  - move/rename bidict.fancy_iteritems to bidict.util.pairs
  - move bidict.iteritems and bidict.viewitems to bidict.compat
- condense docstrings by moving more documentation into separate sphinx pages
  in "docs" dir and doctests into separate files in new "tests" dir
- initial work on property-based testing using hypothesis
- adopt pytest
- bump to 0.9.0-dev
2015-04-27 11:08:27 -04:00