[Git][debian-gis-team/python-deprecated][upstream] New upstream version 1.2.13

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Mon Sep 6 04:41:47 BST 2021



Bas Couwenberg pushed to branch upstream at Debian GIS Project / python-deprecated


Commits:
ebacee24 by Bas Couwenberg at 2021-09-06T05:35:36+02:00
New upstream version 1.2.13
- - - - -


15 changed files:

- .bumpversion.cfg
- + .github/workflows/codeql-analysis.yml
- CHANGELOG.rst
- README.md
- appveyor.yml
- deprecated/__init__.py
- deprecated/sphinx.py
- docs/source/_static/banner.png
- docs/source/conf.py
- python-deprecated.spec
- setup.cfg
- setup.py
- tests/test_sphinx.py
- tests/test_sphinx_class.py
- tox.ini


Changes:

=====================================
.bumpversion.cfg
=====================================
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 1.2.12
+current_version = 1.2.13
 commit = True
 tag = False
 message = Prepare next version {new_version} (unreleased)


=====================================
.github/workflows/codeql-analysis.yml
=====================================
@@ -0,0 +1,71 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    # The branches below must be a subset of the branches above
+    branches: [ master ]
+  schedule:
+    - cron: '22 8 * * 1'
+
+jobs:
+  analyze:
+    name: Analyze
+    runs-on: ubuntu-latest
+    permissions:
+      actions: read
+      contents: read
+      security-events: write
+
+    strategy:
+      fail-fast: false
+      matrix:
+        language: [ 'python' ]
+        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
+        # Learn more:
+        # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout at v2
+
+    # Initializes the CodeQL tools for scanning.
+    - name: Initialize CodeQL
+      uses: github/codeql-action/init at v1
+      with:
+        languages: ${{ matrix.language }}
+        # If you wish to specify custom queries, you can do so here or in a config file.
+        # By default, queries listed here will override any specified in a config file.
+        # Prefix the list here with "+" to use these queries and those in the config file.
+        # queries: ./path/to/local/query, your-org/your-repo/queries at main
+
+    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
+    # If this step fails, then you should remove it and run the build manually (see below)
+    - name: Autobuild
+      uses: github/codeql-action/autobuild at v1
+
+    # ℹ️ Command-line programs to run using the OS shell..
+    # 📚 https://git.io/JvXDl
+
+    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+    #    and modify them (or add more) to build your code if your project
+    #    uses a compiled language
+
+    #- run: |
+    #   make bootstrap
+    #   make release
+
+    - name: Perform CodeQL Analysis
+      uses: github/codeql-action/analyze at v1


=====================================
CHANGELOG.rst
=====================================
@@ -18,7 +18,35 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
       (only in comment or documentation).
 
 
-v1.2.12 (2020-03-13)
+v1.2.13 (2021-09-05)
+====================
+
+Bug fix release
+
+Fix
+---
+
+- Fix #45: Change the signature of the :func:`~deprecated.sphinx.deprecated` decorator to reflect
+  the valid use cases.
+
+- Fix #48: Fix ``versionadded`` and ``versionchanged`` decorators: do not return a decorator factory,
+  but a Wrapt adapter.
+
+Other
+-----
+
+- Fix configuration for AppVeyor: simplify the test scripts and set the version format to match the current version.
+
+- Change configuration for Tox:
+
+  + change the requirements for ``pip`` to "pip >= 9.0.3, < 21" (Python 2.7, 3.4 and 3.5).
+  + install ``typing`` when building on Python 3.4 (required by Pytest->Attrs).
+  + run unit tests on Wrapt 1.13 (release candidate).
+
+- Migrating project to `travis-ci.com <https://travis-ci.com/github/tantale/deprecated>`_.
+
+
+v1.2.12 (2021-03-13)
 ====================
 
 Bug fix release
@@ -400,7 +428,7 @@ Added
 Other
 -----
 
-- Improve `Travis <https://travis-ci.org/>`_ configuration file (compatibility from Python 2.6 to 3.7-dev, and PyPy).
+- Improve `Travis <https://travis-ci.com/>`_ configuration file (compatibility from Python 2.6 to 3.7-dev, and PyPy).
 - Add `AppVeyor <https://www.appveyor.com/docs/>`_ configuration file.
 - Add `Tox <https://tox.readthedocs.io/en/latest/>`_ configuration file.
 - Add `BumpVersion <https://github.com/peritus/bumpversion>`_ configuration file.


