[Git][debian-gis-team/python-affine][master] 6 commits: New upstream version 2.2.1

Bas Couwenberg gitlab at salsa.debian.org
Tue Jun 5 06:31:58 BST 2018


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


Commits:
647b3793 by Bas Couwenberg at 2018-06-05T07:14:04+02:00
New upstream version 2.2.1
- - - - -
c66bbeec by Bas Couwenberg at 2018-06-05T07:14:06+02:00
Merge tag 'upstream/2.2.1'

Upstream version 2.2.1

- - - - -
a1a9ebd4 by Bas Couwenberg at 2018-06-05T07:14:38+02:00
New upstream release.

- - - - -
0a1afecd by Bas Couwenberg at 2018-06-05T07:17:37+02:00
Add module import tests to autopkgtest configuration.

- - - - -
19dfcc7b by Bas Couwenberg at 2018-06-05T07:21:12+02:00
Use pytest instead of nose.

- - - - -
d1eb5cf9 by Bas Couwenberg at 2018-06-05T07:25:33+02:00
Set distribution to unstable.

- - - - -


14 changed files:

- .gitignore
- .travis.yml
- CHANGES.txt
- affine/__init__.py
- affine/tests/__init__.py
- debian/changelog
- debian/control
- − debian/patches/0001-Add-test-configuration.patch
- − debian/patches/series
- debian/rules
- debian/tests/control
- + requirements.txt
- setup.cfg
- setup.py


Changes:

=====================================
.gitignore
=====================================
--- a/.gitignore
+++ b/.gitignore
@@ -55,3 +55,5 @@ coverage.xml
 # Sphinx documentation
 docs/_build/
 
+__pycache__
+*.swp


=====================================
.travis.yml
=====================================
--- a/.travis.yml
+++ b/.travis.yml
@@ -5,12 +5,12 @@ python:
   - 2.7
   - 3.6
 install:
-  - pip install wheel --upgrade
+  - pip install -r requirements.txt
   - pip install .[test]
 script:
-  - pytest --cov affine --cov-report term-missing
+  - python -m pytest --cov affine --cov-report term-missing
+  - python -m pydocstyle affine
 after_success:
-  - pip install coveralls
   - coveralls
 deploy:
   on:


=====================================
CHANGES.txt
=====================================
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,10 @@
 CHANGES
 =======
 
