[Git][debian-gis-team/python-deprecated][experimental] 21 commits: Revert "Update branch in gbp.conf & Vcs-Git URL."

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Sun May 28 06:27:25 BST 2023



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


Commits:
3ec7e560 by Bas Couwenberg at 2021-08-15T13:07:04+02:00
Revert "Update branch in gbp.conf & Vcs-Git URL."

This reverts commit 5ce161b264fe93c9273922bc058a0f39d1ae35da.

- - - - -
7b7fdedd by Bas Couwenberg at 2021-08-15T13:07:26+02:00
Move from experimental to unstable.

- - - - -
ebacee24 by Bas Couwenberg at 2021-09-06T05:35:36+02:00
New upstream version 1.2.13
- - - - -
ed50a483 by Bas Couwenberg at 2021-09-06T05:35:41+02:00
Update upstream source from tag 'upstream/1.2.13'

Update to upstream version '1.2.13'
with Debian dir 53630a315175737d5b85c4a74f7317ce59b3281e
- - - - -
23645cec by Bas Couwenberg at 2021-09-06T05:36:11+02:00
New upstream release.

- - - - -
77e017d9 by Bas Couwenberg at 2021-09-06T05:37:28+02:00
Set distribution to unstable.

- - - - -
79efde78 by Bas Couwenberg at 2021-09-08T17:40:59+02:00
Bump Standards-Version to 4.6.0, no changes.

- - - - -
998f7904 by Bas Couwenberg at 2021-09-13T20:20:39+02:00
Bump debhelper compat to 12, no changes.

- - - - -
5e606a34 by Bas Couwenberg at 2021-10-23T19:25:52+02:00
Update watch file to use tags instead of releases.

