[Git][debian-gis-team/python-deprecated][master] 4 commits: New upstream version 1.2.10

Bas Couwenberg gitlab at salsa.debian.org
Thu May 14 05:00:45 BST 2020



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


Commits:
30a2c743 by Bas Couwenberg at 2020-05-14T05:47:25+02:00
New upstream version 1.2.10
- - - - -
994d9dee by Bas Couwenberg at 2020-05-14T05:47:32+02:00
Update upstream source from tag 'upstream/1.2.10'

Update to upstream version '1.2.10'
with Debian dir f720a82a064eb7c4ce0c92d796fdf491f9d4f19e
- - - - -
9f752a52 by Bas Couwenberg at 2020-05-14T05:47:45+02:00
New upstream release.

- - - - -
a7144a67 by Bas Couwenberg at 2020-05-14T05:49:01+02:00
Set distribution to unstable.

- - - - -


17 changed files:

- .bumpversion.cfg
- .travis.yml
- CHANGELOG.rst
- CONTRIBUTING.rst
- appveyor.yml
- debian/changelog
- deprecated/__init__.py
- deprecated/classic.py
- − docs/cover/title-page.odg
- docs/source/_static/banner.png
- docs/source/conf.py
- docs/source/installation.rst
- python-deprecated.spec
- setup.py
- tests/test_deprecated.py
- tests/test_deprecated_class.py
- tox.ini


Changes:

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


=====================================
.travis.yml
=====================================
@@ -1,17 +1,18 @@
 language: python
 python:
-  # Python **2.6** and **3.3** are no more supported
   - "2.7"
-  - "3.4"
   - "3.5"
   - "3.6"
   - "3.7"
   - "3.8"
-  - "3.8-dev"   # 3.8 development branch
-  # - "pypy"    # some unit tests fail
+  - "3.9-dev"  # 3.9 development branch
+  - "pypy"
+  - "pypy3"
+jobs:
+  allow_failures:
+    - python: "3.9-dev"
 install:
-  - pip install tox-travis
-  - pip install coveralls
+  - pip install coveralls tox-travis
 script:
   tox
 after_success:


=====================================
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.10 (2020-05-13)
+====================
+
+Bug fix release
+
+Fix
+---
+
+- Fix #25: ``@deprecated`` respects global warning filters with actions other than "ignore" and "always" on Python 3.
+
+Other
+-----
+
+- Change the configuration for TravisCI to build on pypy and pypy3.
+
+- Change the configuration for TravisCI and AppVeyor: drop configuration for Python **3.4** and add **3.8**.
+
+
 v1.2.9 (2020-04-10)
 ===================
 


=====================================
CONTRIBUTING.rst
=====================================
@@ -105,7 +105,7 @@ suite when you submit your pull request.
 
 The full test suite takes a long time to run because it tests multiple
 combinations of Python and dependencies. You need to have Python 2.7,
