venusian
========
.. image:: https://github.com/Pylons/venusian/workflows/Build%20and%20test/badge.svg
:target: https://github.com/Pylons/venusian/actions?query=workflow%3A%22Build+and+test%22
.. image:: https://readthedocs.org/projects/venusian/badge/?version=latest
:target: https://docs.pylonsproject.org/projects/venusian/en/latest/
:alt: Documentation Status
Venusian is a library which allows framework authors to defer
decorator actions. Instead of taking actions when a function (or
class) decorator is executed at import time, you can defer the action
usually taken by the decorator until a separate "scan" phase.
See the "docs" directory of the package or the online documentation at
https://docs.pylonsproject.org/projects/venusian/en/latest/
3.1.1 (2024-12-01)
------------------
- Add support for Python 3.13 (thanks to musicinmybrain).
- Fix GitHub test actions.
3.1.0 (2023-11-06)
------------------
- Remove support for Python 3.5 and 3.6
- Add support for Python 3.9, 3.10, 3.11 and 3.12.
- Use GitHub Actions instead of Travis.
3.0.0 (2019-10-04)
------------------
- This release matches 2.0.0 other than in the version number. This fixes an
issue with Requires-Python metadata not being uploaded correctly to PyPi.
This version is only compatible with Python 3.5+
2.0.0 (2019-10-04)
------------------
- Drop support for Python 2.7, 3.3, and 3.4
- Removed the usage of the ``imp`` module to squelch the warnings regarding a
deprecated modules. See https://github.com/Pylons/venusian/pull/63 and
https://github.com/Pylons/venusian/issues/57
1.2.0 (2019-01-08)
------------------
- Add support for Python 3.7.
- Drop support for Python 3.3.
1.1.0 (2017-04-24)
------------------
- Updated to using py.test instead of nosetest, and added support for Python
3.4 -> 3.6
- Make scanning more resilient of metaclasses that return proxies for any
attribute access.
- Fix bug where using the same venusian decorator on both a class and its
methods would cause the method decorations to be ignored. See
https://github.com/Pylons/venusian/issues/40
- Drop support for Python 2.6.
- Drop support for Python 3.2: it is no longer supported by current
packaging / CI tools.
- Support loaders that require the module name as argument to their
``get_filename()`` method. This fixes problems with zipped packages
on Python 3.
- Micro-optimization when ignores are used (see
https://github.com/Pylons/venusian/pull/20).
- A tox run now combines coverage between Py2 and Py3.
1.0 (2014-06-30)
----------------
- Fix an issue under PyPy > 2.0 where attached decorators may not be found.
- Drop support of Python 2.4 / 2.5 / Jython.
- Add ``lift`` and ``onlyliftedfrom`` class decorators to allow for inheritance
of venusian decorators attached to superclass methods. See the API
documentation for more information.
- Fix bug where otherwise undecorated subclass of a superclass that had
venusian decorators on it would inherit its superclass' decorations.
Venusian decorators should have never been inherited implicitly. See
https://github.com/Pylons/venusian/issues/11#issuecomment-4977352
1.0a8 (2013-04-15)
------------------
- Pass ``ignore`` argument along recursively to ``walk_packages`` so custom
ignore functions will ignore things recursively. See
https://github.com/Pylons/venusian/pull/16
- Don't run tox tests under Python 2.4 anymore (tox no longer supports 2.4).
1.0a7 (2012-08-25)
------------------
- Venusian now works on Python 3.3b2+ (importlib-based).
- Use nose-exclude instead of relying on fragile module-scope code to ensure
we don't get errors resulting from import of fixture code during
"nosetests".
- Bug fix: no longer suppress ``ImportError`` while scanning by default. If
you want to suppress ``ImportError`` while scanning, you'll now need use an
``onerror`` callback as described in the documentation.
1.0a6 (2012-04-23)
------------------
- Don't ignore decorated objects within their original locations if they
happen to be imported into another module (remove ``seen`` set from invoke
in venusian scanning). See https://github.com/Pylons/venusian/pull/13 .
1.0a5 (2012-04-21)
------------------
- Slightly less sucky way to ignore objects during scanning that are only
imported into a module but not actually defined there. See 1.0a4 change
notes for rationale. Now instead of checking whether the module of the
*scanned object* matches the module being scanned, we check whether the
module of the *Venusian attachment* matches the module being scanned. This
allows some genuine uses of imported objects as Venusian scan targets while
preventing inappropriate double-scanning of objects that have a venusian
attachment which just happen to be imported into other scanned modules.
- Add ``dev`` and ``docs`` setup.py commands (ala Pyramid).
1.0a4 (2012-04-16)
------------------
- Attempt to ignore objects during scanning that are only imported into a
module but not actually defined there. This is a semantics change, but
it's the right thing to do, because I found myself facing a situation like
this::
# in a module named "one"
from two import anotheradecoratedthing
@adecorator
def adecoratedthing(): pass
# and scanning both modules
scan('one')
scan('two')
In this case you'd wind up with two repeated registrations for
"anotherdecoratedthing", which isn't what anyone expects.
1.0a3 (2012-02-08)
------------------
- Add an ``ignore`` argument to the ``scan`` method of a ``Scanner``. This
argument allows a user to ignore packages, modules, and global objects by
name during a ``scan``. See the "ignore Scan Argument" in the narrative
documentation for more details.
1.0a2 (2011-09-02)
------------------
- Close ImpLoader file handle to avoid resource warnings on Python 3.
1.0a1 (2011-08-27)
------------------
- Python 3 compatibility.
- Allow an ``onerror`` callback to be passed to ``Scanner.scan()``.
0.9 (2011-06-18)
----------------
- Prevent corner case scan-time exception when trying to introspect insane
module-scope objects. See https://github.com/Pylons/venusian/issues/5 .
0.8 (2011-04-30)
----------------
- Normal "setup.py test" can't support running the venusian tests under py
2.4 or 2.5; when it scans the 'classdecorators' fixture, it barfs. To get
around this, we used to depend on ``nose`` in ``setup_requires`` and tell
"setup.py test" to use nose by setting test_suite to "nose.collector" but
we can't anymore because folks use Venusian in systems which install from
pip bundles; pip bundles do not support setup_requires. So, sorry, we're
painted into a corner; at this point you just have to know to install nose
and run "setup.py nosetests" rather than "setup.py test". Or just run
"tox" which tests it under all Pythons.
0.7 (2011-03-16)
----------------
- Use Pylons theme in documentation.
- Fix orphaned pyc test on pypy.
- Fix GitHub Issue #1: subclasses of decorated classes that do not
have any decorations should not inherit the decorations of their
parent classes.
- Fix GitHub Issue #2: scans should only "find" each object once per
scan, regardless of how many modules that object is imported into.
0.6 (2011-01-09)
----------------
- Some metaclasses (Elixir's) don't raise an AttributeError when asked for a
nonexistent attribute during a scan. We now catch all exceptions when
interrogating an object for ``__venusian_callbacks__`` rather than just
AttributeError.
0.5 (2010-12-19)
----------------
- Make ``codeinfo`` attribute available as an attribute of the AttachInfo
object. It will be a tuple in the form ``(filename, lineno, function,
sourceline)`` representing the context of the venusian decorator. Eg.
``('/home/chrism/projects/venusian/tests/test_advice.py', 81,
'testCallInfo', 'add_handler(foo, bar)')``
0.4 (2010-09-03)
----------------
- Bug fix: when a venusian decorator used as a class decorator was
used against both a class *and* a subclass of that class, the
superclass and subclass would effectively share the same set of
callbacks. This was not the intent: each class declaration should
have its own local set of callbacks; callbacks added via decorations
should not be inherited, and a superclass should not receive its
subclass' decorations.
- Arrange test fixtures into a single directory.
0.3 (2010-06-24)
----------------
- Ignore orphaned modules (``.pyc`` or ``.pyo`` files without a
corresponding ``.py`` file) during a scan.
0.2 (2010-04-18)
----------------
- Add the concept of scan categories (see the "Scan Categories"
section of the documentation) to allow an application to make use of
more than one Venusian-using framework simultaneously.
0.1 (2010-02-15)
----------------
- Initial release.
Raw data
{
"_id": null,
"home_page": "https://pylonsproject.org/",
"name": "venusian",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "web wsgi zope",
"author": "Chris McDonough, Agendaless Consulting",
"author_email": "pylons-devel@googlegroups.com",
"download_url": "https://files.pythonhosted.org/packages/70/4c/eefa68085c555dc11e6744b9c6fbe5966b1c9378c47267776a448923e9a5/venusian-3.1.1.tar.gz",
"platform": null,
"description": "venusian\n========\n\n.. image:: https://github.com/Pylons/venusian/workflows/Build%20and%20test/badge.svg\n :target: https://github.com/Pylons/venusian/actions?query=workflow%3A%22Build+and+test%22\n\n.. image:: https://readthedocs.org/projects/venusian/badge/?version=latest\n :target: https://docs.pylonsproject.org/projects/venusian/en/latest/\n :alt: Documentation Status\n\nVenusian is a library which allows framework authors to defer\ndecorator actions. Instead of taking actions when a function (or\nclass) decorator is executed at import time, you can defer the action\nusually taken by the decorator until a separate \"scan\" phase.\n\nSee the \"docs\" directory of the package or the online documentation at\nhttps://docs.pylonsproject.org/projects/venusian/en/latest/\n\n3.1.1 (2024-12-01)\n------------------\n\n- Add support for Python 3.13 (thanks to musicinmybrain).\n\n- Fix GitHub test actions.\n\n3.1.0 (2023-11-06)\n------------------\n\n- Remove support for Python 3.5 and 3.6\n\n- Add support for Python 3.9, 3.10, 3.11 and 3.12.\n\n- Use GitHub Actions instead of Travis.\n\n3.0.0 (2019-10-04)\n------------------\n\n- This release matches 2.0.0 other than in the version number. This fixes an\n issue with Requires-Python metadata not being uploaded correctly to PyPi.\n\n This version is only compatible with Python 3.5+\n\n2.0.0 (2019-10-04)\n------------------\n\n- Drop support for Python 2.7, 3.3, and 3.4\n\n- Removed the usage of the ``imp`` module to squelch the warnings regarding a\n deprecated modules. See https://github.com/Pylons/venusian/pull/63 and\n https://github.com/Pylons/venusian/issues/57\n\n1.2.0 (2019-01-08)\n------------------\n\n- Add support for Python 3.7.\n\n- Drop support for Python 3.3.\n\n1.1.0 (2017-04-24)\n------------------\n\n- Updated to using py.test instead of nosetest, and added support for Python\n 3.4 -> 3.6\n\n- Make scanning more resilient of metaclasses that return proxies for any\n attribute access.\n\n- Fix bug where using the same venusian decorator on both a class and its\n methods would cause the method decorations to be ignored. See\n https://github.com/Pylons/venusian/issues/40\n\n- Drop support for Python 2.6.\n\n- Drop support for Python 3.2: it is no longer supported by current\n packaging / CI tools.\n\n- Support loaders that require the module name as argument to their\n ``get_filename()`` method. This fixes problems with zipped packages\n on Python 3.\n\n- Micro-optimization when ignores are used (see\n https://github.com/Pylons/venusian/pull/20).\n\n- A tox run now combines coverage between Py2 and Py3.\n\n1.0 (2014-06-30)\n----------------\n\n- Fix an issue under PyPy > 2.0 where attached decorators may not be found.\n\n- Drop support of Python 2.4 / 2.5 / Jython.\n\n- Add ``lift`` and ``onlyliftedfrom`` class decorators to allow for inheritance\n of venusian decorators attached to superclass methods. See the API\n documentation for more information.\n\n- Fix bug where otherwise undecorated subclass of a superclass that had\n venusian decorators on it would inherit its superclass' decorations.\n Venusian decorators should have never been inherited implicitly. See\n https://github.com/Pylons/venusian/issues/11#issuecomment-4977352\n\n1.0a8 (2013-04-15)\n------------------\n\n- Pass ``ignore`` argument along recursively to ``walk_packages`` so custom\n ignore functions will ignore things recursively. See\n https://github.com/Pylons/venusian/pull/16\n\n- Don't run tox tests under Python 2.4 anymore (tox no longer supports 2.4).\n\n1.0a7 (2012-08-25)\n------------------\n\n- Venusian now works on Python 3.3b2+ (importlib-based).\n\n- Use nose-exclude instead of relying on fragile module-scope code to ensure\n we don't get errors resulting from import of fixture code during\n \"nosetests\".\n\n- Bug fix: no longer suppress ``ImportError`` while scanning by default. If\n you want to suppress ``ImportError`` while scanning, you'll now need use an\n ``onerror`` callback as described in the documentation.\n\n1.0a6 (2012-04-23)\n------------------\n\n- Don't ignore decorated objects within their original locations if they\n happen to be imported into another module (remove ``seen`` set from invoke\n in venusian scanning). See https://github.com/Pylons/venusian/pull/13 .\n\n1.0a5 (2012-04-21)\n------------------\n\n- Slightly less sucky way to ignore objects during scanning that are only\n imported into a module but not actually defined there. See 1.0a4 change\n notes for rationale. Now instead of checking whether the module of the\n *scanned object* matches the module being scanned, we check whether the\n module of the *Venusian attachment* matches the module being scanned. This\n allows some genuine uses of imported objects as Venusian scan targets while\n preventing inappropriate double-scanning of objects that have a venusian\n attachment which just happen to be imported into other scanned modules.\n\n- Add ``dev`` and ``docs`` setup.py commands (ala Pyramid).\n\n1.0a4 (2012-04-16)\n------------------\n\n- Attempt to ignore objects during scanning that are only imported into a\n module but not actually defined there. This is a semantics change, but\n it's the right thing to do, because I found myself facing a situation like\n this::\n\n # in a module named \"one\"\n\n from two import anotheradecoratedthing\n @adecorator\n def adecoratedthing(): pass\n\n # and scanning both modules\n scan('one')\n scan('two')\n\n In this case you'd wind up with two repeated registrations for\n \"anotherdecoratedthing\", which isn't what anyone expects.\n\n1.0a3 (2012-02-08)\n------------------\n\n- Add an ``ignore`` argument to the ``scan`` method of a ``Scanner``. This\n argument allows a user to ignore packages, modules, and global objects by\n name during a ``scan``. See the \"ignore Scan Argument\" in the narrative\n documentation for more details.\n\n1.0a2 (2011-09-02)\n------------------\n\n- Close ImpLoader file handle to avoid resource warnings on Python 3.\n\n1.0a1 (2011-08-27)\n------------------\n\n- Python 3 compatibility.\n\n- Allow an ``onerror`` callback to be passed to ``Scanner.scan()``.\n\n0.9 (2011-06-18)\n----------------\n\n- Prevent corner case scan-time exception when trying to introspect insane\n module-scope objects. See https://github.com/Pylons/venusian/issues/5 .\n\n0.8 (2011-04-30)\n----------------\n\n- Normal \"setup.py test\" can't support running the venusian tests under py\n 2.4 or 2.5; when it scans the 'classdecorators' fixture, it barfs. To get\n around this, we used to depend on ``nose`` in ``setup_requires`` and tell\n \"setup.py test\" to use nose by setting test_suite to \"nose.collector\" but\n we can't anymore because folks use Venusian in systems which install from\n pip bundles; pip bundles do not support setup_requires. So, sorry, we're\n painted into a corner; at this point you just have to know to install nose\n and run \"setup.py nosetests\" rather than \"setup.py test\". Or just run\n \"tox\" which tests it under all Pythons.\n\n0.7 (2011-03-16)\n----------------\n\n- Use Pylons theme in documentation.\n\n- Fix orphaned pyc test on pypy.\n\n- Fix GitHub Issue #1: subclasses of decorated classes that do not\n have any decorations should not inherit the decorations of their\n parent classes. \n\n- Fix GitHub Issue #2: scans should only \"find\" each object once per\n scan, regardless of how many modules that object is imported into.\n\n0.6 (2011-01-09)\n----------------\n\n- Some metaclasses (Elixir's) don't raise an AttributeError when asked for a\n nonexistent attribute during a scan. We now catch all exceptions when\n interrogating an object for ``__venusian_callbacks__`` rather than just\n AttributeError.\n\n0.5 (2010-12-19)\n----------------\n\n- Make ``codeinfo`` attribute available as an attribute of the AttachInfo\n object. It will be a tuple in the form ``(filename, lineno, function,\n sourceline)`` representing the context of the venusian decorator. Eg.\n ``('/home/chrism/projects/venusian/tests/test_advice.py', 81,\n 'testCallInfo', 'add_handler(foo, bar)')``\n\n0.4 (2010-09-03)\n----------------\n\n- Bug fix: when a venusian decorator used as a class decorator was\n used against both a class *and* a subclass of that class, the\n superclass and subclass would effectively share the same set of\n callbacks. This was not the intent: each class declaration should\n have its own local set of callbacks; callbacks added via decorations\n should not be inherited, and a superclass should not receive its\n subclass' decorations.\n\n- Arrange test fixtures into a single directory.\n\n0.3 (2010-06-24)\n----------------\n\n- Ignore orphaned modules (``.pyc`` or ``.pyo`` files without a\n corresponding ``.py`` file) during a scan.\n\n0.2 (2010-04-18)\n----------------\n\n- Add the concept of scan categories (see the \"Scan Categories\"\n section of the documentation) to allow an application to make use of\n more than one Venusian-using framework simultaneously.\n\n0.1 (2010-02-15)\n----------------\n\n- Initial release.\n",
"bugtrack_url": null,
"license": "BSD-derived (Repoze)",
"summary": "A library for deferring decorator actions",
"version": "3.1.1",
"project_urls": {
"Homepage": "https://pylonsproject.org/"
},
"split_keywords": [
"web",
"wsgi",
"zope"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "5a4b34d926eba40db81b204066a60b4efdc5d8867a8efcbfe44d69b634b1c907",
"md5": "b75869349128ce03caa99aa4edaae35a",
"sha256": "0845808a985976acbceaa1fbb871c7fac4fb28ae75453232970e9c2c2866dbf4"
},
"downloads": -1,
"filename": "venusian-3.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b75869349128ce03caa99aa4edaae35a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 14026,
"upload_time": "2024-12-02T02:35:03",
"upload_time_iso_8601": "2024-12-02T02:35:03.056196Z",
"url": "https://files.pythonhosted.org/packages/5a/4b/34d926eba40db81b204066a60b4efdc5d8867a8efcbfe44d69b634b1c907/venusian-3.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "704ceefa68085c555dc11e6744b9c6fbe5966b1c9378c47267776a448923e9a5",
"md5": "c7d45065905eceebb5ce54b2e72590f9",
"sha256": "534fb3b355669283eb3954581931e5d1d071fce61d029d58f3219a5e3a6f0c41"
},
"downloads": -1,
"filename": "venusian-3.1.1.tar.gz",
"has_sig": false,
"md5_digest": "c7d45065905eceebb5ce54b2e72590f9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 39269,
"upload_time": "2024-12-02T02:35:04",
"upload_time_iso_8601": "2024-12-02T02:35:04.033357Z",
"url": "https://files.pythonhosted.org/packages/70/4c/eefa68085c555dc11e6744b9c6fbe5966b1c9378c47267776a448923e9a5/venusian-3.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-02 02:35:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "venusian"
}