From 3c84419579030922bc759f4fa5dc9cc8df17001f Mon Sep 17 00:00:00 2001 From: Mirko Vogt Date: Sat, 30 May 2020 15:26:01 +0000 Subject: Add warning about venusian limitation of only scanning for *.py files --- src/pyramid/view.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pyramid/view.py b/src/pyramid/view.py index 3911ad375..bcda13733 100644 --- a/src/pyramid/view.py +++ b/src/pyramid/view.py @@ -201,6 +201,16 @@ class view_config: ``view_config`` will work ONLY on module top level members because of the limitation of ``venusian.Scanner.scan``. + Also it will ONLY work on views present as plaintext python + files (*.py), ignoring all non-*.py ones which also includes + *.pyc and *.pyo (python precompiled byte code / optimized) files. + + Another venusian specific precondition to take into account is that + python packages to be found by venusian need to have a __init__.py + file in their root directory. + + This is a limitation in venusian documented in: + https://docs.pylonsproject.org/projects/venusian/en/latest/#using-venusian """ venusian = venusian # for testing injection -- cgit v1.2.3 From 639540e2307f2e0ad92c85afd9acfd8092b51906 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 30 May 2020 16:18:45 -0700 Subject: Rewrite warning to note about Venusian scanning limitations --- src/pyramid/view.py | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/pyramid/view.py b/src/pyramid/view.py index bcda13733..65d81b8d0 100644 --- a/src/pyramid/view.py +++ b/src/pyramid/view.py @@ -196,21 +196,26 @@ class view_config: See also :ref:`mapping_views_using_a_decorator_section` for details about using :class:`pyramid.view.view_config`. - .. warning:: + .. note:: - ``view_config`` will work ONLY on module top level members - because of the limitation of ``venusian.Scanner.scan``. + Because of the limitation of ``venusian.Scanner.scan``, note that + ``view_config`` will work only for the following conditions. - Also it will ONLY work on views present as plaintext python - files (*.py), ignoring all non-*.py ones which also includes - *.pyc and *.pyo (python precompiled byte code / optimized) files. + - In Python packages that have an ``__init__.py`` file in their + directory. - Another venusian specific precondition to take into account is that - python packages to be found by venusian need to have a __init__.py - file in their root directory. + .. seealso:: - This is a limitation in venusian documented in: - https://docs.pylonsproject.org/projects/venusian/en/latest/#using-venusian + See also https://github.com/Pylons/venusian/issues/68 + + - On module top level members. + - On Python source (``.py``) files. + Compiled Python files (``.pyc``, ``.pyo``) without a corresponding + source file are ignored. + .. seealso:: + + See also the `Venusian documentation + `_. """ venusian = venusian # for testing injection -- cgit v1.2.3 From 4f221635d6b558d3a37e2237f05a4679a41978ce Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sat, 30 May 2020 16:24:02 -0700 Subject: Add required line break for end of bulleted list --- src/pyramid/view.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pyramid/view.py b/src/pyramid/view.py index 65d81b8d0..3ef90320d 100644 --- a/src/pyramid/view.py +++ b/src/pyramid/view.py @@ -212,6 +212,7 @@ class view_config: - On Python source (``.py``) files. Compiled Python files (``.pyc``, ``.pyo``) without a corresponding source file are ignored. + .. seealso:: See also the `Venusian documentation -- cgit v1.2.3 From 2847b9f5de5eefe316684b8cd03e70e443fb4b7f Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Sun, 31 May 2020 13:46:21 -0700 Subject: s/the/a in src/pyramid/view.py Co-authored-by: Bert JW Regeer --- src/pyramid/view.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pyramid/view.py b/src/pyramid/view.py index 3ef90320d..85fe73afc 100644 --- a/src/pyramid/view.py +++ b/src/pyramid/view.py @@ -198,7 +198,7 @@ class view_config: .. note:: - Because of the limitation of ``venusian.Scanner.scan``, note that + Because of a limitation of ``venusian.Scanner.scan``, note that ``view_config`` will work only for the following conditions. - In Python packages that have an ``__init__.py`` file in their -- cgit v1.2.3