+2.2.1 (2018-06-04)
+------------------
+- Docstring improvements (#37).
+
 2.2.0 (2018-03-20)
 ------------------
 - Addition of permutation matrix (#35).


=====================================
affine/__init__.py
=====================================
--- a/affine/__init__.py
+++ b/affine/__init__.py
@@ -47,7 +47,7 @@ import math
 
 __all__ = ['Affine']
 __author__ = "Sean Gillies"
-__version__ = "2.2.0"
+__version__ = "2.2.1"
 
 EPSILON = 1e-5
 
@@ -146,6 +146,13 @@ class Affine(
     precision = EPSILON
 
     def __new__(cls, *members):
+        """Create a new object
+
+        Parameters
+        ----------
+        members : list of float
+            Affine matrix members a, b, c, d, e, f
+        """
         if len(members) == 6:
             mat3x3 = [x * 1.0 for x in members] + [0.0, 0.0, 1.0]
             return tuple.__new__(cls, mat3x3)
@@ -255,20 +262,20 @@ class Affine(
                 (ca, -sa, px - px * ca + py * sa,
                  sa, ca, py - px * sa - py * ca,
                  0.0, 0.0, 1.0))
-                 
+
     @classmethod
     def permutation(cls, *scaling):
         """Create the permutation transform. For 2x2 matrices, there is only one permutation matrix that is not the identity.
-        
+
         :rtype: Affine
         """
-        
+
         return tuple.__new__(
             cls,
             (0.0, 1.0, 0.0,
              1.0, 0.0, 0.0,
              0.0, 0.0, 1.0))
-             
+
     def __str__(self):
         """Concise string representation."""
         return ("|% .2f,% .2f,% .2f|\n"
@@ -375,8 +382,8 @@ class Affine(
         limits, after applying the transform.
         """
         a, b, c, d, e, f, g, h, i = self
-        return ((abs(a) < self.precision and abs(e) < self.precision)
-                or (abs(d) < self.precision and abs(b) < self.precision))
+        return ((abs(a) < self.precision and abs(e) < self.precision) or
+                (abs(d) < self.precision and abs(b) < self.precision))
 
     @property
     def is_conformal(self):
@@ -400,9 +407,9 @@ class Affine(
         always results in a congruent shape.
         """
         a, b, c, d, e, f, g, h, i = self
-        return (self.is_conformal
-                and abs(1.0 - (a * a + d * d)) < self.precision
-                and abs(1.0 - (b * b + e * e)) < self.precision)
+        return (self.is_conformal and
+                abs(1.0 - (a * a + d * d)) < self.precision and
+                abs(1.0 - (b * b + e * e)) < self.precision)
 
     @cached_property
     def is_degenerate(self):
@@ -455,9 +462,11 @@ class Affine(
     __iadd__ = __add__
 
     def __mul__(self, other):
-        """Apply the transform using matrix multiplication, creating a
-        resulting object of the same type.  A transform may be applied to
-        another transform, a vector, vector array, or shape.
+        """Multiplication
+
+        Apply the transform using matrix multiplication, creating
+        a resulting object of the same type.  A transform may be applied
+        to another transform, a vector, vector array, or shape.
 
         :param other: The object to transform.
         :type other: Affine, :class:`~planar.Vec2`,
@@ -480,9 +489,14 @@ class Affine(
             return (vx * sa + vy * sb + sc, vx * sd + vy * se + sf)
 
     def __rmul__(self, other):
-        # We should not be called if other is an affine instance
-        # This is just a guarantee, since we would potentially
-        # return the wrong answer in that case.
+        """Right hand multiplication
+
+        Notes
+        -----
+        We should not be called if other is an affine instance This is
+        just a guarantee, since we would potentially return the wrong
+        answer in that case.
+        """
         assert not isinstance(other, Affine)
         return self.__mul__(other)
 
@@ -528,10 +542,14 @@ class Affine(
     __hash__ = tuple.__hash__  # hash is not inherited in Py 3
 
     def __getnewargs__(self):
-        # Required for unpickling.
-        # Normal unpickling creates a situation where __new__ receives all 9
-        # elements rather than the 6 that are required for the constructor.
-        # This method ensures that only the 6 are provided.
+        """Pickle protocol support
+
+        Notes
+        -----
+        Normal unpickling creates a situation where __new__ receives all
+        9 elements rather than the 6 that are required for the
+        constructor.  This method ensures that only the 6 are provided.
+        """
         return self.a, self.b, self.c, self.d, self.e, self.f
 
 


=====================================
affine/tests/__init__.py
=====================================
--- a/affine/tests/__init__.py
+++ b/affine/tests/__init__.py
@@ -0,0 +1 @@
+"""Affine tests package"""


=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,11 +1,14 @@
-python-affine (2.2.0-2) UNRELEASED; urgency=medium
+python-affine (2.2.1-1) unstable; urgency=medium
 
+  * New upstream release.
   * Update Vcs-* URLs for Salsa.
   * Drop override for vcs-deprecated-in-debian-infrastructure.
   * Bump Standards-Version to 4.1.4, no changes.
   * Strip trailing whitespace from control file.
+  * Add module import tests to autopkgtest configuration.
+  * Use pytest instead of nose.
 
- -- Bas Couwenberg <sebastic at debian.org>  Sat, 31 Mar 2018 12:53:15 +0200
+ -- Bas Couwenberg <sebastic at debian.org>  Tue, 05 Jun 2018 07:25:21 +0200
 
 python-affine (2.2.0-1) unstable; urgency=medium
 


=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -8,8 +8,6 @@ Build-Depends: debhelper (>= 9),
                dh-python,
                python-all,
                python3-all,
-               python-nose,
-               python3-nose,
                python-pytest,
                python3-pytest,
                python-setuptools,


=====================================
debian/patches/0001-Add-test-configuration.patch deleted
=====================================
--- a/debian/patches/0001-Add-test-configuration.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Johan Van de Wauw <johan.vandewauw at gmail.com>
-Date: Mon, 3 Nov 2014 09:16:46 +0100
-Subject: Add test configuration
-
----
- setup.cfg | 8 ++++++++
- 1 file changed, 8 insertions(+)
- create mode 100644 setup.cfg
-
---- a/setup.cfg
-+++ b/setup.cfg
-@@ -3,3 +3,12 @@ universal: 1
- 
- [tool:pytest]
- testpaths: affine/tests
-+
-+[nosetests]
-+tests=affine/tests
-+nocapture=True
-+verbosity=3
-+logging-filter=affine
-+logging-level=DEBUG
-+with-coverage=1
-+cover-package=affine


=====================================
debian/patches/series deleted
=====================================
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-0001-Add-test-configuration.patch


=====================================
debian/rules
=====================================
--- a/debian/rules
+++ b/debian/rules
@@ -1,9 +1,6 @@
 #!/usr/bin/make -f
+
 export PYBUILD_NAME=affine
 
 %:
 	dh $@ --with python2,python3 --buildsystem pybuild --parallel
-
-override_dh_auto_test:
-	PYBUILD_SYSTEM=custom \
-	PYBUILD_TEST_ARGS="nosetests {build_dir}/affine" dh_auto_test || echo "Ignoring test failures"


=====================================
debian/tests/control
=====================================
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,11 @@
 # Test installability
 Depends: @
 Test-Command: /bin/true
+
+# Test module import (Python 2)
+Depends: python-all, python-affine
+Test-Command: set -e ; for py in $(pyversions -r 2>/dev/null) ; do cd "$ADTTMP" ; echo "Testing with $py:" ; $py -c "import affine; print(affine)" ; done
+
+# Test module import (Python 3)
+Depends: python3-all, python3-affine
+Test-Command: set -e ; for py in $(py3versions -r 2>/dev/null) ; do cd "$ADTTMP" ; echo "Testing with $py:" ; $py -c "import affine; print(affine)" ; done


=====================================
requirements.txt
=====================================
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1 @@
+pydocstyle==2.1.1


=====================================
setup.cfg
=====================================
--- a/setup.cfg
+++ b/setup.cfg
@@ -3,3 +3,7 @@ universal: 1
 
 [tool:pytest]
 testpaths: affine/tests
+
+[pydocstyle]
+select: D1
+add-ignore: D105


=====================================
setup.py
=====================================
--- a/setup.py
+++ b/setup.py
@@ -5,29 +5,30 @@ from setuptools import find_packages, setup
 
 
 # Parse the version from the affine module.
-with codecs.open(os.path.join('affine', '__init__.py')) as f:
+with codecs.open(os.path.join("affine", "__init__.py")) as f:
     for line in f:
         if "__version__" in line:
             version = line.split("=")[1].strip()
             version = version.strip('"').strip("'")
             break
 
-with codecs.open('README.rst', encoding='utf-8') as f:
+with codecs.open("README.rst", encoding="utf-8") as f:
     readme = f.read()
 
 
-setup(name='affine',
-      version=version,
-      description="Matrices describing affine transformation of the plane.",
-      long_description=readme,
-      classifiers=[],
-      keywords='affine transformation matrix',
-      author='Sean Gillies',
-      author_email='sean at mapbox.com',
-      url='https://github.com/sgillies/affine',
-      license='BSD',
-      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
-      include_package_data=True,
-      zip_safe=True,
-      extras_require={'test':  ['pytest>=3.0', 'pytest-cov']}
-      )
+setup(
+    name="affine",
+    version=version,
+    description="Matrices describing affine transformation of the plane.",
+    long_description=readme,
+    classifiers=[],
+    keywords="affine transformation matrix",
+    author="Sean Gillies",
+    author_email="sean at mapbox.com",
+    url="https://github.com/sgillies/affine",
+    license="BSD",
+    packages=find_packages(exclude=["ez_setup", "examples", "tests"]),
+    include_package_data=True,
+    zip_safe=True,
+    extras_require={"test": ["pytest>=3.0", "pytest-cov", "pydocstyle", "coveralls"]},
+)



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-affine/compare/f17c968318366e5f36023ba2d5f78f2b9549cecd...d1eb5cf93bb571d8c6d3efe00b133adffbd75156

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-affine/compare/f17c968318366e5f36023ba2d5f78f2b9549cecd...d1eb5cf93bb571d8c6d3efe00b133adffbd75156
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/20180605/350688bb/attachment-0001.html>


More information about the Pkg-grass-devel mailing list