[Git][debian-gis-team/pyepr][master] 7 commits: New upstream version 1.0.1

Antonio Valentino gitlab at salsa.debian.org
Sat Mar 7 14:51:49 GMT 2020



Antonio Valentino pushed to branch master at Debian GIS Project / pyepr


Commits:
4ebef73f by Antonio Valentino at 2020-03-07T13:44:22+00:00
New upstream version 1.0.1
- - - - -
1bdfd5fe by Antonio Valentino at 2020-03-07T13:44:23+00:00
Update upstream source from tag 'upstream/1.0.1'

Update to upstream version '1.0.1'
with Debian dir 21cf5dc0253de716764e8149dd18de89eb08442e
- - - - -
8c7bbf62 by Antonio Valentino at 2020-03-07T13:45:03+00:00
New upstream release

- - - - -
b81c2619 by Antonio Valentino at 2020-03-07T13:46:52+00:00
Refresh all patches

- - - - -
140942f5 by Antonio Valentino at 2020-03-07T13:48:30+00:00
Set debhelper-compat version in Build-Depends.

Fixes: lintian: uses-debhelper-compat-file
See-also: https://lintian.debian.org/tags/uses-debhelper-compat-file.html

- - - - -
af15652e by Antonio Valentino at 2020-03-07T14:46:44+00:00
Explicitly set Rules-Requires-Root: no

- - - - -
86fe0237 by Antonio Valentino at 2020-03-07T14:47:06+00:00
Set distribution to unstable

- - - - -


16 changed files:

- .travis.yml
- Makefile
- README.rst
- appveyor.yml
- + build.cmd
- debian/changelog
- − debian/compat
- debian/control
- debian/patches/0001-Only-use-local-files-for-generating-sphinx-doc.patch
- doc/NEWS.rst
- doc/conf.py
- doc/index.rst
- setup.py
- src/epr.pxd
- src/epr.pyx
- tests/test_all.py


Changes:

=====================================
.travis.yml
=====================================
@@ -6,7 +6,8 @@ python:
   - "3.5"
   - "3.6"
   - "3.7"
-  - "3.8-dev"
+  - "3.8"
+  - "nightly"
   - "pypy"
   - "pypy3"
 


=====================================
Makefile
=====================================
@@ -19,7 +19,11 @@
 # along with PyEPR.  If not, see <http://www.gnu.org/licenses/>.
 
 PYTHON = python3
-CYTHON = cython3
+CYTHON = $(PYTHON) -m cython
+DOWNLOAD = wget -c
+# DOWNLOAD = curl -C - -O
+CYTHONFLAGS=$(shell $(CYTHON) --help | grep -o -- '--3str')
+
 TEST_DATSET_URL = "http://earth.esa.int/services/sample_products/meris/LRC/L2/MER_LRC_2PTGMV20000620_104318_00000104X000_00000_00000_0001.N1.gz"
 TEST_DATSET = tests/MER_LRC_2PTGMV20000620_104318_00000104X000_00000_00000_0001.N1
 
@@ -36,7 +40,7 @@ ext: src/epr.pyx
 cythonize: src/epr.c
 
 src/epr.c: src/epr.pyx
-	$(CYTHON) src/epr.pyx
+	$(CYTHON) $(CYTHONFLAGS) src/epr.pyx
 
 sdist: doc cythonize
 	$(PYTHON) setup.py sdist
@@ -108,7 +112,8 @@ debug:
 data: $(TEST_DATSET)
 
 $(TEST_DATSET):
-	wget -P tests $(TEST_DATSET_URL)
+	$(DOWNLOAD) $(TEST_DATSET_URL)
+	mv $(shell basename $(TEST_DATSET_URL)) tests
 	gunzip $@
 
 manylinux:


=====================================
README.rst
=====================================
@@ -5,8 +5,8 @@ ENVISAT Product Reader Python API
 :HomePage:  https://avalentino.github.io/pyepr
 :Author:    Antonio Valentino
 :Contact:   antonio.valentino at tiscali.it
