Skip to content
Commits on Source (4)
Changes
=======
1.4.3 (2019-02-25)
------------------
- Add LICENSE to distributions (#11).
- Remove click from requirements (#12).
- Allow a wider range of valid variable and parameter names (#13).
1.4.2 (2018-06-07)
------------------
- Add missing docstrings and improve existing ones.
......
include CHANGES.txt AUTHORS.txt LICENSE VERSION.txt README.rst setup.py CODE_OF_CONDUCT.txt test_snuggs.py
exclude MANIFEST.in
python-snuggs (1.4.2-3) UNRELEASED; urgency=medium
python-snuggs (1.4.3-1) unstable; urgency=medium
* Team upload.
* New upstream release.
* Bump Standards-Version to 4.3.0, no changes.
-- Bas Couwenberg <sebastic@debian.org> Tue, 28 Aug 2018 15:28:33 +0200
-- Bas Couwenberg <sebastic@debian.org> Tue, 26 Feb 2019 06:36:52 +0100
python-snuggs (1.4.2-2) unstable; urgency=medium
......
......@@ -29,6 +29,6 @@ setup(
packages=find_packages(exclude=["ez_setup", "examples", "tests"]),
include_package_data=True,
zip_safe=False,
install_requires=["click", "numpy", "pyparsing"],
install_requires=["numpy", "pyparsing"],
extras_require={"test": ["pytest"]},
)
......@@ -10,13 +10,13 @@ import sys
from pyparsing import (
alphanums, ZeroOrMore, nums, oneOf, Word, Literal, Combine, QuotedString,
ParseException, Forward, Group, CaselessLiteral, Optional, alphas,
OneOrMore, ParseResults)
OneOrMore, ParseResults, pyparsing_common)
import numpy
__all__ = ['eval']
__version__ = "1.4.2"
__version__ = "1.4.3"
# Python 2-3 compatibility
string_types = (str,) if sys.version_info[0] >= 3 else (basestring,) # flake8: noqa
......@@ -105,7 +105,7 @@ decimal = Literal('.')
e = CaselessLiteral('E')
sign = Literal('+') | Literal('-')
number = Word(nums)
name = Word(alphas)
name = pyparsing_common.identifier
nil = Literal('nil').setParseAction(lambda s, l, t: [None])
def resolve_var(s, l, t):
......
......@@ -48,6 +48,10 @@ def test_arr_lookup(ones):
r = snuggs.eval('(read 1)', kwargs)
assert list(r.flatten()) == [1, 1, 1, 1]
def test_arr_var_long(ones):
r = snuggs.eval('(+ FOO_BAR_42 0)', FOO_BAR_42=ones)
assert list(r.flatten()) == [1, 1, 1, 1]
@pytest.mark.xfail(reason="Keyword argument order can't be relied on")
def test_arr_lookup_kwarg_order(ones):
......