[Git][debian-gis-team/python-snuggs][master] 5 commits: New upstream version 1.4.4
Bas Couwenberg
gitlab at salsa.debian.org
Wed May 15 05:39:56 BST 2019
Bas Couwenberg pushed to branch master at Debian GIS Project / python-snuggs
Commits:
bfa8e090 by Bas Couwenberg at 2019-05-15T04:22:18Z
New upstream version 1.4.4
- - - - -
d9535db2 by Bas Couwenberg at 2019-05-15T04:22:37Z
New upstream version 1.4.5
- - - - -
de1ca4d0 by Bas Couwenberg at 2019-05-15T04:22:38Z
Merge tag 'upstream/1.4.5'
Upstream version 1.4.5
- - - - -
4c8e366d by Bas Couwenberg at 2019-05-15T04:22:54Z
New upstream release.
- - - - -
ca670c5b by Bas Couwenberg at 2019-05-15T04:24:30Z
Add python{,3}-hypothesis to build dependencies.
- - - - -
7 changed files:
- .travis.yml
- CHANGES.txt
- debian/changelog
- debian/control
- setup.py
- snuggs/__init__.py
- test_snuggs.py
Changes:
=====================================
.travis.yml
=====================================
@@ -1,10 +1,11 @@
+dist: xenial
language: python
python:
- - "2.7"
- "3.6"
+ - "3.7"
install:
- - "pip install pytest-cov coveralls"
- - "pip install -e ."
+ - "pip install pytest-cov coveralls pyparsing==2.3.1"
+ - "pip install -e .[test]"
script:
- python -m pytest --cov snuggs --cov-report term-missing
after_success:
=====================================
CHANGES.txt
=====================================
@@ -1,6 +1,17 @@
Changes
=======
+1.4.5 (2019-05-14)
+------------------
+- Replace custom integer and real parsers with pyparsing_common's number (#19).
+
+1.4.4 (2019-05-14)
+------------------
+- Fix for a reported bug in parsing negative real numbers (#16) and for an
+ unreported bug in parsing numbers in exponential notation (thank you,
+ hypothesis!).
+- Add a "test" dependency on hypothesis.
+
1.4.3 (2019-02-25)
------------------
- Add LICENSE to distributions (#11).
=====================================
debian/changelog
=====================================
@@ -1,3 +1,11 @@
+python-snuggs (1.4.5-1) UNRELEASED; urgency=medium
+
+ * Team upload.
+ * New upstream release.
+ * Add python{,3}-hypothesis to build dependencies.
+
+ -- Bas Couwenberg <sebastic at debian.org> Wed, 15 May 2019 06:22:43 +0200
+
python-snuggs (1.4.3-1) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -7,6 +7,8 @@ Build-Depends: debhelper (>= 9),
dh-python,
python-all,
python3-all,
+ python-hypothesis,
+ python3-hypothesis,
python-numpy,
python3-numpy,
python-setuptools,
=====================================
setup.py
=====================================
@@ -29,6 +29,6 @@ setup(
packages=find_packages(exclude=["ez_setup", "examples", "tests"]),
include_package_data=True,
zip_safe=False,
- install_requires=["numpy", "pyparsing"],
- extras_require={"test": ["pytest"]},
+ install_requires=["numpy", "pyparsing>=2.1.6"],
+ extras_require={"test": ["pytest", "hypothesis"]},
)
=====================================
snuggs/__init__.py
=====================================
@@ -16,7 +16,7 @@ import numpy
__all__ = ['eval']
-__version__ = "1.4.3"
+__version__ = "1.4.5"
# Python 2-3 compatibility
string_types = (str,) if sys.version_info[0] >= 3 else (basestring,) # flake8: noqa
@@ -121,15 +121,6 @@ def resolve_var(s, l, t):
var = name.setParseAction(resolve_var)
-integer = Combine(
- Optional(sign) +
- number).setParseAction(lambda s, l, t: int(t[0]))
-
-real = Combine(
- integer +
- decimal + Optional(number) +
- Optional(e + integer)).setParseAction(lambda s, l, t: float(t[0]))
-
string = QuotedString("'") | QuotedString('"')
lparen = Literal('(').suppress()
@@ -159,7 +150,7 @@ func_expr = Forward()
higher_func_expr = Forward()
expr = higher_func_expr | func_expr
-operand = higher_func_expr | func_expr | nil | var | real | integer | string
+operand = higher_func_expr | func_expr | nil | var | pyparsing_common.number | string
func_expr << Group(
lparen +
=====================================
test_snuggs.py
=====================================
@@ -1,19 +1,36 @@
from collections import OrderedDict
+from hypothesis import given
+from hypothesis.strategies import floats, integers
import numpy
import pytest
import snuggs
-# Fixtures follow the tests. See the end of the file.
+
+ at pytest.fixture
+def ones():
+ return numpy.ones((2, 2))
+
+
+ at pytest.fixture
+def truetrue():
+ return numpy.array([True, True])
+
+
+ at pytest.fixture
+def truefalse():
+ return numpy.array([True, False])
-def test_integer():
- assert list(snuggs.integer.parseString('1')) == [1]
+ at given(integers())
+def test_integer_operand(num):
+ assert list(snuggs.operand.parseString(str(num))) == [num]
-def test_real():
- assert list(snuggs.real.parseString('1.1')) == [1.1]
+ at given(floats(allow_infinity=False, allow_nan=False))
+def test_real_operand(num):
+ assert list(snuggs.operand.parseString(str(num))) == [num]
def test_int_expr():
@@ -225,17 +242,6 @@ def test_type_error():
snuggs.eval("(+ 1 'bogus')")
-# Fixtures.
- at pytest.fixture
-def ones():
- return numpy.ones((2, 2))
-
-
- at pytest.fixture
-def truetrue():
- return numpy.array([True, True])
-
-
- at pytest.fixture
-def truefalse():
- return numpy.array([True, False])
+def test_negative_decimal():
+ """Negative decimals parse correctly"""
+ assert snuggs.eval("(< -0.9 0)")
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-snuggs/compare/b2bbdf4967d014c0381d97e70302d57b21eb2f84...ca670c5ba192b6d30926f7e4d4013784816610d2
--
View it on GitLab: https://salsa.debian.org/debian-gis-team/python-snuggs/compare/b2bbdf4967d014c0381d97e70302d57b21eb2f84...ca670c5ba192b6d30926f7e4d4013784816610d2
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/20190515/a3a52045/attachment-0001.html>
More information about the Pkg-grass-devel
mailing list