[Git][debian-gis-team/trollsift][master] 7 commits: New upstream version 0.3.3

Antonio Valentino gitlab at salsa.debian.org
Fri Oct 11 07:01:31 BST 2019



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


Commits:
eadc560e by Antonio Valentino at 2019-10-11T05:54:37Z
New upstream version 0.3.3
- - - - -
6d1e04e4 by Antonio Valentino at 2019-10-11T05:54:38Z
Update upstream source from tag 'upstream/0.3.3'

Update to upstream version '0.3.3'
with Debian dir 3b13ad74b15ac01b143908e5da92c899e83d07de
- - - - -
d121442d by Antonio Valentino at 2019-10-11T05:55:27Z
New upstream release

- - - - -
dbd6865c by Antonio Valentino at 2019-10-11T05:56:12Z
Bump debhelper from old 11 to 12.

Fixes lintian: package-uses-old-debhelper-compat-version
See https://lintian.debian.org/tags/package-uses-old-debhelper-compat-version.html for more details.

- - - - -
8e7a87e9 by Antonio Valentino at 2019-10-11T05:56:13Z
Remove obsolete fields Name from debian/upstream/metadata.
- - - - -
7efb602b by Antonio Valentino at 2019-10-11T05:59:16Z
Explicitly set Rules-Requires-Root: no

- - - - -
29b9496f by Antonio Valentino at 2019-10-11T05:59:51Z
Set distribution to unstable

- - - - -


12 changed files:

- .gitignore
- + .stickler.yml
- .travis.yml
- CHANGELOG.md
- appveyor.yml
- debian/changelog
- − debian/compat
- debian/control
- debian/upstream/metadata
- trollsift/parser.py
- trollsift/tests/unittests/test_parser.py
- trollsift/version.py


Changes:

=====================================
.gitignore
=====================================
@@ -1,64 +1,34 @@
-/testenv/*
-/build/*
-/dist/*
-/tests/unittests/__init__.pyc
-/tests/unittests/test_parser.pyc
-/tests/unittests/test_parser.py~
-/tests/integrationtests/__init__.pyc
-/tests/integrationtests/test_parser.pyc
-/tests/integrationtests/test_parser.py~
-/tests/__init__.pyc
-/tests/unittest/__init__.pyc
-/trollsift.egg-info/PKG-INFO
-/trollsift.egg-info/SOURCES.txt
-/trollsift.egg-info/dependency_links.txt
-/trollsift.egg-info/not-zip-safe
-/trollsift.egg-info/top_level.txt
-/trollsift/version.pyc
-/doc/source/api.rst~
-/doc/source/index.rst~
-/doc/source/installation.rst~
-/doc/source/usage.rst~
-/doc/build/doctrees/api.doctree
-/doc/build/doctrees/environment.pickle
-/doc/build/doctrees/index.doctree
-/doc/build/doctrees/installation.doctree
-/doc/build/doctrees/usage.doctree
-/doc/build/html/.buildinfo
-/doc/build/html/_sources/api.txt
-/doc/build/html/_sources/index.txt
-/doc/build/html/_sources/installation.txt
-/doc/build/html/_sources/usage.txt
-/doc/build/html/_static/ajax-loader.gif
-/doc/build/html/_static/basic.css
-/doc/build/html/_static/comment-bright.png
-/doc/build/html/_static/comment-close.png
-/doc/build/html/_static/comment.png
-/doc/build/html/_static/default.css
-/doc/build/html/_static/doctools.js
-/doc/build/html/_static/down-pressed.png
-/doc/build/html/_static/down.png
-/doc/build/html/_static/file.png
-/doc/build/html/_static/jquery.js
-/doc/build/html/_static/minus.png
-/doc/build/html/_static/plus.png
-/doc/build/html/_static/pygments.css
-/doc/build/html/_static/searchtools.js
-/doc/build/html/_static/sidebar.js
-/doc/build/html/_static/underscore.js
-/doc/build/html/_static/up-pressed.png
-/doc/build/html/_static/up.png
-/doc/build/html/_static/websupport.js
-/doc/build/html/api.html
-/doc/build/html/genindex.html
-/doc/build/html/index.html
-/doc/build/html/installation.html
-/doc/build/html/objects.inv
-/doc/build/html/py-modindex.html
-/doc/build/html/search.html
-/doc/build/html/searchindex.js
-/doc/build/html/usage.html
-/.coverage
-/tests/unittest/test_parser.pyc
-/trollsift/__init__.pyc
-/trollsift/parser.pyc
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+pip-wheel-metadata/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+doc/build/*
+.coverage


=====================================
.stickler.yml
=====================================
@@ -0,0 +1,5 @@
+linters:
+  flake8:
+    python: 3
+    config: setup.cfg
+


=====================================
.travis.yml
=====================================
@@ -23,7 +23,8 @@ matrix:
     os: osx
     language: generic
 install:
-- git clone --depth 1 git://github.com/astropy/ci-helpers.git
+#- git clone --depth 1 git://github.com/astropy/ci-helpers.git
+- git clone --depth 1 -b all-the-fixes git://github.com/djhoese/ci-helpers.git
 - source ci-helpers/travis/setup_conda.sh
 script:
 - coverage run --source=trollsift setup.py test


=====================================
CHANGELOG.md
=====================================
@@ -1,3 +1,18 @@
+## Version 0.3.3 (2019/10/09)
+
+### Pull Requests Merged
+
+#### Bugs fixed
+
+* [PR 15](https://github.com/pytroll/trollsift/pull/15) - Fix parse accepting strings with trailing characters
+
+#### Features added
+
+* [PR 14](https://github.com/pytroll/trollsift/pull/14) - Adding .stickler.yml configuration file
+
+In this release 2 pull requests were closed.
+
+
 ## Version 0.3.2 (2019/01/14)
 
 


=====================================
appveyor.yml
=====================================
@@ -19,10 +19,10 @@ environment:
       NUMPY_VERSION: "stable"
 
 install:
-    - "git clone --depth 1 git://github.com/astropy/ci-helpers.git"
+#    - "git clone --depth 1 git://github.com/astropy/ci-helpers.git"
+    - "git clone --depth 1 -b all-the-fixes git://github.com/djhoese/ci-helpers.git"
     - "powershell ci-helpers/appveyor/install-miniconda.ps1"
-    - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
-    - "activate test"
+    - "conda activate test"
 
 build: false  # Not a C# project, build stuff at the test step instead.
 


=====================================
debian/changelog
=====================================
@@ -1,10 +1,16 @@
-trollsift (0.3.2-2) UNRELEASED; urgency=medium
+trollsift (0.3.3-1) unstable; urgency=medium
 
-  * Team upload.
+  [ Bas Couwenberg ]
   * Update gbp.conf to use --source-only-changes by default.
   * Bump Standards-Version to 4.4.1, no changes.
 
- -- Bas Couwenberg <sebastic at debian.org>  Sun, 07 Jul 2019 10:22:36 +0200
+  [ Antonio Valentino ]
+  * New upstream release.
+  * Bump debhelper from old 11 to 12.
+  * Remove obsolete fields Name from debian/upstream/metadata.
+  * Explicitly set Rules-Requires-Root: no.
+
+ -- Antonio Valentino <antonio.valentino at tiscali.it>  Fri, 11 Oct 2019 05:59:20 +0000
 
 trollsift (0.3.2-1) unstable; urgency=medium
 


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


=====================================
debian/control
=====================================
@@ -4,7 +4,8 @@ Uploaders: Antonio Valentino <antonio.valentino at tiscali.it>
 Section: python
 Priority: optional
 Testsuite: autopkgtest-pkg-python
-Build-Depends: debhelper (>= 11),
+Rules-Requires-Root: no
+Build-Depends: debhelper-compat (= 12),
                dh-python,
                python3-all,
                python3-setuptools,


=====================================
debian/upstream/metadata
=====================================
@@ -1,6 +1,4 @@
----
 Bug-Database: https://github.com/pytroll/trollsift/issues
 Bug-Submit: https://github.com/pytroll/trollsift/issues/new
-Name: Trollsift
 Repository: https://github.com/pytroll/trollsift.git
 Repository-Browse: https://github.com/pytroll/trollsift


=====================================
trollsift/parser.py
=====================================
@@ -41,11 +41,11 @@ class Parser(object):
     def __str__(self):
         return self.fmt
 
-    def parse(self, stri):
+    def parse(self, stri, full_match=True):
         '''Parse keys and corresponding values from *stri* using format
         described in *fmt* string.
         '''
-        return parse(self.fmt, stri)
+        return parse(self.fmt, stri, full_match=full_match)
 
     def compose(self, keyvals):
         '''Return string composed according to *fmt* string and filled
@@ -295,8 +295,19 @@ class RegexFormatter(string.Formatter):
         field_name, value = value
         return self.regex_field(field_name, value, format_spec)
 
-    def extract_values(self, fmt, stri):
+    def extract_values(self, fmt, stri, full_match=True):
+        """Extract information from string matching format.
+
+        Args:
+            fmt (str): Python format string to match against
+            stri (str): String to extract information from
+            full_match (bool): Force the match of the whole string. Default
+                to ``True``.
+
+        """
         regex = self.format(fmt)
+        if full_match:
+            regex = '^' + regex + '$'
         match = re.match(regex, stri)
         if match is None:
             raise ValueError("String does not match pattern.")
@@ -307,9 +318,10 @@ regex_formatter = RegexFormatter()
 
 
 def _get_number_from_fmt(fmt):
-    """
-    Helper function for extract_values,
-    figures out string length from format string.
+    """Helper function for extract_values.
+
+    Figures out string length from format string.
+
     """
     if '%' in fmt:
         # its datetime
@@ -362,10 +374,18 @@ def get_convert_dict(fmt):
     return convdef
 
 
-def parse(fmt, stri):
-    """Parse keys and corresponding values from *stri* using format described in *fmt* string."""
+def parse(fmt, stri, full_match=True):
+    """Parse keys and corresponding values from *stri* using format described in *fmt* string.
+
+    Args:
+        fmt (str): Python format string to match against
+        stri (str): String to extract information from
+        full_match (bool): Force the match of the whole string. Default
+            True.
+
+    """
     convdef = get_convert_dict(fmt)
-    keyvals = regex_formatter.extract_values(fmt, stri)
+    keyvals = regex_formatter.extract_values(fmt, stri, full_match=full_match)
     for key in convdef.keys():
         keyvals[key] = _convert(convdef[key], keyvals[key])
 


=====================================
trollsift/tests/unittests/test_parser.py
=====================================
@@ -97,6 +97,15 @@ class TestParser(unittest.TestCase):
         fmt = '/somedir/{directory}/hrpt_{platform:4s}{platnum:2s}_{time:%Y%m%d_%H%M}_{orbit:4d}.l1b'
         self.assertRaises(ValueError, regex_formatter.extract_values, fmt, self.string)
 
+    def test_extract_values_full_match(self):
+        """Test that a string must completely match."""
+        fmt = '{orbit:05d}'
+        val = regex_formatter.extract_values(fmt, '12345')
+        self.assertEqual(val, {'orbit': '12345'})
+        self.assertRaises(ValueError, regex_formatter.extract_values, fmt, '12345abc')
+        val = regex_formatter.extract_values(fmt, '12345abc', full_match=False)
+        self.assertEqual(val, {'orbit': '12345'})
+
     def test_convert_digits(self):
         self.assertEqual(_convert('d', '69022'), 69022)
         self.assertRaises(ValueError, _convert, 'd', '69dsf')


=====================================
trollsift/version.py
=====================================
@@ -23,9 +23,9 @@ def get_keywords():
     # setup.py/versioneer.py will grep for the variable names, so they must
     # each be defined on a line of their own. _version.py will just call
     # get_keywords().
-    git_refnames = " (HEAD -> master, tag: v0.3.2)"
-    git_full = "d0e5b6006e248974d806d0dd8e20cc6641d778fb"
-    git_date = "2019-01-14 17:05:37 -0600"
+    git_refnames = " (HEAD -> master, tag: v0.3.3)"
+    git_full = "e0a82d62b317df5f62eb2532480ef110f2fe3b16"
+    git_date = "2019-10-09 08:55:57 -0500"
     keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
     return keywords
 



View it on GitLab: https://salsa.debian.org/debian-gis-team/trollsift/compare/f2a69281f25fc12f7fcaa240ab8ec295bf5bccc5...29b9496f524991f6991ea06bc7d6a5f583abce5f

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/trollsift/compare/f2a69281f25fc12f7fcaa240ab8ec295bf5bccc5...29b9496f524991f6991ea06bc7d6a5f583abce5f
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/20191011/ac8e3f66/attachment-0001.html>


More information about the Pkg-grass-devel mailing list