-3.4, 3.5, 3.6, and PyPy 2.7 installed to run all of the environments (notice
+3.4, 3.5, 3.6, PyPy 2.7 and 3.6 installed to run all of the environments (notice
 that Python **2.6** and **3.3** are no more supported). Then run::
 
     tox


=====================================
appveyor.yml
=====================================
@@ -10,12 +10,6 @@ environment:
     - PYTHON: "C:\\Python27-x64"
       TOX_ENV: "py27"
 
-    - PYTHON: "C:\\Python34"
-      TOX_ENV: "py34"
-
-    - PYTHON: "C:\\Python34-x64"
-      TOX_ENV: "py34"
-
     - PYTHON: "C:\\Python35"
       TOX_ENV: "py35"
 
@@ -34,6 +28,12 @@ environment:
     - PYTHON: "C:\\Python37-x64"
       TOX_ENV: "py37"
 
+    - PYTHON: "C:\\Python38"
+      TOX_ENV: "py38"
+
+    - PYTHON: "C:\\Python38-x64"
+      TOX_ENV: "py38"
+
 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\""


=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+python-deprecated (1.2.10-1) unstable; urgency=medium
+
+  * New upstream release.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Thu, 14 May 2020 05:48:41 +0200
+
 python-deprecated (1.2.9-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
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.9"
+__version__ = "1.2.10"
 
 from deprecated.classic import deprecated


=====================================
deprecated/classic.py
=====================================
@@ -161,9 +161,11 @@ class ClassicAdapter(wrapt.AdapterFactory):
 
             def wrapped_cls(cls, *args, **kwargs):
                 msg = self.get_deprecated_msg(wrapped, None)
-                with warnings.catch_warnings():
-                    if self.action:
+                if self.action:
+                    with warnings.catch_warnings():
                         warnings.simplefilter(self.action, self.category)
+                        warnings.warn(msg, category=self.category, stacklevel=_class_stacklevel)
+                else:
                     warnings.warn(msg, category=self.category, stacklevel=_class_stacklevel)
                 if old_new1 is object.__new__:
                     return old_new1(cls)
@@ -274,9 +276,11 @@ def deprecated(*args, **kwargs):
             @wrapt.decorator(adapter=adapter)
             def wrapper_function(wrapped_, instance_, args_, kwargs_):
                 msg = adapter.get_deprecated_msg(wrapped_, instance_)
-                with warnings.catch_warnings():
-                    if action:
+                if action:
+                    with warnings.catch_warnings():
                         warnings.simplefilter(action, category)
+                        warnings.warn(msg, category=category, stacklevel=_routine_stacklevel)
+                else:
                     warnings.warn(msg, category=category, stacklevel=_routine_stacklevel)
                 return wrapped_(*args_, **kwargs_)
 


=====================================
docs/cover/title-page.odg deleted
=====================================
Binary files a/docs/cover/title-page.odg and /dev/null differ


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


=====================================
docs/source/installation.rst
=====================================
@@ -7,7 +7,7 @@ Python Version
 --------------
 
 We recommend using the latest version of Python 3. Deprecated Library supports Python 3.4
-and newer, Python 2.7 and newer, and PyPy.
+and newer, Python 2.7 and newer, and PyPy 2.7 and 3.6.
 
 Dependencies
 ------------
@@ -167,4 +167,4 @@ On Windows, as an administrator:
 Now you can continue to :ref:`install-create-env`.
 
 .. _virtualenv: https://virtualenv.pypa.io/
-.. _get-pip.py: https://bootstrap.pypa.io/get-pip.py
\ No newline at end of file
+.. _get-pip.py: https://bootstrap.pypa.io/get-pip.py


=====================================
python-deprecated.spec
=====================================
@@ -2,7 +2,7 @@
 %global pkgname deprecated
 
 Name:           python-%{pkgname}
-Version:        1.2.9
+Version:        1.2.10
 Release:        2%{?dist}
 Summary:        Python decorator to deprecate old python classes, functions or methods
 License:        MIT


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


=====================================
tests/test_deprecated.py
=====================================
@@ -248,8 +248,9 @@ def test_respect_global_filter():
     def fun():
         print("fun")
 
-    warnings.simplefilter("ignore", category=DeprecationWarning)
+    warnings.simplefilter("once", category=DeprecationWarning)
 
     with warnings.catch_warnings(record=True) as warns:
         fun()
-    assert len(warns) == 0
+        fun()
+    assert len(warns) == 1


=====================================
tests/test_deprecated_class.py
=====================================
@@ -106,6 +106,19 @@ def test_class_deprecation_using_deprecated_decorator():
     assert issubclass(MySubClass, MyBaseClass)
 
 
+def test_class_respect_global_filter():
+    @deprecated.classic.deprecated
+    class MyBaseClass(object):
+        pass
+
+    with warnings.catch_warnings(record=True) as warns:
+        warnings.simplefilter("once")
+        obj = MyBaseClass()
+        obj = MyBaseClass()
+
+    assert len(warns) == 1
+
+
 def test_subclass_deprecation_using_deprecated_decorator():
     @deprecated.classic.deprecated
     class MyBaseClass(object):


=====================================
tox.ini
=====================================
@@ -7,26 +7,26 @@
 # and then run "tox" from this directory.
 
 [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}
+    py{27,35,36,37,38,39}-wrapt{1.10,1.11,1.12}
     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: PyTest < 5
+    py27,py35: pip >= 9.0.3, < 19.2
+    py27: PyTest < 5
     py35,py36,py37,py38,pypy,pypy3: PyTest
-    py27,py34: PyTest-Cov < 2.6
-    py35,py36,py37,py38,pypy,pypy3: PyTest-Cov
+    py27: PyTest-Cov < 2.6
+    py35,py36,py37,py38,py39,pypy,pypy3: PyTest-Cov
     wrapt1.10: wrapt ~= 1.10.0
     wrapt1.11: wrapt ~= 1.11.0
     wrapt1.12: wrapt ~= 1.12.0
+    coverage < 5
 
 [testenv:docs]
 basepython = python



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-deprecated/-/compare/32225443eab1ea9f5926a3f87bf5d7b89e7fc834...a7144a670af2ba497958aa924d5dd2072b09e12a

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-deprecated/-/compare/32225443eab1ea9f5926a3f87bf5d7b89e7fc834...a7144a670af2ba497958aa924d5dd2072b09e12a
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/20200514/5c24cf91/attachment-0001.html>


More information about the Pkg-grass-devel mailing list