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

Bas Couwenberg gitlab at salsa.debian.org
Fri Apr 10 16:04:17 BST 2020



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


Commits:
da43c067 by Bas Couwenberg at 2020-04-10T16:51:36+02:00
New upstream version 1.2.9
- - - - -


11 changed files:

- .bumpversion.cfg
- .editorconfig
- − .packit.yaml
- + .packit.yml
- CHANGELOG.rst
- deprecated/__init__.py
- deprecated/classic.py
- docs/source/conf.py
- python-deprecated.spec
- setup.py
- tox.ini


Changes:

=====================================
.bumpversion.cfg
=====================================
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 1.2.8
+current_version = 1.2.9
 commit = True
 tag = False
 message = Prepare next version {new_version} (unreleased)
@@ -19,4 +19,3 @@ replace = release = "{new_version}"
 [bumpversion:file:python-deprecated.spec]
 search = (?<=Version:\s+){current_version}
 replace = {new_version}
-


=====================================
.editorconfig
=====================================
@@ -9,5 +9,8 @@ indent_style = space
 indent_size = 4
 charset = utf-8
 
+[*.{yml,yaml}]
+indent_size = 2
+
 [*.{bat,cmd,ps1}]
 end_of_line = crlf


=====================================
.packit.yaml deleted
=====================================
@@ -1,27 +0,0 @@
-specfile_path: python-deprecated.spec
-synced_files:
-  - python-deprecated.spec
-  - .packit.yaml
-upstream_project_name: Deprecated
-downstream_package_name: python-deprecated
-create_pr: false
-jobs:
-- job: propose_downstream
-  trigger: release
-  metadata:
-    dist_git_branch: master
-- job: propose_downstream
-  trigger: release
-  metadata:
-    dist_git_branch: f30
-- job: propose_downstream
-  trigger: release
-  metadata:
-    dist_git_branch: f29
-- job: copr_build
-  trigger: pull_request
-  metadata:
-    targets:
-    - fedora-30-x86_64
-    - fedora-29-x86_64
-    - fedora-rawhide-x86_64


=====================================
.packit.yml
=====================================
@@ -0,0 +1,32 @@
+specfile_path: python-deprecated.spec
+synced_files:
+  - python-deprecated.spec
+  - .packit.yml
+upstream_project_name: Deprecated
+downstream_package_name: python-deprecated
+create_pr: false
+jobs:
+  - job: propose_downstream
+    trigger: release
+    metadata:
+      dist-git-branch: master
+  - job: propose_downstream
+    trigger: release
+    metadata:
+      dist-git-branch: fedora-all
+  - job: propose_downstream
+    trigger: release
+    metadata:
+      dist-git-branch: f30
+  - job: propose_downstream
+    trigger: release
+    metadata:
+      dist-git-branch: f29
+  - job: copr_build
+    trigger: pull_request
+    metadata:
+      targets:
+        - fedora-all
+        - fedora-30-x86_64
+        - fedora-29-x86_64
+        - fedora-rawhide-x86_64


=====================================
CHANGELOG.rst
=====================================
@@ -18,6 +18,24 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
       (only in comment or documentation).
 
 
+v1.2.9 (2020-04-10)
+===================
+
+Bug fix release
+
+Fix
+---
+
+- Fix #20: Set the :func:`warnings.warn` stacklevel to 2 if the Python implementation is `PyPy <https://www.pypy.org/>`_.
+
+- Fix packit configuration: use ``dist-git-branch: fedora-all``.
+
+Other
+-----
+
+- Change the Tox configuration to run tests on PyPy v2.7 and 3.6.
+
+
 v1.2.8 (2020-04-05)
 ===================
 


