[Git][debian-gis-team/cftime][master] 5 commits: New upstream version 1.3.1+ds

Bas Couwenberg gitlab at salsa.debian.org
Sun Jan 17 19:05:20 GMT 2021



Bas Couwenberg pushed to branch master at Debian GIS Project / cftime


Commits:
ccdc5664 by Bas Couwenberg at 2021-01-17T19:53:10+01:00
New upstream version 1.3.1+ds
- - - - -
826685a6 by Bas Couwenberg at 2021-01-17T19:53:11+01:00
Update upstream source from tag 'upstream/1.3.1+ds'

Update to upstream version '1.3.1+ds'
with Debian dir 8c6b97c6fc1fe9f1b7e664fc9d8a7e7eae06ce1f
- - - - -
eca1e4c4 by Bas Couwenberg at 2021-01-17T19:53:54+01:00
New upstream release.

- - - - -
71e4eb4a by Bas Couwenberg at 2021-01-17T19:59:56+01:00
Update lintian overrides.

- - - - -
3ce983da by Bas Couwenberg at 2021-01-17T19:59:56+01:00
Set distribution to unstable.

- - - - -


14 changed files:

- .appveyor.yml → .appveyor.yml.legacy
- .coveragerc
- + .github/workflows/miniconda.yml
- .travis.yml → .travis.yml.legacy
- Changelog
- MANIFEST.in
- README.md
- debian/changelog
- − debian/lintian-overrides
- setup.py
- cftime/__init__.py → src/cftime/__init__.py
- cftime/_cftime.pyx → src/cftime/_cftime.pyx
- + test/__init__.py
- test/test_cftime.py


Changes:

=====================================
.appveyor.yml → .appveyor.yml.legacy
=====================================


=====================================
.coveragerc
=====================================
@@ -3,6 +3,7 @@
 #
 
 [run]
+relative_files = True
 branch = True
 plugins = Cython.Coverage
 include =