-:Copyright: 2011-2019, Antonio Valentino <antonio.valentino at tiscali.it>
-:Version:   1.0.0
+:Copyright: 2011-2020, Antonio Valentino <antonio.valentino at tiscali.it>
+:Version:   1.0.1
 
 .. image:: https://travis-ci.org/avalentino/pyepr.svg?branch=master
     :alt: Travis-CI status page
@@ -132,7 +132,7 @@ To install PyEPR_ in a non-standard path::
 License
 =======
 
-Copyright (C) 2011-2019 Antonio Valentino <antonio.valentino at tiscali.it>
+Copyright (C) 2011-2020 Antonio Valentino <antonio.valentino at tiscali.it>
 
 PyEPR is free software: you can redistribute it and/or modify
 it under the terms of the `GNU General Public License`_ as published by


=====================================
appveyor.yml
=====================================
@@ -1,56 +1,55 @@
 # AppVeyor.com is a Continuous Integration service to build and run tests under
 # Windows
 #
-# See also: https://github.com/astropy/astropy/blob/master/appveyor.yml
+# https://packaging.python.org/guides/supporting-windows-using-appveyor
 
 environment:
 
-  global:
-    CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\ci-helpers\\appveyor\\windows_sdk.cmd"
-    PYTHON_ARCH: "64" # needs to be set for CMD_IN_ENV to succeed. If a mix
-                      # of 32 bit and 64 bit builds are needed, move this
-                      # to the matrix section.
-    CONDA_DEPENDENCIES: "setuptools numpy Cython unittest2"
-    # DEBUG: True
-    # NUMPY_VERSION: "stable"
-
   matrix:
-    - PYTHON: "C:\\Miniconda-x64"
-      PYTHON_VERSION: "2.7"
-
-    - PYTHON: "C:\\Miniconda36-x64"
-      PYTHON_VERSION: "3.6"
 
-    - PYTHON: "C:\\Miniconda37-x64"
-      PYTHON_VERSION: "3.7"
+    # For Python versions available on Appveyor, see
+    # https://www.appveyor.com/docs/windows-images-software/#python
+    # The list here is complete (excluding Python 2.6, which
+    # isn't covered by this document) at the time of writing.
 
-platform:
-    -x64
+    - PYTHON: "C:\\Python27-x64"
+    - PYTHON: "C:\\Python35-x64"
+    - PYTHON: "C:\\Python36-x64"
+    - PYTHON: "C:\\Python37-x64"
+    - PYTHON: "C:\\Python38-x64"
 
 install:
-     # Set up ci-helpers
-    - "git clone git://github.com/astropy/ci-helpers.git"
-    - "powershell ci-helpers/appveyor/install-miniconda.ps1"
-    - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
-    - "activate test"
+  # We need wheel installed to build wheels
+  - "%PYTHON%\\python.exe -m pip install wheel cython numpy unittest2"
 
-    # epr-api
-    - "git clone -b pyepr https://github.com/avalentino/epr-api.git"
+  # epr-api
+  - "git clone -b pyepr https://github.com/avalentino/epr-api.git"
 
-# Not a .NET project, we build the python package in the install step instead
 build: false
 
 test_script:
-  # Build the compiled extension and run the project tests
-  - "%CMD_IN_ENV% python setup.py --epr-api-src=epr-api\\src test"
+  # Put your test command here.
+  # If you don't need to build C extensions on 64-bit Python 3.3 or 3.4,
+  # you can remove "build.cmd" from the front of the command, as it's
+  # only needed to support those cases.
+  # Note that you must use the environment variable %PYTHON% to refer to
+  # the interpreter you're using - Appveyor does not do anything special
+  # to put the Python version you want to use on PATH.
+  - "build.cmd %PYTHON%\\python.exe setup.py --epr-api-src=epr-api\\src test"
 
 after_test:
-  # If tests are successful, create a whl package for the project.
-  - "%CMD_IN_ENV% python setup.py --epr-api-src=epr-api\\src bdist_wheel"
+  # This step builds your wheels.
+  # Again, you only need build.cmd if you're building C extensions for
+  # 64-bit Python 3.3/3.4. And you need to use %PYTHON% to get the correct
+  # interpreter
+  - "build.cmd %PYTHON%\\python.exe setup.py --epr-api-src=epr-api\\src bdist_wheel"
 
 artifacts:
-  # Archive the generated wheel package in the ci.appveyor.com build report.
+  # bdist_wheel puts your built wheel in the dist directory
   - path: dist\*
 
 #on_success:
-#  - TODO: upload the content of dist/*.whl to a public wheelhouse
+#  You can use this step to upload your artifacts to a public website.
+#  See Appveyor's documentation for more details. Or you can simply
+#  access your wheels from the Appveyor "artifacts" tab for your build.
+


=====================================
build.cmd
=====================================
@@ -0,0 +1,21 @@
+ at echo off
+:: To build extensions for 64 bit Python 3, we need to configure environment
+:: variables to use the MSVC 2010 C++ compilers from GRMSDKX_EN_DVD.iso of:
+:: MS Windows SDK for Windows 7 and .NET Framework 4
+::
+:: More details at:
+:: https://github.com/cython/cython/wiki/CythonExtensionsOnWindows
+
+IF "%DISTUTILS_USE_SDK%"=="1" (
+    ECHO Configuring environment to build with MSVC on a 64bit architecture
+    ECHO Using Windows SDK 7.1
+    "C:\Program Files\Microsoft SDKs\Windows\v7.1\Setup\WindowsSdkVer.exe" -q -version:v7.1
+    CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 /release
+    SET MSSdk=1
+    REM Need the following to allow tox to see the SDK compiler
+    SET TOX_TESTENV_PASSENV=DISTUTILS_USE_SDK MSSdk INCLUDE LIB
+) ELSE (
+    ECHO Using default MSVC build environment
+)
+
+CALL %*


=====================================
debian/changelog
=====================================
@@ -1,10 +1,14 @@
-pyepr (1.0.0-2) UNRELEASED; urgency=medium
+pyepr (1.0.1-1) unstable; urgency=medium
 
+  * New upstream release.
   * Bump Standards-Version to 4.5.0, no changes.
   * Drop Provides: ${python3:Provides}.
   * Drop Name field from upstream metadata.
+  * Refresh all patches.
+  * Set debhelper-compat version in Build-Depends.
+  * Explicitly set Rules-Requires-Root: no.
 
- -- Antonio Valentino <antonio.valentino at tiscali.it>  Mon, 30 Sep 2019 19:45:30 +0200
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Sat, 07 Mar 2020 14:46:49 +0000
 
 pyepr (1.0.0-1) unstable; urgency=medium
 


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


=====================================
debian/control
=====================================
@@ -3,8 +3,9 @@ Maintainer: Debian GIS Project <pkg-grass-devel at lists.alioth.debian.org>
 Uploaders: Antonio Valentino <antonio.valentino at tiscali.it>
 Section: python
 Priority: optional
+Rules-Requires-Root: no
 Testsuite: autopkgtest-pkg-python
-Build-Depends: debhelper (>= 12),
+Build-Depends: debhelper-compat (= 12),
                dh-python,
                cython3,
                cython3-dbg,