- - - - -
8c9b7627 by Bas Couwenberg at 2021-11-05T09:38:17+01:00
Drop tox from build dependencies, add python3-setuptools. (closes: #998624)

- - - - -
7980fc31 by Bas Couwenberg at 2021-11-05T09:38:32+01:00
Set distribution to unstable.

- - - - -
ac00e23d by Bas Couwenberg at 2022-06-21T07:19:50+02:00
Bump Standards-Version to 4.6.1, no changes.

- - - - -
bce9da2e by Bas Couwenberg at 2022-09-22T20:09:31+02:00
Use pybuild-plugin-pyproject instead of python3-setuptools.

- - - - -
e4bfa9b7 by Bas Couwenberg at 2022-11-29T06:57:27+01:00
Add Rules-Requires-Root to control file.

- - - - -
4248c34f by Bas Couwenberg at 2022-12-01T15:54:35+01:00
Set distribution to unstable.

- - - - -
624bf4de by Bas Couwenberg at 2023-01-18T17:15:32+01:00
Bump Standards-Version to 4.6.2, no changes.

- - - - -
2037127d by Bas Couwenberg at 2023-05-28T07:18:03+02:00
Update branch in gbp.conf & Vcs-Git URL.

- - - - -
768f9e0f by Bas Couwenberg at 2023-05-28T07:18:28+02:00
New upstream version 1.2.14
- - - - -
0c7c13e4 by Bas Couwenberg at 2023-05-28T07:18:34+02:00
Update upstream source from tag 'upstream/1.2.14'

Update to upstream version '1.2.14'
with Debian dir ecd4ac556ae8654dd42adcd392537f782b79405e
- - - - -
f12862d9 by Bas Couwenberg at 2023-05-28T07:18:53+02:00
New upstream release.

- - - - -
6d94820f by Bas Couwenberg at 2023-05-28T07:20:40+02:00
Set distribution to experimental.

- - - - -


23 changed files:

- .bumpversion.cfg
- + .github/workflows/codeql-analysis.yml
- .github/workflows/python-package.yml
- .packit.yml
- .travis.yml
- CHANGELOG.rst
- README.md
- appveyor.yml
- debian/changelog
- − debian/compat
- debian/control
- debian/watch
- deprecated/__init__.py
- deprecated/sphinx.py
- docs/source/_static/banner.png
- docs/source/conf.py
- pyproject.toml
- 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.14
 commit = True
 tag = False
 message = Prepare next version {new_version} (unreleased)
@@ -8,6 +8,10 @@ message = Prepare next version {new_version} (unreleased)
 search = version='{current_version}'
 replace = version='{new_version}'
 
+[bumpversion:file:appveyor.yml]
+search = version: {current_version}
+replace = version: {new_version}
+
 [bumpversion:file:deprecated/__init__.py]
 search = __version__ = "{current_version}"
 replace = __version__ = "{new_version}"


=====================================
.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 v3
+
+    # 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


=====================================
.github/workflows/python-package.yml
=====================================
@@ -10,41 +10,18 @@ on:
     branches: [ master ]
 
 jobs:
-  pytest-py27-p35:
-    runs-on: ${{ matrix.platform }}
-
+  pytest:
     strategy:
       matrix:
         platform: [ ubuntu-latest, macos-latest, windows-latest ]
-        python-version: [ 2.7, 3.5 ]
-
-    steps:
-      - uses: actions/checkout at v2
-      - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python at v2
-        with:
-          python-version: ${{ matrix.python-version }}
-      - name: Install dependencies
-        run: |
-          python -m pip install --upgrade 'pip < 21'
-          python -m pip install 'PyTest < 5'
-          python -m pip install -e .
-      - name: Test with pytest
-        run: |
-          pytest tests/
+        python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
 
-  pytest-py36-py39:
     runs-on: ${{ matrix.platform }}
 
-    strategy:
-      matrix:
-        platform: [ ubuntu-latest, macos-latest, windows-latest ]
-        python-version: [ 3.6, 3.7, 3.8, 3.9 ]
-
     steps:
-      - uses: actions/checkout at v2
+      - uses: actions/checkout at v3
       - name: Set up Python ${{ matrix.python-version }}
-        uses: actions/setup-python at v2
+        uses: actions/setup-python at v4
         with:
           python-version: ${{ matrix.python-version }}
       - name: Install dependencies
@@ -55,3 +32,4 @@ jobs:
       - name: Test with pytest
         run: |
           pytest tests/
+


=====================================
.packit.yml
=====================================
@@ -15,3 +15,8 @@ jobs:
   metadata:
     targets:
     - fedora-all
+
+srpm_build_deps:
+  - python3-pip
+  - python3-setuptools_scm
+


=====================================
.travis.yml
=====================================
@@ -1,31 +1,24 @@
+dist: focal
 arch:
   - amd64
   - ppc64le
 language: python
 python:
-  - "2.7"
-  - "3.5"
-  - "3.6"
   - "3.7"
   - "3.8"
   - "3.9"
-  - "3.10-dev"  # 3.10 development branch
-  - "pypy"
-  - "pypy3"
+  - "3.10"
+  - "3.11"
+  - "3.12-dev"  # development branch
+  - "pypy3.9-7.3.9"
 jobs:
  exclude:
   - arch: ppc64le
-    python: "2.7"
-  - arch: ppc64le
-    python: "pypy"
-  - arch: ppc64le 
-    python: "pypy3"
-  - arch: amd64
-    python: "pypy"
-    
+    python: "pypy3.9-7.3.9"
+
 allow_failures:
-    - python: "3.10-dev"
-    
+    - python: "3.12-dev"
+
 install:
   - pip install coveralls tox-travis
 script:


=====================================
CHANGELOG.rst
=====================================
@@ -18,7 +18,56 @@ 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.14 (unreleased)
+====================
+
+Bug fix release
+
+Fix
+---
+
+- Fix #60: return a correctly dedented docstring when long docstring are using the D212 or D213 format.
+
+Other
+-----
+
+- Add support for Python 3.11.
+
+- Drop support for Python older than 3.7 in build systems like pytest and tox,
+  while ensuring the library remains production-compatible.
+
+- Update GitHub workflow to run in recent Python versions.
+
+
+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 +449,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,27 +1,12 @@
-# What Python version is installed where:
-# http://www.appveyor.com/docs/installed-software#python
+# Deprecated's package version, sync with setup.py
+version: 1.2.14.{build}
+# Explicitly set base image to use
+image: Visual Studio 2022
 
 environment:
   matrix:
-    # Python **2.6** and **3.3** are no more supported
-    - PYTHON: "C:\\Python27"
-      TOX_ENV: "py27"
-
-    - PYTHON: "C:\\Python27-x64"
-      TOX_ENV: "py27"
-
-    - PYTHON: "C:\\Python35"
-      TOX_ENV: "py35"
-
-    - PYTHON: "C:\\Python35-x64"
-      TOX_ENV: "py35"
-
-    - PYTHON: "C:\\Python36"
-      TOX_ENV: "py36"
-
-    - PYTHON: "C:\\Python36-x64"
-      TOX_ENV: "py36"
-
+    # What Python version is installed where:
+    # https://www.appveyor.com/docs/windows-images-software/#python
     - PYTHON: "C:\\Python37"
       TOX_ENV: "py37"
 
@@ -34,25 +19,41 @@ environment:
     - PYTHON: "C:\\Python38-x64"
       TOX_ENV: "py38"
 
+    - PYTHON: "C:\\Python39"
+      TOX_ENV: "py39"
+
+    - PYTHON: "C:\\Python39-x64"
+      TOX_ENV: "py39"
+
+    - PYTHON: "C:\\Python310"
+      TOX_ENV: "py310"
+
+    - PYTHON: "C:\\Python310-x64"
+      TOX_ENV: "py310"
+
+    - PYTHON: "C:\\Python311"
+      TOX_ENV: "py311"
+
+    - PYTHON: "C:\\Python311-x64"
+      TOX_ENV: "py311"
+
 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:


=====================================
debian/changelog
=====================================
@@ -1,8 +1,39 @@
-python-deprecated (1.2.12-1~exp2) UNRELEASED; urgency=medium
+python-deprecated (1.2.14-1~exp1) experimental; urgency=medium
+
+  * New upstream release.
+  * Bump Standards-Version to 4.6.2, no changes.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 28 May 2023 07:20:28 +0200
+
+python-deprecated (1.2.13-3) unstable; urgency=medium
+
+  * Bump Standards-Version to 4.6.1, no changes.
+  * Use pybuild-plugin-pyproject instead of python3-setuptools.
+  * Add Rules-Requires-Root to control file.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 01 Dec 2022 15:53:36 +0100
+
+python-deprecated (1.2.13-2) unstable; urgency=medium
+
+  * Bump Standards-Version to 4.6.0, no changes.
+  * Bump debhelper compat to 12, no changes.
+  * Drop tox from build dependencies, add python3-setuptools.
+    (closes: #998624)
+
+ -- Bas Couwenberg <sebastic at debian.org>  Fri, 05 Nov 2021 09:38:20 +0100
+
+python-deprecated (1.2.13-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 06 Sep 2021 05:37:18 +0200
+
+python-deprecated (1.2.12-1) unstable; urgency=medium
 
   * Update watch file for GitHub URL changes.
+  * Move from experimental to unstable.
 
- -- Bas Couwenberg <sebastic at debian.org>  Sat, 20 Mar 2021 09:07:40 +0100
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 15 Aug 2021 13:07:08 +0200
 
 python-deprecated (1.2.12-1~exp1) experimental; urgency=medium
 


=====================================
debian/compat deleted
=====================================
@@ -1 +0,0 @@
-10


=====================================
debian/control
=====================================
@@ -3,18 +3,20 @@ Maintainer: Debian GIS Project <pkg-grass-devel at lists.alioth.debian.org>
 Uploaders: Bas Couwenberg <sebastic at debian.org>
 Section: python
 Priority: optional
-Build-Depends: debhelper (>= 10~),
+Build-Depends: debhelper-compat (= 12),
                dh-python,
+               pybuild-plugin-pyproject,
                python3-all,
                python3-pytest,
                python3-pytest-cov,
+               python3-setuptools,
                python3-sphinx,
-               python3-wrapt,
-               tox
-Standards-Version: 4.5.1
+               python3-wrapt
+Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/debian-gis-team/python-deprecated
 Vcs-Git: https://salsa.debian.org/debian-gis-team/python-deprecated.git -b experimental
 Homepage: https://github.com/tantale/deprecated
+Rules-Requires-Root: no
 
 Package: python3-deprecated
 Architecture: all


=====================================
debian/watch
=====================================
@@ -3,5 +3,5 @@ opts=\
 dversionmangle=s/\+(debian|dfsg|ds|deb)\d*$//,\
 uversionmangle=s/(\d)[_\.\-\+]?((RC|rc|pre|dev|b|beta|a|alpha)\d*)$/$1~$2/,\
 filenamemangle=s/(?:.*\/)?(?:rel|v|deprecated)[\-\_]?(\d\S+)\.(tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))/deprecated-$1.$2/ \
-https://github.com/tantale/deprecated/releases \
+https://github.com/tantale/deprecated/tags \
 (?:.*?/archive/(?:.*?/)?)?(?:rel|v|deprecated)[\-\_]?(\d\S+)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz)))