=====================================
.github/workflows/miniconda.yml
=====================================
@@ -0,0 +1,80 @@
+name: cftime test
+
+on:
+  pull_request:
+  push:
+    branches: [master]
+
+jobs:
+  run:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        python-version: [ "3.7", "3.8", "3.9"]
+        os: [windows-latest, ubuntu-latest, macos-latest]
+        platform: [x64, x32]
+#  debug on a single os/platform/python version
+#       python-version: [ "3.9"]
+#       os: [ubuntu-latest]
+#       platform: [x64]
+        exclude:
+          - os: macos-latest  
+            platform: x32
+
+    env:
+      TRAVIS_BUILD_DIR: ${{ github.workspace }}
+      TRAVIS_REPO_SLUG: ${{ github.repository }}
+
+    steps:
+
+    - uses: actions/checkout at v2
+
+    - name: Setup Conda
+      uses: s-weigand/setup-conda at v1
+      with:
+        activate-conda: false
+        conda-channels: conda-forge
+
+    - name: Setup Conda Env
+      shell: bash -l {0}
+      run: |
+        conda create --name TEST python=${{ matrix.python-version }} --file requirements.txt --file requirements-dev.txt
+        source activate TEST
+        CYTHON_COVERAGE=1 pip install -v -e  . --no-deps --force-reinstall
+        conda info --all
+        conda list
+
+    - name: Run Tests
+      shell: bash -l {0}
+      run: |
+        source activate TEST
+        py.test -vv test
+
+    - name: Coveralls
+      env:
+        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+      if: startsWith(matrix.os,'ubuntu')
+      run: |
+        source activate TEST
+        coveralls
+
+    - name: Tarball
+      if: startsWith(matrix.os,'ubuntu')
+      shell: bash -l {0}
+      run: |
+        source activate TEST
+        python setup.py --version ; 
+        pip wheel . -w dist --no-deps ;
+        check-manifest --verbose ;
+        twine check dist/* ;
+ 
+    - name: Docs
+      if: startsWith(matrix.os,'ubuntu')
+      shell: bash -l {0}
+      run: |
+        source activate TEST
+        pushd docs && make html linkcheck O=-W && popd;
+        #rm -f docs/build/html/_static/jquery-*.js
+        #rm -f docs/build/html/_static/underscore-*.js
+        #rm -f docs/build/html/.buildinfo
+        #sh ./ci/deploy_docs.sh


=====================================
.travis.yml → .travis.yml.legacy
=====================================


=====================================
Changelog
=====================================
@@ -1,3 +1,15 @@
+version 1.3.1 (release tag v1.3.1rel)
+=====================================
+ * fix for issue #211 (PR #212) bug in masked array handling in date2num)
+ * switch from travis/appveyor to github actions for CI/CD (PR #215).
+ * switch to cython language_level=3 (no more support for python 2) (PR #217).
+ * add __init__.py to test dir so pytest coverage works again. Add Coveralls
+   step to github actions workflow to upload coverage data to coveralls.io (PR
+   #217).
+ * move package under 'src' directory so cftime can be imported
+   from install dir (PR #218 - see
+   https://blog.ionelmc.ro/2014/05/25/python-packaging/#the-structure).
+
 version 1.3.0 (release tag v1.3.0rel)
 =====================================
  * zero pad years in strtime (issue #194)


=====================================
MANIFEST.in
=====================================
@@ -3,6 +3,7 @@ include README.md
 include COPYING
 include pyproject.toml
 include Changelog
-recursive-include cftime *.py
-recursive-include cftime *.pyx
-recursive-exclude cftime *.c
+exclude *.legacy
+recursive-include src *.py
+recursive-include src *.pyx
+recursive-include test *.py


=====================================
README.md
=====================================
@@ -1,8 +1,7 @@
 # cftime
 Time-handling functionality from netcdf4-python
 
-[![Linux Build Status](https://travis-ci.org/Unidata/cftime.svg?branch=master)](https://travis-ci.org/Unidata/cftime)
-[![Windows Build Status](https://ci.appveyor.com/api/projects/status/fl9taa9je4e6wi7n/branch/master?svg=true)](https://ci.appveyor.com/project/jswhit/cftime/branch/master)
+[![Build status](https://github.com/Unidata/cftime/workflows/cftime%20test/badge.svg)](https://github.com/Unidata/cftime/actions)
 [![PyPI package](https://badge.fury.io/py/cftime.svg)](http://python.org/pypi/cftime)
 [![Coverage Status](https://coveralls.io/repos/github/Unidata/cftime/badge.svg?branch=master)](https://coveralls.io/github/Unidata/cftime?branch=master)
 [![Tag Status](https://img.shields.io/github/tag/UniData/cftime.svg)](https://github.com/Unidata/cftime/tags)


=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+cftime (1.3.1+ds-1) unstable; urgency=medium
+
+  * New upstream release.
+  * Update lintian overrides.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Sun, 17 Jan 2021 19:54:26 +0100
+
 cftime (1.3.0+ds-1) unstable; urgency=medium
 
   * New upstream release.


=====================================
debian/lintian-overrides deleted
=====================================
@@ -1,3 +0,0 @@
-# Cannot easily be fixed
-file-references-package-build-path *
-


=====================================
setup.py
=====================================
@@ -14,12 +14,13 @@ except ImportError:
 
 
 BASEDIR = os.path.abspath(os.path.dirname(__file__))
+SRCDIR = os.path.join(BASEDIR,'src')
 CMDS_NOCYTHONIZE = ['clean','clean_cython','sdist']
 COMPILER_DIRECTIVES = {}
 DEFINE_MACROS = None
 FLAG_COVERAGE = '--cython-coverage'  # custom flag enabling Cython line tracing
 NAME = 'cftime'
-CFTIME_DIR = os.path.join(BASEDIR, NAME)
+CFTIME_DIR = os.path.join(SRCDIR, NAME)
 CYTHON_FNAME = os.path.join(CFTIME_DIR, '_{}.pyx'.format(NAME))
 
 
@@ -95,7 +96,7 @@ else:
     if cythonize:
         ext_modules = cythonize(extension,
                                 compiler_directives=COMPILER_DIRECTIVES,
-                                language_level=2)
+                                language_level=3)
 
 setup(
     name=NAME,
@@ -106,6 +107,7 @@ setup(
     long_description_content_type='text/markdown',
     cmdclass={'clean_cython': CleanCython},
     packages=[NAME],
+    package_dir={'':'src'},
     version=extract_version(),
     ext_modules=ext_modules,
     install_requires=load('requirements.txt'),


=====================================
cftime/__init__.py → src/cftime/__init__.py
=====================================
@@ -1,9 +1,8 @@
 from ._cftime import utime, JulianDayFromDate, DateFromJulianDay, UNIT_CONVERSION_FACTORS
-from ._cftime import _parse_date, date2index, time2index
-from ._cftime import datetime, real_datetime
+from ._cftime import _parse_date, date2index, time2index, datetime, real_datetime
 from ._cftime import DatetimeNoLeap, DatetimeAllLeap, Datetime360Day, DatetimeJulian, \
-                         DatetimeGregorian, DatetimeProlepticGregorian
+                     DatetimeGregorian, DatetimeProlepticGregorian
 from ._cftime import microsec_units, millisec_units, \
-                         sec_units, hr_units, day_units, min_units
+                     sec_units, hr_units, day_units, min_units
 from ._cftime import num2date, date2num, date2index, num2pydate
 from ._cftime import __version__


=====================================
cftime/_cftime.pyx → src/cftime/_cftime.pyx
=====================================
@@ -53,7 +53,7 @@ cdef int32_t* days_per_month_array = [
 _rop_lookup = {Py_LT: '__gt__', Py_LE: '__ge__', Py_EQ: '__eq__',
                Py_GT: '__lt__', Py_GE: '__le__', Py_NE: '__ne__'}
 
-__version__ = '1.3.0'
+__version__ = '1.3.1'
 
 # Adapted from http://delete.me.uk/2005/03/iso8601.html
 # Note: This regex ensures that all ISO8601 timezone formats are accepted - but, due to legacy support for other timestrings, not all incorrect formats can be rejected.
@@ -216,10 +216,7 @@ def date2num(dates,units,calendar=None):
         if all_python_datetimes:
             calendar = 'proleptic_gregorian'
         else:
-            if isscalar:
-                d0 = dates.item()
-            else:
-                d0 = dates.flat[0]
+            d0 = dates.item(0)
             if isinstance(d0,datetime_python):
                 calendar = 'proleptic_gregorian' 
             else:


=====================================
test/__init__.py
=====================================


=====================================
test/test_cftime.py
=====================================
@@ -804,6 +804,17 @@ class cftimeTestCase(unittest.TestCase):
         jd = cftime.date2num(d,units,calendar='standard')
         assert(jd == 2459185.0)
 
+        # issue #211
+        # (masked array handling in date2num - AttributeError:
+        # 'cftime._cftime.DatetimeGregorian' object has no attribute 'view')
+        m = np.ma.asarray(
+            [cftime.DatetimeGregorian(2014, 8, 1, 12, 0, 0, 0)]
+            )
+        assert(
+             cftime.date2num(m, units="seconds since 2000-1-1")==[4.602096e+08]
+              )
+
+
 
 class TestDate2index(unittest.TestCase):
 
@@ -1302,19 +1313,19 @@ class DateTime(unittest.TestCase):
         for op, expected in [(operator.gt, '__lt__'), (operator.ge, '__le__'),
                              (operator.eq, '__eq__'), (operator.ne, '__ne__'),
                              (operator.lt, '__gt__'), (operator.le, '__ge__')]:
-            with self.assertRaisesRegexp(NotImplementedError, expected):
+            with self.assertRaisesRegex(NotImplementedError, expected):
                 op(self.date1_365_day, Rich())
 
-            with self.assertRaisesRegexp(NotImplementedError, '__richcmp__'):
+            with self.assertRaisesRegex(NotImplementedError, '__richcmp__'):
                 op(self.date1_365_day, CythonRich())
 
         # Test RHS operand comparison operator processing.
         for op in [operator.gt, operator.ge, operator.eq, operator.ne,
                    operator.lt, operator.le]:
-            with self.assertRaisesRegexp(TypeError, 'cannot compare'):
+            with self.assertRaisesRegex(TypeError, 'cannot compare'):
                 op(Pass(), self.date1_365_day)
 
-            with self.assertRaisesRegexp(TypeError, 'cannot compare'):
+            with self.assertRaisesRegex(TypeError, 'cannot compare'):
                 op(Pass___cmp__(), self.date1_365_day)
 
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/cftime/-/compare/a49222993f5399c4ec2af6c74cbdc767b7d82bfd...3ce983daa3fc91e85092346cbb9e8f4d0a1b0d68

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/cftime/-/compare/a49222993f5399c4ec2af6c74cbdc767b7d82bfd...3ce983daa3fc91e85092346cbb9e8f4d0a1b0d68
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/20210117/3c855100/attachment-0001.html>


More information about the Pkg-grass-devel mailing list