=====================================
README.md
=====================================
@@ -2,7 +2,7 @@
 
 Python ``@deprecated`` decorator to deprecate old python classes, functions or methods.
 
-[![Build Status](https://travis-ci.org/tantale/deprecated.svg?branch=master)](https://travis-ci.org/tantale/deprecated)
+[![Build Status](https://travis-ci.com/tantale/deprecated.svg?branch=master)](https://travis-ci.com/tantale/deprecated)
 [![Build status](https://ci.appveyor.com/api/projects/status/ctgktcdg2pf8lsxe?svg=true)](https://ci.appveyor.com/project/tantale/deprecated)
 [![Coverage Status](https://coveralls.io/repos/github/tantale/deprecated/badge.svg?branch=master)](https://coveralls.io/github/tantale/deprecated?branch=master)
 [![GitHub version](https://badge.fury.io/gh/tantale%2Fdeprecated.svg)](https://badge.fury.io/gh/tantale%2Fdeprecated)


=====================================
appveyor.yml
=====================================
@@ -1,6 +1,8 @@
 # What Python version is installed where:
 # http://www.appveyor.com/docs/installed-software#python
 
+version: 1.2.13.{build}
+
 environment:
   matrix:
     # Python **2.6** and **3.3** are no more supported
@@ -37,22 +39,20 @@ environment:
 init:
   - set PATH=%PYTHON%;%PYTHON%\Scripts;C:\MinGW\msys\1.0\bin;%PATH%
   - "git config --system http.sslcainfo \"C:\\Program Files\\Git\\mingw64\\ssl\\certs\\ca-bundle.crt\""
-  - "%PYTHON%/python -V"
-  - "%PYTHON%/python -c \"import struct;print(8 * struct.calcsize(\'P\'))\""
+  - "%PYTHON%\\python.exe -V"
+  - "%PYTHON%\\python.exe -c \"import struct;print(8 * struct.calcsize(\'P\'))\""
 
 install:
-  - "%PYTHON%/Scripts/easy_install -U pip"
-  - "%PYTHON%/Scripts/pip install -U setuptools"
-  - "%PYTHON%/Scripts/pip install tox"
-  - "%PYTHON%/Scripts/pip install wheel"
+  - "%PYTHON%\\python.exe -m pip install wheel"
+  - "%PYTHON%\\python.exe -m pip install tox"
 
-build: off  # Not a C# project, build stuff at the test step instead.
+build: false  # Not a C# project, build stuff at the test step instead.
 
 test_script:
-  - "%PYTHON%/Scripts/tox -e %TOX_ENV%"
+  - "%PYTHON%\\Scripts\\tox.exe -e %TOX_ENV%"
 
 after_test:
-  - "%PYTHON%/python setup.py --command-packages wheel bdist_wheel"
+  - "%PYTHON%\\python.exe setup.py --command-packages wheel bdist_wheel"
   - ps: "ls dist"
 
 artifacts:


=====================================
deprecated/__init__.py
=====================================
@@ -7,9 +7,9 @@ Python ``@deprecated`` decorator to deprecate old python classes, functions or m
 
 """
 
-__version__ = "1.2.12"
+__version__ = "1.2.13"
 __author__ = u"Laurent LAPORTE <tantale.solutions at gmail.com>"
-__date__ = "2020-03-13"
+__date__ = "2021-09-05"
 __credits__ = "(c) Laurent LAPORTE"
 
 from deprecated.classic import deprecated


=====================================
deprecated/sphinx.py
=====================================
@@ -183,13 +183,7 @@ def versionadded(reason="", version="", line_length=70):
         version=version,
         line_length=line_length,
     )
-
-    # noinspection PyUnusedLocal
-    @wrapt.decorator(adapter=adapter)
-    def wrapper(wrapped, instance, args, kwargs):
-        return wrapped(*args, **kwargs)
-
-    return wrapper
+    return adapter
 
 
 def versionchanged(reason="", version="", line_length=70):
@@ -218,31 +212,29 @@ def versionchanged(reason="", version="", line_length=70):
         version=version,
         line_length=line_length,
     )
-
-    # noinspection PyUnusedLocal
-    @wrapt.decorator(adapter=adapter)
-    def wrapper(wrapped, instance, args, kwargs):
-        return wrapped(*args, **kwargs)
-
-    return wrapper
+    return adapter
 
 
-def deprecated(*args, **kwargs):
+def deprecated(reason="", version="", line_length=70, **kwargs):
     """
     This decorator can be used to insert a "deprecated" directive
     in your function/class docstring in order to documents the
     version of the project which deprecates this functionality in your library.
 
-    Keyword arguments can be:
-
-    -   "reason":
+    :param str reason:
         Reason message which documents the deprecation in your library (can be omitted).
 
-    -   "version":
+    :param str version:
         Version of your project which deprecates this feature.
         If you follow the `Semantic Versioning <https://semver.org/>`_,
         the version number has the format "MAJOR.MINOR.PATCH".
 
+    :type  line_length: int
+    :param line_length:
+        Max line length of the directive text. If non nul, a long text is wrapped in several lines.
+
+    Keyword arguments can be:
+
     -   "action":
         A warning filter used to activate or not the deprecation warning..
         Can be one of "error", "ignore", "always", "default", "module", or "once".
@@ -253,11 +245,14 @@ def deprecated(*args, **kwargs):
         By default, the category class is :class:`~DeprecationWarning`,
         you can inherit this class to define your own deprecation warning category.
 
-    -   "line_length":
-        Max line length of the directive text. If non nul, a long text is wrapped in several lines.
+    :return: a decorator used to deprecate a function.
 
-    :return: the decorated function.
+    .. versionchanged:: 1.2.13
+       Change the signature of the decorator to reflect the valid use cases.
     """
     directive = kwargs.pop('directive', 'deprecated')
     adapter_cls = kwargs.pop('adapter_cls', SphinxAdapter)
-    return _classic_deprecated(*args, directive=directive, adapter_cls=adapter_cls, **kwargs)
+    kwargs["reason"] = reason
+    kwargs["version"] = version
+    kwargs["line_length"] = line_length
+    return _classic_deprecated(directive=directive, adapter_cls=adapter_cls, **kwargs)


=====================================
docs/source/_static/banner.png
=====================================
Binary files a/docs/source/_static/banner.png and b/docs/source/_static/banner.png differ


=====================================
docs/source/conf.py
=====================================
@@ -61,7 +61,7 @@ author = 'Marcos CARDOSO & Laurent LAPORTE'
 # built documents.
 #
 # The full version, including alpha/beta/rc tags.
-release = "1.2.12"
+release = "1.2.13"
 # The short X.Y version.
 version = release.rpartition('.')[0]
 


=====================================
python-deprecated.spec
=====================================
@@ -2,8 +2,8 @@
 %global pkgname deprecated
 
 Name:           python-%{pkgname}
-Version:        1.2.12
-Release:        2%{?dist}
+Version:        1.2.13
+Release:        1%{?dist}
 Summary:        Python decorator to deprecate old python classes, functions or methods
 License:        MIT
 URL:            https://github.com/tantale/%{pkgname}


=====================================
setup.cfg
=====================================
@@ -8,8 +8,5 @@ python_files = test*.py
 release = egg_info -D -b '' sdist bdist_wheel
 
 [build_sphinx]
-source-dir = docs/source
-build-dir = dist/docs
-
-[upload_docs]
-upload-dir = dist/docs/html
+source_dir = docs/source
+build_dir = dist/docs


=====================================
setup.py
=====================================
@@ -143,7 +143,7 @@ from setuptools import setup
 
 setup(
     name='Deprecated',
-    version='1.2.12',
+    version='1.2.13',
     url='https://github.com/tantale/deprecated',
     project_urls={
         "Documentation": "https://deprecated.readthedocs.io/en/latest/",


=====================================
tests/test_sphinx.py
=====================================
@@ -303,7 +303,10 @@ def test_sphinx_deprecated_class_method__warns(sphinx_deprecated_class_method):
 
 def test_should_raise_type_error():
     try:
-        deprecated.sphinx.deprecated(5)
+        @deprecated.sphinx.deprecated(version="4.5.6", reason=5)
+        def foo():
+            pass
+
         assert False, "TypeError not raised"
     except TypeError:
         pass


=====================================
tests/test_sphinx_class.py
=====================================
@@ -82,3 +82,68 @@ def test_subclass_deprecation_using_deprecated_decorator():
     assert isinstance(obj, MyBaseClass)
     assert inspect.isclass(MyBaseClass)
     assert issubclass(MySubClass, MyBaseClass)
+
+
+ at pytest.mark.skipif(
+    sys.version_info < (3, 3), reason="Classes should have mutable docstrings -- resolved in python 3.3"
+)
+def test_isinstance_versionadded():
+    # https://github.com/tantale/deprecated/issues/48
+    @deprecated.sphinx.versionadded(version="X.Y", reason="some reason")
+    class VersionAddedCls:
+        pass
+
+    @deprecated.sphinx.versionadded(version="X.Y", reason="some reason")
+    class VersionAddedChildCls(VersionAddedCls):
+        pass
+
+    instance = VersionAddedChildCls()
+    assert isinstance(instance, VersionAddedChildCls)
+    assert isinstance(instance, VersionAddedCls)
+
+
+ at pytest.mark.skipif(
+    sys.version_info < (3, 3), reason="Classes should have mutable docstrings -- resolved in python 3.3"
+)
+def test_isinstance_versionchanged():
+    @deprecated.sphinx.versionchanged(version="X.Y", reason="some reason")
+    class VersionChangedCls:
+        pass
+
+    @deprecated.sphinx.versionchanged(version="X.Y", reason="some reason")
+    class VersionChangedChildCls(VersionChangedCls):
+        pass
+
+    instance = VersionChangedChildCls()
+    assert isinstance(instance, VersionChangedChildCls)
+    assert isinstance(instance, VersionChangedCls)
+
+
+ at pytest.mark.skipif(
+    sys.version_info < (3, 3), reason="Classes should have mutable docstrings -- resolved in python 3.3"
+)
+def test_isinstance_deprecated():
+    @deprecated.sphinx.deprecated(version="X.Y", reason="some reason")
+    class DeprecatedCls:
+        pass
+
+    @deprecated.sphinx.deprecated(version="Y.Z", reason="some reason")
+    class DeprecatedChildCls(DeprecatedCls):
+        pass
+
+    instance = DeprecatedChildCls()
+    assert isinstance(instance, DeprecatedChildCls)
+    assert isinstance(instance, DeprecatedCls)
+
+
+ at pytest.mark.skipif(
+    sys.version_info < (3, 3), reason="Classes should have mutable docstrings -- resolved in python 3.3"
+)
+def test_isinstance_versionadded_versionchanged():
+    @deprecated.sphinx.versionadded(version="X.Y")
+    @deprecated.sphinx.versionchanged(version="X.Y.Z")
+    class AddedChangedCls:
+        pass
+
+    instance = AddedChangedCls()
+    assert isinstance(instance, AddedChangedCls)


=====================================
tox.ini
=====================================
@@ -11,21 +11,23 @@
 # - /usr/local/bin/pypy -> /opt/pypy2.7-v7.3.0-osx64/bin/pypy
 # - /usr/local/bin/pypy3 -> /opt/pypy3.6-v7.3.0-osx64/bin/pypy3
 envlist =
-    py{27,34,35,36,37,38,39,310}-wrapt{1.10,1.11,1.12}
+    py{27,34,35,36,37,38,39,310}-wrapt{1.10,1.11,1.12,1.13}
     pypy, pypy3
     docs
 
 [testenv]
 commands = pytest --cov-report term-missing --cov=deprecated tests/
 deps =
-    py27,py34,py35: pip >= 9.0.3, < 19.2
+    py27,py34,py35: pip >= 9.0.3, < 21
     py27,py34: PyTest < 5
     py35,py36,py37,py38,py39,pypy,pypy3: PyTest
     py27,py34: PyTest-Cov < 2.6
+    py34: typing  # required by pytest->attrs
     py35,py36,py37,py38,py39,py310,pypy,pypy3: PyTest-Cov
     wrapt1.10: wrapt ~= 1.10.0
     wrapt1.11: wrapt ~= 1.11.0
     wrapt1.12: wrapt ~= 1.12.0
+    wrapt1.13: wrapt == 1.13.0rc3
     coverage < 5
 
 [testenv:docs]



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-deprecated/-/commit/ebacee2428a178473f3df8e35fbeb7cae1b850e0

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-deprecated/-/commit/ebacee2428a178473f3df8e35fbeb7cae1b850e0
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20210906/912bbfac/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list