=====================================
debian/patches/0001-Only-use-local-files-for-generating-sphinx-doc.patch
=====================================
@@ -11,7 +11,7 @@ happens any longer (Closes: #726859).
  1 file changed, 10 insertions(+), 8 deletions(-)
 
 diff --git a/doc/conf.py b/doc/conf.py
-index 5b7fbe8..ab0a3eb 100644
+index bcca351..7c423af 100644
 --- a/doc/conf.py
 +++ b/doc/conf.py
 @@ -136,12 +136,12 @@ html_sidebars = {


=====================================
doc/NEWS.rst
=====================================
@@ -1,6 +1,17 @@
 Change history
 ==============
 
+PyEPR 1.0.1 (07/03/2020)
+------------------------
+
+* Fixed a problem in the test using the :data:`epr.Product._fileno`
+  (only impacting MacOS-X).
+  Also some advice about the correct use of :data:`epr.Product._fileno`
+  has been added to the documentation.
+* Always close the product object during tests.
+  Prevents errors during CI cleanup actions on Windows.
+
+
 PyEPR 1.0.0 (08/09/2019)
 ------------------------
 


=====================================
doc/conf.py
=====================================
@@ -19,7 +19,7 @@ sys.path.insert(0, os.path.abspath('sphinxext'))
 # -- Project information -----------------------------------------------------
 
 project = 'PyEPR'
-copyright = '2011-2019, Antonio Valentino'
+copyright = '2011-2020, Antonio Valentino'
 author = 'Antonio Valentino'
 
 def get_version(filename='../src/epr.pyx', release=False):


=====================================
doc/index.rst
=====================================
@@ -12,7 +12,7 @@ ENVISAT Product Reader Python API
 :HomePage:  http://avalentino.github.io/pyepr
 :Author:    Antonio Valentino
 :Contact:   antonio.valentino at tiscali.it
-:Copyright: 2011-2019, Antonio Valentino
+:Copyright: 2011-2020, Antonio Valentino
 :Version:   |release|
 
 
@@ -59,21 +59,12 @@ ENVISAT Product Reader Python API
 
     Online documentation for other PyEpr_ versions:
 
-    * `latest <https://pyepr.readthedocs.io/en/latest/>`_ development
-    * `1.0.0 <https://pyepr.readthedocs.io/en/v1.0.0/>`_ (latest stable)
+    * `1.0.1 <https://pyepr.readthedocs.io/en/v1.0.0/>`_ (latest stable)
+    * `1.0.0 <https://pyepr.readthedocs.io/en/v1.0.0/>`_
     * `0.9.5 <https://pyepr.readthedocs.io/en/v0.9.5/>`_
-    * `0.9.4 <https://pyepr.readthedocs.io/en/v0.9.4/>`_
-    * `0.9.3 <https://pyepr.readthedocs.io/en/v0.9.3/>`_
-    * `0.9.2 <https://pyepr.readthedocs.io/en/v0.9.2/>`_
-    * `0.9.1 <https://pyepr.readthedocs.io/en/v0.9.1/>`_
-    * `0.9 <https://pyepr.readthedocs.io/en/v0.9/>`_
     * `0.8.2 <https://pyepr.readthedocs.io/en/v0.8.2/>`_
-    * `0.8.1 <https://pyepr.readthedocs.io/en/v0.8.1/>`_
-    * `0.8 <https://pyepr.readthedocs.io/en/v0.8/>`_
     * `0.7.1 <https://pyepr.readthedocs.io/en/v0.7.1/>`_
-    * `0.7 <https://pyepr.readthedocs.io/en/v0.7/>`_
     * `0.6.1 <https://pyepr.readthedocs.io/en/v0.6.1/>`_
-    * `0.6 <https://pyepr.readthedocs.io/en/v0.6/>`_
 
 
 License
@@ -81,7 +72,7 @@ License
 
 .. index:: license
 
-Copyright (C) 2011-2019 Antonio Valentino <antonio.valentino at tiscali.it>
+Copyright (C) 2011-2020 Antonio Valentino <antonio.valentino at tiscali.it>
 
 PyEPR is free software: you can redistribute it and/or modify
 it under the terms of the `GNU General Public License`_ as published by


=====================================
setup.py
=====================================
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2011-2019, Antonio Valentino <antonio.valentino at tiscali.it>
+# Copyright (C) 2011-2020, Antonio Valentino <antonio.valentino at tiscali.it>
 #
 # This file is part of PyEPR.
 #
@@ -245,6 +245,7 @@ any data field contained in a product file.
         'Programming Language :: Python :: 3.5',
         'Programming Language :: Python :: 3.6',
         'Programming Language :: Python :: 3.7',
+        'Programming Language :: Python :: 3.8',
         'Programming Language :: Python :: Implementation :: PyPy',
         'Programming Language :: Cython',
         'Topic :: Software Development :: Libraries',


=====================================
src/epr.pxd
=====================================
@@ -2,7 +2,7 @@
 
 # PyEPR - Python bindings for ENVISAT Product Reader API
 #
-# Copyright (C) 2011-2019, Antonio Valentino <antonio.valentino at tiscali.it>
+# Copyright (C) 2011-2020, Antonio Valentino <antonio.valentino at tiscali.it>
 #
 # This file is part of PyEPR.
 #


=====================================
src/epr.pyx
=====================================
@@ -2,7 +2,7 @@
 
 # PyEPR - Python bindings for ENVISAT Product Reader API
 #
-# Copyright (C) 2011-2019, Antonio Valentino <antonio.valentino at tiscali.it>
+# Copyright (C) 2011-2020, Antonio Valentino <antonio.valentino at tiscali.it>
 #
 # This file is part of PyEPR.
 #
@@ -41,7 +41,7 @@ in a product file.
 
 """
 
-__version__ = '1.0.0'
+__version__ = '1.0.1'
 
 from libc cimport errno
 from libc cimport stdio
@@ -2544,6 +2544,11 @@ cdef class Product(EprObject):
 
         To be used with care.
 
+        .. important::
+
+            on MacOS-X the position of the file descriptor shall be
+            reset to the original one after its use.
+
         """
 
         def __get__(self):


=====================================
tests/test_all.py
=====================================
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 # -*- coding: utf-8 -*-
 
-# Copyright (C) 2011-2019, Antonio Valentino <antonio.valentino at tiscali.it>
+# Copyright (C) 2011-2020, Antonio Valentino <antonio.valentino at tiscali.it>
 #
 # This file is part of PyEPR.
 #
@@ -18,7 +18,6 @@
 # You should have received a copy of the GNU General Public License
 # along with PyEPR.  If not, see <http://www.gnu.org/licenses/>.
 
-
 import os
 import re
 import sys
@@ -150,24 +149,24 @@ class TestOpenProduct(unittest.TestCase):
     PRODUCT_FILE = os.path.join(TESTDIR, TEST_PRODUCT)
 
     def test_open(self):
-        product = epr.open(self.PRODUCT_FILE)
-        self.assertTrue(isinstance(product, epr.Product))
-        self.assertEqual(product.mode, 'rb')
+        with epr.open(self.PRODUCT_FILE) as product:
+            self.assertTrue(isinstance(product, epr.Product))
+            self.assertEqual(product.mode, 'rb')
 
     def test_open_rb(self):
-        product = epr.open(self.PRODUCT_FILE, 'rb')
-        self.assertTrue(isinstance(product, epr.Product))
-        self.assertEqual(product.mode, 'rb')
+        with epr.open(self.PRODUCT_FILE, 'rb') as product:
+            self.assertTrue(isinstance(product, epr.Product))
+            self.assertEqual(product.mode, 'rb')
 
     def test_open_rwb_01(self):
-        product = epr.open(self.PRODUCT_FILE, 'r+b')
-        self.assertTrue(isinstance(product, epr.Product))
-        self.assertTrue(product.mode in ('r+b', 'rb+'))
+        with epr.open(self.PRODUCT_FILE, 'r+b') as product:
+            self.assertTrue(isinstance(product, epr.Product))
+            self.assertTrue(product.mode in ('r+b', 'rb+'))
 
     def test_open_rwb_02(self):
-        product = epr.open(self.PRODUCT_FILE, 'rb+')
-        self.assertTrue(isinstance(product, epr.Product))
-        self.assertTrue(product.mode in ('r+b', 'rb+'))
+        with epr.open(self.PRODUCT_FILE, 'rb+') as product:
+            self.assertTrue(isinstance(product, epr.Product))
+            self.assertTrue(product.mode in ('r+b', 'rb+'))
 
     def test_open_invalid_mode_01(self):
         self.assertRaises(ValueError, epr.open, self.PRODUCT_FILE, '')
@@ -182,20 +181,20 @@ class TestOpenProduct(unittest.TestCase):
 
         def test_open_unicode(self):
             filename = unicode(self.PRODUCT_FILE)
-            product = epr.open(filename)
-            self.assertTrue(isinstance(product, epr.Product))
+            with epr.open(filename) as product:
+                self.assertTrue(isinstance(product, epr.Product))
 
     else:
 
         def test_open_bytes(self):
             filename = self.PRODUCT_FILE.encode('UTF-8')
-            product = epr.open(filename)
-            self.assertTrue(isinstance(filename, bytes))
-            self.assertTrue(isinstance(product, epr.Product))
+            with epr.open(filename) as product:
+                self.assertTrue(isinstance(filename, bytes))
+                self.assertTrue(isinstance(product, epr.Product))
 
     def test_product_constructor(self):
-        product = epr.Product(self.PRODUCT_FILE)
-        self.assertTrue(isinstance(product, epr.Product))
+        with epr.Product(self.PRODUCT_FILE) as product:
+            self.assertTrue(isinstance(product, epr.Product))
 
     def test_open_failure(self):
         self.assertRaises(epr.EPRError, epr.open, '')
@@ -248,7 +247,7 @@ class TestProduct(unittest.TestCase):
         self.product.close()
 
     def test_flush(self):
-        self.product.close()
+        self.product.flush()
 
     def test_double_close(self):
         self.product.close()
@@ -446,10 +445,13 @@ class TestProduct(unittest.TestCase):
         self.assertTrue(isinstance(self.product._fileno, int))
 
     def test_fileno_read(self):
-        os.lseek(self.product._fileno, 0, os.SEEK_SET)
-        data = os.read(self.product._fileno, 7)
-        self.assertEqual(data, b'PRODUCT')
-
+        pos = os.lseek(self.product._fileno, 0, os.SEEK_CUR)
+        try:
+            os.lseek(self.product._fileno, 0, os.SEEK_SET)
+            data = os.read(self.product._fileno, 7)
+            self.assertEqual(data, b'PRODUCT')
+        finally:
+            os.lseek(self.product._fileno, pos, os.SEEK_SET)
 
 class TestProductRW(TestProduct):
     OPEN_MODE = 'rb+'
@@ -2427,10 +2429,13 @@ class TestFieldHighLevelAPI(unittest.TestCase):
     DATASET_NAME = TestProduct.DATASET_NAME
 
     def setUp(self):
-        product = epr.Product(self.PRODUCT_FILE)
-        dataset = product.get_dataset(self.DATASET_NAME)
+        self.product = epr.Product(self.PRODUCT_FILE)
+        dataset = self.product.get_dataset(self.DATASET_NAME)
         self.record = dataset.read_record(0)
 
+    def tearDown(self):
+        self.product.close()
+
     def test_repr(self):
         pattern = (r'epr\.Field\("(?P<name>.+)"\) (?P<num>\d+) '
                    r'(?P<type>\w+) elements')
@@ -2494,6 +2499,9 @@ class TestFieldHighLevelAPI2(unittest.TestCase):
     def setUp(self):
         self.product = epr.Product(self.PRODUCT_FILE)
 
+    def tearDown(self):
+        self.product.close()
+
     def test_len_1(self):
         dataset = self.product.get_dataset_at(0)
         record = dataset.read_record(0)
@@ -2677,8 +2685,11 @@ class TestDsdHighLevelAPI(unittest.TestCase):
     PRODUCT_FILE = os.path.join(TESTDIR, TEST_PRODUCT)
 
     def setUp(self):
-        product = epr.Product(self.PRODUCT_FILE)
-        self.dsd = product.get_dsd_at(0)
+        self.product = epr.Product(self.PRODUCT_FILE)
+        self.dsd = self.product.get_dsd_at(0)
+
+    def tearDown(self):
+        self.product.close()
 
     def test_repr(self):
         pattern = r'epr\.DSD\("(?P<name>.+)"\)'



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyepr/-/compare/868df3e9938cb0edd652f2e95b303408aa8a1bd5...86fe02375acc108cb161214e6a79b65498da7692

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyepr/-/compare/868df3e9938cb0edd652f2e95b303408aa8a1bd5...86fe02375acc108cb161214e6a79b65498da7692
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/20200307/94971975/attachment-0001.html>


More information about the Pkg-grass-devel mailing list