[Git][debian-gis-team/python-snuggs][upstream] New upstream version 1.4.2

Bas Couwenberg gitlab at salsa.debian.org
Fri Jun 8 06:46:12 BST 2018


Bas Couwenberg pushed to branch upstream at Debian GIS Project / python-snuggs


Commits:
0bd37223 by Bas Couwenberg at 2018-06-08T07:24:13+02:00
New upstream version 1.4.2
- - - - -


5 changed files:

- + .gitignore
- .travis.yml
- CHANGES.txt
- setup.py
- snuggs/__init__.py


Changes:

=====================================
.gitignore
=====================================
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+.cache
+.coverage
+__pycache__
+*.pyc
+*.egg-info


=====================================
.travis.yml
=====================================
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,12 +1,18 @@
 language: python
 python:
   - "2.7"
-  - "3.4"
+  - "3.6"
 install:
-  - "pip install pytest"
-  - "pip install coveralls"
+  - "pip install pytest-cov coveralls"
   - "pip install -e ."
 script: 
-  - coverage run --source=snuggs -m py.test
+  - python -m pytest --cov snuggs --cov-report term-missing
 after_success:
   - coveralls
+deploy:
+  on:
+    tags: true
+    condition: "$TRAVIS_PYTHON_VERSION = 3.6"
+  provider: pypi
+  user: mapboxci
+  distributions: "sdist bdist_wheel"


=====================================
CHANGES.txt
=====================================
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,6 +1,10 @@
 Changes
 =======
 
+1.4.2 (2018-06-07)
+------------------
+- Add missing docstrings and improve existing ones.
+
 1.4.1 (2017-01-02)
 ------------------
 - Bug fix: accept OrderedDict as evaluation context to enable reliable read()


=====================================
setup.py
=====================================
--- a/setup.py
+++ b/setup.py
@@ -1,30 +1,34 @@
+"""Build the snuggs package."""
+
 from codecs import open as codecs_open
 from setuptools import setup, find_packages
 
 
 # Get the long description from the relevant file
-with codecs_open('README.rst', encoding='utf-8') as f:
+with codecs_open("README.rst", encoding="utf-8") as f:
     long_description = f.read()
 
-with open('snuggs/__init__.py') as f:
+with open("snuggs/__init__.py") as f:
     for line in f:
-        if line.startswith('__version__'):
-            version = line.split('=')[1]
+        if line.startswith("__version__"):
+            version = line.split("=")[1]
             version = version.strip().strip('"')
             break
 
-setup(name='snuggs',
-      version=version,
-      description=u"Snuggs are s-expressions for Numpy",
-      long_description=long_description,
-      classifiers=[],
-      keywords='',
-      author=u"Sean Gillies",
-      author_email='sean at mapbox.com',
-      url='https://github.com/mapbox/snuggs',
-      license='MIT',
-      packages=find_packages(exclude=['ez_setup', 'examples', 'tests']),
-      include_package_data=True,
-      zip_safe=False,
-      install_requires=['click', 'numpy', 'pyparsing'],
-      extras_require={'test': ['pytest']})
+setup(
+    name="snuggs",
+    version=version,
+    description=u"Snuggs are s-expressions for Numpy",
+    long_description=long_description,
+    classifiers=[],
+    keywords="",
+    author=u"Sean Gillies",
+    author_email="sean at mapbox.com",
+    url="https://github.com/mapbox/snuggs",
+    license="MIT",
+    packages=find_packages(exclude=["ez_setup", "examples", "tests"]),
+    include_package_data=True,
+    zip_safe=False,
+    install_requires=["click", "numpy", "pyparsing"],
+    extras_require={"test": ["pytest"]},
+)


=====================================
snuggs/__init__.py
=====================================
--- a/snuggs/__init__.py
+++ b/snuggs/__init__.py
@@ -1,6 +1,5 @@
-"""
-Snuggs are s-expressions for Numpy.
-"""
+"""Snuggs are s-expressions for Numpy."""
+
 from collections import OrderedDict
 import functools
 import itertools
@@ -17,10 +16,10 @@ import numpy
 
 
 __all__ = ['eval']
-__version__ = "1.4.1"
+__version__ = "1.4.2"
 
 # Python 2-3 compatibility
-string_types = (str,) if sys.version_info[0] >= 3 else (basestring,)
+string_types = (str,) if sys.version_info[0] >= 3 else (basestring,)  # flake8: noqa
 
 
 class Context(object):
@@ -44,6 +43,7 @@ class Context(object):
     def clear(self):
         self._data = OrderedDict()
 
+
 _ctx = Context()
 
 
@@ -64,10 +64,12 @@ class ctx(object):
 
 
 class ExpressionError(SyntaxError):
-    """Snuggs specific syntax errors"""
+    """A Snuggs-specific syntax error."""
+
     filename = "<string>"
     lineno = 1
 
+
 op_map = {
     '*': lambda *args: functools.reduce(lambda x, y: operator.mul(x, y), args),
     '+': lambda *args: functools.reduce(lambda x, y: operator.add(x, y), args),
@@ -88,6 +90,7 @@ def asarray(*args):
     else:
         return numpy.asanyarray(list(args))
 
+
 func_map = {
     'asarray': asarray,
     'read': _ctx.lookup,
@@ -115,6 +118,7 @@ def resolve_var(s, l, t):
         err.offset = l + 1
         raise err
 
+
 var = name.setParseAction(resolve_var)
 
 integer = Combine(
@@ -145,6 +149,7 @@ def resolve_func(s, l, t):
         err.offset = l + 1
         raise err
 
+
 func = Word(alphanums + '_').setParseAction(resolve_func)
 
 higher_func = oneOf('map partial').setParseAction(
@@ -201,6 +206,22 @@ def handleLine(line):
 
 
 def eval(source, kwd_dict=None, **kwds):
+    """Evaluate a snuggs expression.
+
+    Parameters
+    ----------
+    source : str
+        Expression source.
+    kwd_dict : dict
+        A dict of items that form the evaluation context. Deprecated.
+    kwds : dict
+        A dict of items that form the valuation context.
+
+    Returns
+    -------
+    object
+
+    """
     kwd_dict = kwd_dict or kwds
     with ctx(kwd_dict):
         return handleLine(source)



View it on GitLab: https://salsa.debian.org/debian-gis-team/python-snuggs/commit/0bd372238588e41e44aef6b62866924def98cc7a

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-snuggs/commit/0bd372238588e41e44aef6b62866924def98cc7a
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/20180608/a272f910/attachment-0001.html>


More information about the Pkg-grass-devel mailing list