=====================================
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.14"
 __author__ = u"Laurent LAPORTE <tantale.solutions at gmail.com>"
-__date__ = "2020-03-13"
+__date__ = "unreleased"
 __credits__ = "(c) Laurent LAPORTE"
 
 from deprecated.classic import deprecated


=====================================
deprecated/sphinx.py
=====================================
@@ -118,7 +118,11 @@ class SphinxAdapter(ClassicAdapter):
                 div_lines.append("")
 
         # -- get the docstring, normalize the trailing newlines
-        docstring = textwrap.dedent(wrapped.__doc__ or "")
+        # keep a consistent behaviour if the docstring starts with newline or directly on the first one
+        docstring = wrapped.__doc__ or ""
+        lines = docstring.splitlines(keepends=True) or [""]
+        docstring = textwrap.dedent("".join(lines[1:])) if len(lines) > 1 else ""
+        docstring = lines[0] + docstring
         if docstring:
             # An empty line must separate the original docstring and the directive.
             docstring = re.sub(r"\n+$", "", docstring, flags=re.DOTALL) + "\n\n"
@@ -183,13 +187,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 +216,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 +249,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.14"
 # The short X.Y version.
 version = release.rpartition('.')[0]
 


=====================================
pyproject.toml
=====================================
@@ -1,7 +1,7 @@
 [tool.black]
 line-length = 120
 skip-string-normalization = true
