Commit Graph

395 Commits

Author SHA1 Message Date
Joshua Bronson 55494459dc
Initial dependabot config. 2020-12-20 07:29:00 -05:00
Joshua Bronson a9fcf2cdf6 Add Trove classifiers for Py 3.9 and type hints 2020-12-19 09:58:33 -05:00
Joshua Bronson 8c161ca64c Improve installation, dev, and release tooling.
* Switch from install-extras to requirements.in + pip-tools for
  deterministic installation of dependencies.

* Do not use the isolated pre-commit environment for the pylint
  hook as per
  https://github.com/pre-commit/pre-commit/issues/813#issuecomment-413220498.

* Use setuptools_scm's new parentdir_prefix_version feature to fix #115.
  See pypa/setuptools_scm#477.

* Drop sphinx_autodoc_typehints; use equivalent functionality now built
  into Sphinx.
2020-11-28 10:09:31 -05:00
Joshua Bronson c2cac7c0b8 Test with Python 3.9 in CI, use Focal on Travis, upgrade to latest pylint 2020-10-28 10:42:02 -04:00
Joshua Bronson d9a1bdb20e Disable PyPy on Travis while hypothesis health checks remain flaky. 2020-10-25 11:50:59 -04:00
leonidgman 7e4c8f2f66 Add pbt's for duplication errors (#116) 2020-09-27 19:37:37 -04:00
Joshua Bronson c1f9403d47 Add pbt: test_cleared_bidicts_have_no_items (#116) 2020-09-27 13:39:47 -04:00
Joshua Bronson 07c2dcf1a7 Enable dynamic context measurement in coverage 2020-09-25 08:43:44 -04:00
jab e69ff402a9 Prefer include_package_data=True over package_data=... 2020-09-07 20:00:26 -04:00
jab aaeff8c906 Fix py.typed missing from distributions, prepare for v0.21.2 release.
Also update MANIFEST.in
and remove logo.pxm.
2020-09-07 12:06:10 -04:00
jab bb03034dec Prepare for v0.21.1 release. 2020-09-07 10:41:39 -04:00
Igor Nehoroshev 8dcdf2a391 Add py.typed file to mark package as annotated (PEP 561) 2020-09-07 10:21:48 -04:00
jab e5c38fde27 Misc. minor improvements to CI, coverage, docs
* Don't bother with Mac build on Travis
* No need to enable coverage on PyPy3 now that there's no PyPy-specific code
* Move more coverage line excludes to config
* Update old email address.
2020-09-07 10:06:49 -04:00
Joshua Bronson 947195497f Fix typo in docstring. 2020-08-22 15:27:34 -04:00
Joshua Bronson 77b9faf9e9 Small docs + test improvements + prepare for new release. 2020-08-22 10:32:51 -04:00
Joshua Bronson 0ad5284f75 Finish first pass at adding type hints.
Fixes #93.
2020-08-12 10:22:25 -04:00
Joshua Bronson 8a8e58b51f f-strings 2020-08-01 09:54:45 -04:00
Joshua Bronson 01460c86a3 reduce noisy pylint comments 2020-08-01 09:44:24 -04:00
Joshua Bronson e62d85d933 Begin adding type hints, drop Python 3.5, rm bidict.compat 2020-08-01 09:31:15 -04:00
Joshua Bronson 2efdc0e7b8 Upgrade dependencies for various extras, precommit hooks, CI
Use a single job that runs all precommit hooks in CI
rather than separate jobs for flake8, pylint, pydocstyle, etc.
2020-07-29 21:59:45 -04:00
Joshua Bronson e2514160ec Add MutableBidirectionalMapping ABC 2020-07-26 16:33:25 -04:00
Joshua Bronson eeb47fb03a Remove no-longer-true footnote about BidirectionalMapping.__subclasshook__() from "Other bidict Types" docs
Should have been removed in 5a4b6e99.
2020-07-26 13:24:17 -04:00
Joshua Bronson 54d67d057e Prepare for v0.20.0 release 2020-07-23 09:42:41 -04:00
Joshua Bronson 5a4b6e99f4 Remove BidirectionalMapping.__subclasshook__
...due to lack of use and maintenance cost.

Fixes #111.
2020-07-23 09:37:53 -04:00
jab c1e297c824 minor improvements to docs, CI, setuptools_scm pin 2020-07-01 09:27:28 -04:00
jab d96f3ac11e Correct __iter__ docstrings (s/items/keys). 2020-01-11 14:40:37 -05:00
jab 9bb1d88383 rm PY2 vestige for namedbidict tests missed by #99. 2020-01-11 12:29:57 -05:00
jab 3af1499708 docs improvements 2020-01-10 22:31:19 -05:00
jab fe269a351d Fix mis-ported @examples from 0ec3b8b.
Should make coverage more consistent again.
2020-01-10 21:49:04 -05:00
jab 9ade536188 rm IGNORE/OVERWRITE and on_dup_* compat code. 2020-01-08 21:48:51 -05:00
jab 7e13419bbf Address issue with Travis PyPI deploy introduced in c36ad9a. 2020-01-08 21:23:02 -05:00
jab dde211dfa9 prepare for v0.19.0 release 2020-01-08 21:09:38 -05:00
jab 95c40d52c8 Small internal code and docstring improvements. 2020-01-08 20:52:18 -05:00
jab f4f8c888a8 Use copy.copy rather than {_fwdm,_invm}.copy()
In case a subclass ever sets _fwdm or _invm to a Mapping that doesn't
implement a copy() method.
2020-01-07 21:58:51 -05:00
jab 0ec3b8b3e7 Various API changes and other improvements.
* Deprecate ``bidict.OVERWRITE`` and ``bidict.IGNORE``.
  A :class:`UserWarning` will now be emitted if these are used.

  :attr:`bidict.DROP_OLD` and :attr:`bidict.DROP_NEW` should be used instead.

* Rename ``DuplicationPolicy`` to :class:`~bidict.OnDupAction`
  (and implement it via an :class:`~enum.Enum`).

  A :class:`~bidict.OnDupAction` may be one of
  :attr:`~bidict.RAISE`,
  :attr:`~bidict.DROP_OLD`, or
  :attr:`~bidict.DROP_NEW`.

* Expose the new :class:`~bidict.OnDup` class,
  a named (*key*, *val*, *kv*) tuple of :class:`~bidict.OnDupAction`\s
  that should be taken upon encountering
  the 3 kinds of duplication that can occur.

* Provide the
  :attr:`~bidict.ON_DUP_DEFAULT`,
  :attr:`~bidict.ON_DUP_RAISE`, and
  :attr:`~bidict.ON_DUP_DROP_OLD`
  :class:`~bidict.OnDup` convenience instances.

* Deprecate the
  ``on_dup_key``, ``on_dup_val``, and ``on_dup_kv`` arguments
  of :meth:`~bidict.bidict.put` and :meth:`~bidict.bidict.putall`.
  A :class:`UserWarning` will now be emitted if these are used.

  They have been subsumed by the new *on_dup* argument,
  which takes an :class:`~bidict.OnDup` instance.
  Use it like this: ``bi.put(1, 2, OnDup(key=DROP_NEW))``.
  Or better yet, pass one of the
  ``ON_DUP_*`` convenience instances
  instead if possible.

  See the updated :ref:`basic-usage:Values Must Be Unique` docs for more info.

* Deprecate the
  ``on_dup_key``, ``on_dup_val``, and ``on_dup_kv``
  bidict class attributes.
  A :class:`UserWarning` will now be emitted if these are used.

  They have been subsumed by the new
  :attr:`~bidict.bidict.on_dup` class attribute,
  which takes an :class:`~bidict.OnDup` instance.

  See the updated :doc:`extending` docs for example usage.

* Move
  :meth:`bidict.BidictBase.values` to
  :meth:`bidict.BidirectionalMapping.values`,
  since the implementation is generic.

* No longer use ``__all__`` in ``bidict/__init__.py``.

* Cap max_size rather than disabling health checks and deadline as a
  less heavyhanded way to improve hypothesis test reliability on Travis.
2020-01-07 17:20:25 -05:00
jab 20d643fed0 Try travis_retry to mitigate nondeterministically stalling Travis builds.
Began occurring outside cron builds
(even with reduced HYPOTHESIS_MAX_EXAMPLES) too.
2020-01-01 14:12:32 -05:00
jab 0ade432982 Docs improvements (incl. refreshed tag line). 2020-01-01 14:11:48 -05:00
jab c7b0bac576 Better ImportError message on Python 2.
"Python 3 is required" rather than "Python 3.5+ is required".
Should have gone in fdffda2cc2.
2019-12-31 18:16:46 -05:00
jab d2b5adcce3 Happy 2020 🎉 2019-12-31 18:14:38 -05:00
jab 062e21294b Debug nondeterministically stalling Travis cron builds 2019-12-27 20:25:55 -05:00
Tim Gates f280bb2bff Fix simple typo: suppored -> supported 2019-11-18 07:43:36 -05:00
jab c36ad9a924 ditch Travis "deploy-if-tags" stage
will only tag a revision if all jobs passed
2019-11-17 20:59:34 -05:00
jab 2a873fc5b2 add SECURITY.rst 2019-11-17 20:49:17 -05:00
jab fdffda2cc2 Abort if PY2 detected in setup.py. Loosen python_requires to '>=3'. Better warning for PY3 < 3.5. 2019-11-12 21:55:10 -05:00
jab 3d62234b26 Improve delegating mixin logic.
And now provide a more efficient __iter__ implementation as well.

Also move the generic values() implementation
from BidictBase to BidirectionalMapping.

Finally, enable coverage on Travis for the Python 3.5 job
to get full coverage of "dicts preserve order?" branches.
2019-11-12 21:53:40 -05:00
jab 5bfafe0880 Remove more Python 2 vestiges missed by #99. 2019-11-12 12:40:47 -05:00
jab a836f64aa4 Remove more Python 2 vestiges missed by #99. 2019-11-09 19:36:54 -05:00
jab 4b35f4a728 rm vestigial unicode literals missed in cd73edd854 (#99). 2019-11-06 08:39:04 -05:00
jab 50e87fd804 For Mac CI, only test latest Python 3 available on Travis instead of Python from homebrew cask.
Works around minrk/homebrew-python-frameworks#1.

Also use "python3" instead of "python" now that #99 is merged.
2019-11-05 21:25:25 -05:00
jab 19e92326cb Update help.github.com URL to new 301 redirect. 2019-11-05 19:23:14 -05:00