[Git][debian-gis-team/python-snuggs][master] 6 commits: New upstream version 1.4.2
Bas Couwenberg
gitlab at salsa.debian.org
Fri Jun 8 06:46:09 BST 2018
Bas Couwenberg pushed to branch master 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
- - - - -
5104864a by Bas Couwenberg at 2018-06-08T07:24:14+02:00
Merge tag 'upstream/1.4.2'
Upstream version 1.4.2
- - - - -
81285b35 by Bas Couwenberg at 2018-06-08T07:24:35+02:00
New upstream release.
- - - - -
2cf928c6 by Bas Couwenberg at 2018-06-08T07:27:05+02:00
Add autopkgtests to test installation and module import.
- - - - -
ae194bd3 by Bas Couwenberg at 2018-06-08T07:38:33+02:00
Fix lxml dependency for python3 package.
- - - - -
36062fd1 by Bas Couwenberg at 2018-06-08T07:38:33+02:00
Set distribution to unstable.
- - - - -
8 changed files:
- + .gitignore
- .travis.yml
- CHANGES.txt
- debian/changelog
- debian/control
- + debian/tests/control
- 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()
=====================================
debian/changelog
=====================================
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,16 @@
-python-snuggs (1.4.1-2) UNRELEASED; urgency=medium
+python-snuggs (1.4.2-1) unstable; urgency=medium
+ * Team upload.
+ * New upstream release.
* Update copyright-format URL to use HTTPS.
* Update Vcs-* URLs for Salsa.
* Bump Standards-Version to 4.1.4, no changes.
* Drop ancient X-Python-Version field.
* Strip trailing whitespace from rules file.
+ * Add autopkgtests to test installation and module import.
+ * Fix lxml dependency for python3 package.
- -- Johan Van de Wauw <johan.vandewauw at gmail.com> Sun, 21 Jan 2018 10:42:00 +0100
+ -- Bas Couwenberg <sebastic at debian.org> Fri, 08 Jun 2018 07:27:12 +0200
python-snuggs (1.4.1-1) unstable; urgency=medium
=====================================
debian/control
=====================================
--- a/debian/control
+++ b/debian/control
@@ -36,7 +36,7 @@ Description: S-expressions for numpy - Python 2 version
Package: python3-snuggs
Architecture: all
-Depends: python-lxml,
+Depends: python3-lxml,
${python3:Depends},
${misc:Depends}
Description: S-expressions for numpy - Python 3 version
=====================================
debian/tests/control
=====================================
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,11 @@
+# Test installability
+Depends: @
+Test-Command: /bin/true
+
+# Test module import (Python 2)
+Depends: python-all, python-snuggs
+Test-Command: set -e ; for py in $(pyversions -r 2>/dev/null) ; do cd "$ADTTMP" ; echo "Testing with $py:" ; $py -c "import snuggs; print(snuggs)" ; done
+
+# Test module import (Python 3)
+Depends: python3-all, python3-snuggs
+Test-Command: set -e ; for py in $(py3versions -r 2>/dev/null) ; do cd "$ADTTMP" ; echo "Testing with $py:" ; $py -c "import snuggs; print(snuggs)" ; done
=====================================
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/compare/973bee7ac73245855b8c4c39ff2ff1513e069134...36062fd1902e044bab196d1474ce3cda57c2de5c
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-snuggs/compare/973bee7ac73245855b8c4c39ff2ff1513e069134...36062fd1902e044bab196d1474ce3cda57c2de5c
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/c7ad80da/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list