-target-version = ['py27', 'py34', 'py35', 'py36', 'py37', 'py38']
+target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
 include = '\.pyi?$'
 
 [tool.isort]


=====================================
python-deprecated.spec
=====================================
@@ -2,8 +2,8 @@
 %global pkgname deprecated
 
 Name:           python-%{pkgname}
-Version:        1.2.12
-Release:        2%{?dist}
+Version:        1.2.14
+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.14',
     url='https://github.com/tantale/deprecated',
     project_urls={
         "Documentation": "https://deprecated.readthedocs.io/en/latest/",
@@ -178,24 +178,18 @@ setup(
         'Programming Language :: Python :: 3.7',
         'Programming Language :: Python :: 3.8',
         'Programming Language :: Python :: 3.9',
-        # 'Programming Language :: Python :: 3.10',  # scheduled on 2021-10-04
+        'Programming Language :: Python :: 3.10',
+        'Programming Language :: Python :: 3.11',
+        'Programming Language :: Python :: 3.12',
         'Topic :: Software Development :: Libraries :: Python Modules',
     ],
     extras_require={
         'dev': [
             'tox',
-            'PyTest             ; python_version >= "3.6"',
-            'PyTest < 5         ; python_version < "3.6"',
-            'PyTest-Cov         ; python_version >= "3.6"',
-            'PyTest-Cov < 2.6   ; python_version < "3.6"',
+            'PyTest',
+            'PyTest-Cov',
             'bump2version < 1',
             'sphinx < 2',
-            # Python 2.7 EOL:
-            'importlib-metadata < 3       ; python_version < "3"',
-            'importlib-resources < 4      ; python_version < "3"',
-            'configparser < 5             ; python_version < "3"',
-            'sphinxcontrib-websupport < 2 ; python_version < "3"',
-            'zipp < 2                     ; python_version < "3"',
         ]
     },
     python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',


=====================================
tests/test_sphinx.py
=====================================
@@ -19,12 +19,18 @@ import deprecated.sphinx
         """
         This function adds *x* and *y*.
 
+        :param x: number *x*
+        :param y: number *y*
+        :return: sum = *x* + *y*
+        """,
+        """This function adds *x* and *y*.
+
         :param x: number *x*
         :param y: number *y*
         :return: sum = *x* + *y*
         """,
     ],
-    ids=["no_docstring", "short_docstring", "long_docstring"],
+    ids=["no_docstring", "short_docstring", "D213_long_docstring", "D212_long_docstring"],
 )
 def docstring(request):
     return request.param
@@ -303,7 +309,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
=====================================
@@ -8,30 +8,31 @@
 
 [tox]
 # PyPy configuration (on Linux/OSX):
-# - /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}
-    pypy, pypy3
+    py{37,38,39,310}-wrapt{1.10,1.11,1.12,1.13,1.14}
+    py{311,312}-wrapt{1.14}
+    pypy3
     docs
 
 [testenv]
 commands = pytest --cov-report term-missing --cov=deprecated tests/
 deps =
-    py27,py34,py35: pip >= 9.0.3, < 19.2
-    py27,py34: PyTest < 5
-    py35,py36,py37,py38,py39,pypy,pypy3: PyTest
-    py27,py34: PyTest-Cov < 2.6
-    py35,py36,py37,py38,py39,py310,pypy,pypy3: PyTest-Cov
+    py{37,38,39,310,311,312,py3}: PyTest
+    py{37,38,39,310,311,312,py3}: PyTest-Cov
     wrapt1.10: wrapt ~= 1.10.0
     wrapt1.11: wrapt ~= 1.11.0
     wrapt1.12: wrapt ~= 1.12.0
-    coverage < 5
+    wrapt1.13: wrapt ~= 1.13.0
+    wrapt1.14: wrapt ~= 1.14.0
+    coverage
 
 [testenv:docs]
 basepython = python
+# jinja2 3.0.3 was the last version to have contextfunction that sphinx 1.x needs
 deps =
     sphinx < 2
+    jinja2 == 3.0.3
 commands =
     sphinx-build -b html -d {envtmpdir}/doctrees docs/source/ {envtmpdir}/html
     sphinx-build -b epub -d {envtmpdir}/doctrees docs/source/ {envtmpdir}/epub



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-deprecated/-/compare/6ef109fb893db81c5a2d3fd0f9aa94801849b1ee...6d94820ff99e80c2ef6975ba2d1c3c2d6d668cc2

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-deprecated/-/compare/6ef109fb893db81c5a2d3fd0f9aa94801849b1ee...6d94820ff99e80c2ef6975ba2d1c3c2d6d668cc2
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/20230528/eb190cf5/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list