=====================================
deprecated/__init__.py
=====================================
@@ -8,6 +8,6 @@ Python ``@deprecated`` decorator to deprecate old python classes, functions or m
 """
 
 #: Module Version Number, see `PEP 396 <https://www.python.org/dev/peps/pep-0396/>`_.
-__version__ = "1.2.8"
+__version__ = "1.2.9"
 
 from deprecated.classic import deprecated


=====================================
deprecated/classic.py
=====================================
@@ -10,18 +10,24 @@ Classic ``@deprecated`` decorator to deprecate old python classes, functions or
 import functools
 import inspect
 import warnings
+import platform
 
 import wrapt
 
 try:
-    # If the c extension for wrapt was compiled and wrapt/_wrappers.pyd exists, then the
+    # If the C extension for wrapt was compiled and wrapt/_wrappers.pyd exists, then the
     # stack level that should be passed to warnings.warn should be 2. However, if using
     # a pure python wrapt, a extra stacklevel is required.
     import wrapt._wrappers
 
-    _stacklevel = 2
+    _routine_stacklevel = 2
+    _class_stacklevel = 2
 except ImportError:
-    _stacklevel = 3
+    _routine_stacklevel = 3
+    if platform.python_implementation() == "PyPy":
+        _class_stacklevel = 2
+    else:
+        _class_stacklevel = 3
 
 string_types = (type(b''), type(u''))
 
@@ -158,13 +164,13 @@ class ClassicAdapter(wrapt.AdapterFactory):
                 with warnings.catch_warnings():
                     if self.action:
                         warnings.simplefilter(self.action, self.category)
-                    warnings.warn(msg, category=self.category, stacklevel=_stacklevel)
+                    warnings.warn(msg, category=self.category, stacklevel=_class_stacklevel)
                 if old_new1 is object.__new__:
                     return old_new1(cls)
                 # actually, we don't know the real signature of *old_new1*
-                return old_new1(*args, **kwargs)
+                return old_new1(cls, *args, **kwargs)
 
-            wrapped.__new__ = classmethod(wrapped_cls)
+            wrapped.__new__ = staticmethod(wrapped_cls)
 
         return wrapped
 
@@ -271,7 +277,7 @@ def deprecated(*args, **kwargs):
                 with warnings.catch_warnings():
                     if action:
                         warnings.simplefilter(action, category)
-                    warnings.warn(msg, category=category, stacklevel=_stacklevel)
+                    warnings.warn(msg, category=category, stacklevel=_routine_stacklevel)
                 return wrapped_(*args_, **kwargs_)
 
             return wrapper_function(wrapped)


=====================================
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.8"
+release = "1.2.9"
 # The short X.Y version.
 version = release.rpartition('.')[0]
 


=====================================
python-deprecated.spec
=====================================
@@ -2,7 +2,7 @@
 %global pkgname deprecated
 
 Name:           python-%{pkgname}
-Version:        1.2.8
+Version:        1.2.9
 Release:        2%{?dist}
 Summary:        Python decorator to deprecate old python classes, functions or methods
 License:        MIT
@@ -42,8 +42,8 @@ rm -rf %{pkgname}.egg-info
 
 
 %changelog
-* Fri Jul 26 2019 Petr Hracek <phracek at redhat.com> - 1.2.8-2
+* Fri Jul 26 2019 Petr Hracek <phracek at redhat.com> - 1.2.6-2
 - Fix python3_sitelib issue
 
-* Fri Jul 26 2019 Petr Hracek <phracek at redhat.com> - 1.2.8-1
+* Fri Jul 26 2019 Petr Hracek <phracek at redhat.com> - 1.2.6-1
 - Initial package


=====================================
setup.py
=====================================
@@ -143,7 +143,7 @@ from setuptools import setup
 
 setup(
     name='Deprecated',
-    version='1.2.8',
+    version='1.2.9',
     url='https://github.com/tantale/deprecated',
     project_urls={
         "Documentation": "https://deprecated.readthedocs.io/en/latest/",
@@ -155,6 +155,7 @@ setup(
     author_email='tantale.solutions at gmail.com',
     description='Python @deprecated decorator to deprecate old python classes, functions or methods.',
     long_description=__doc__,
+    long_description_content_type="text/x-rst",
     keywords='deprecate,deprecated,deprecation,warning,warn,decorator',
     packages=['deprecated'],
     install_requires=['wrapt < 2, >= 1.10'],


=====================================
tox.ini
=====================================
@@ -8,9 +8,12 @@
 
 [tox]
 # py32 not supported by tox and pytest
+# 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}-wrapt{1.10,1.11,1.12}
-    pypy
+    pypy, pypy3
     docs
 
 [testenv]
@@ -18,9 +21,9 @@ 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,pypy: PyTest
+    py35,py36,py37,py38,pypy,pypy3: PyTest
     py27,py34: PyTest-Cov < 2.6
-    py35,py36,py37,py38,pypy: PyTest-Cov
+    py35,py36,py37,py38,pypy,pypy3: PyTest-Cov
     wrapt1.10: wrapt ~= 1.10.0
     wrapt1.11: wrapt ~= 1.11.0
     wrapt1.12: wrapt ~= 1.12.0



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

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-deprecated/-/commit/da43c0677b478eb0d9362b5255f0eb9667eb6b0f
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/20200410/2e219f38/attachment-0001.html>


More information about the Pkg-grass-devel mailing list