summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Howitz <mh@gocept.com>2022-08-24 07:10:35 +0200
committerGitHub <noreply@github.com>2022-08-24 07:10:35 +0200
commit49037e88990a9a1702619346dfe4bdd189f92df0 (patch)
tree8dfea29b63d96e83b9e6a2a9443686712f62c425
parent94bc3003f888118c8b03dc9827ff3a26a2abdf99 (diff)
parentb541ca989f041e7b1b05aec9d6d4c29917b9e7a0 (diff)
downloadzope-tales-issue19.tar.gz
Merge branch 'master' into issue19issue19
-rw-r--r--.editorconfig2
-rw-r--r--.github/workflows/tests.yml15
-rw-r--r--.gitignore2
-rw-r--r--.meta.toml5
-rw-r--r--CHANGES.rst11
-rw-r--r--CONTRIBUTING.md23
-rw-r--r--MANIFEST.in1
-rw-r--r--README.rst4
-rw-r--r--setup.py3
-rw-r--r--src/zope/tales/expressions.py2
-rw-r--r--src/zope/tales/tests/test_expressions.py7
-rw-r--r--tox.ini10
12 files changed, 61 insertions, 24 deletions
diff --git a/.editorconfig b/.editorconfig
index f3e46f5..c5508b9 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -28,7 +28,7 @@ max_line_length = off
# 4 space indentation
indent_size = 4
-[*.{yml,zpt,pt,dtml}]
+[*.{yml,zpt,pt,dtml,zcml}]
# 2 space indentation
indent_size = 2
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 38cb0de..927d9f3 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -16,21 +16,24 @@ jobs:
# We want to see all failures:
fail-fast: false
matrix:
+ os:
+ - ubuntu
config:
# [Python version, tox env]
- - ["3.8", "lint"]
+ - ["3.9", "lint"]
- ["2.7", "py27"]
- ["3.5", "py35"]
- ["3.6", "py36"]
- ["3.7", "py37"]
- ["3.8", "py38"]
- ["3.9", "py39"]
- - ["pypy2", "pypy"]
- - ["pypy3", "pypy3"]
- - ["3.8", "docs"]
- - ["3.8", "coverage"]
+ - ["3.10", "py310"]
+ - ["pypy-2.7", "pypy"]
+ - ["pypy-3.7", "pypy3"]
+ - ["3.9", "docs"]
+ - ["3.9", "coverage"]
- runs-on: ubuntu-latest
+ runs-on: ${{ matrix.os }}-latest
name: ${{ matrix.config[1] }}
steps:
- uses: actions/checkout@v2
diff --git a/.gitignore b/.gitignore
index 9a9e9b9..c724a76 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,11 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
+*.dll
*.egg-info/
*.profraw
*.pyc
*.pyo
+*.so
.coverage
.coverage.*
.eggs/
diff --git a/.meta.toml b/.meta.toml
index 2cd2e91..fad8c6e 100644
--- a/.meta.toml
+++ b/.meta.toml
@@ -2,14 +2,15 @@
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
[meta]
template = "pure-python"
-commit-id = "20bd2b81e77d10768865fa8ec7840352a7ebab8f"
+commit-id = "efb3f62f0f2d8deea657bae8db49a191698e62ef"
[python]
-with-appveyor = false
with-pypy = true
with-legacy-python = true
with-docs = true
with-sphinx-doctests = false
+with-windows = false
+with-future-python = false
[tox]
use-flake8 = true
diff --git a/CHANGES.rst b/CHANGES.rst
index e16a376..bbf9168 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -2,24 +2,27 @@
Changes
=========
-5.1.1 (unreleased)
+5.2.0 (unreleased)
==================
- ``tales.Context.getValue`` now returns the innermost (not outermost)
value for the given variable. Fixes
`#19 <https://github.com/zopefoundation/zope.tales/issues/19>`_.
-- Add support for Python 3.9.
+- Add support for Python 3.9, 3.10.
+
+- Fix error message raised if the first element of a path expression is not
+ a valid name.
5.1 (2020-07-06)
================
-- Packaging and test configuration cleanups
+- Packaging and test configuration cleanups.
- Improve `PathExpr` reusability
Provide customizable support for the use of builtins in path expressions
- (`#23 <https://github.com/zopefoundation/zope.tales/issues/23>`_)
+ (`#23 <https://github.com/zopefoundation/zope.tales/issues/23>`_).
5.0.2 (2020-03-27)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..31d95f0
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,23 @@
+<!--
+Generated from:
+https://github.com/zopefoundation/meta/tree/master/config/pure-python
+-->
+# Contributing to zopefoundation projects
+
+The projects under the zopefoundation GitHub organization are open source and
+welcome contributions in different forms:
+
+* bug reports
+* code improvements and bug fixes
+* documentation improvements
+* pull request reviews
+
+For any changes in the repository besides trivial typo fixes you are required
+to sign the contributor agreement. See
+https://www.zope.dev/developer/becoming-a-committer.html for details.
+
+Please visit our [Developer
+Guidelines](https://www.zope.dev/developer/guidelines.html) if you'd like to
+contribute code changes and our [guidelines for reporting
+bugs](https://www.zope.dev/developer/reporting-bugs.html) if you want to file a
+bug report.
diff --git a/MANIFEST.in b/MANIFEST.in
index 38e9c74..18bb4ff 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,6 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/pure-python
+include *.md
include *.rst
include *.txt
include buildout.cfg
diff --git a/README.rst b/README.rst
index 442a7fa..6d6a348 100644
--- a/README.rst
+++ b/README.rst
@@ -10,8 +10,8 @@
:target: https://pypi.org/project/zope.tales/
:alt: Supported Python versions
-.. image:: https://travis-ci.com/zopefoundation/zope.tales.svg?branch=master
- :target: https://travis-ci.com/zopefoundation/zope.tales
+.. image:: https://github.com/zopefoundation/zope.tales/actions/workflows/tests.yml/badge.svg
+ :target: https://github.com/zopefoundation/zope.tales/actions/workflows/tests.yml
.. image:: https://coveralls.io/repos/github/zopefoundation/zope.tales/badge.svg?branch=master
:target: https://coveralls.io/github/zopefoundation/zope.tales?branch=master
diff --git a/setup.py b/setup.py
index d8df934..2d006b7 100644
--- a/setup.py
+++ b/setup.py
@@ -35,7 +35,7 @@ TESTS_REQUIRE = [
setup(
name='zope.tales',
- version='5.1.1.dev0',
+ version='5.2.0.dev0',
author='Zope Foundation and Contributors',
author_email='zope-dev@zope.org',
description='Zope Template Application Language Expression Syntax '
@@ -60,6 +60,7 @@ setup(
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
+ 'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Natural Language :: English',
diff --git a/src/zope/tales/expressions.py b/src/zope/tales/expressions.py
index dd8980c..18db2b1 100644
--- a/src/zope/tales/expressions.py
+++ b/src/zope/tales/expressions.py
@@ -124,7 +124,7 @@ class SubPathExpr(object):
base = first[0]
if base and not _valid_name(base):
raise engine.getCompilerError()(
- 'Invalid variable name "%s"' % element)
+ 'Invalid variable name "%s"' % base)
self._base = base
compiledpath[0] = first[1:]
self._compiled_path = tuple(compiledpath)
diff --git a/src/zope/tales/tests/test_expressions.py b/src/zope/tales/tests/test_expressions.py
index 1653c29..9d62875 100644
--- a/src/zope/tales/tests/test_expressions.py
+++ b/src/zope/tales/tests/test_expressions.py
@@ -193,8 +193,13 @@ class TestParsedExpressions(ExpressionTestBase):
def test_dynamic_invalid_variable_name(self):
from zope.tales.tales import CompilerError
- with self.assertRaisesRegex(CompilerError, "Invalid variable name"):
+ with self.assertRaisesRegex(
+ CompilerError, 'Invalid variable name "123"'):
self.engine.compile('path:a/?123')
+ # Deliberate typo for the TAL construct "structure ...".
+ with self.assertRaisesRegex(
+ CompilerError, 'Invalid variable name "structured a"'):
+ self.engine.compile('structured a/b')
def testOldStyleClassIsCalled(self):
class AnOldStyleClass:
diff --git a/tox.ini b/tox.ini
index a30fca4..14d1be8 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,6 +10,7 @@ envlist =
py37
py38
py39
+ py310
pypy
pypy3
docs
@@ -18,7 +19,6 @@ envlist =
[testenv]
usedevelop = true
deps =
- zope.testrunner
commands =
zope-testrunner --test-path=src {posargs:-vc}
extras =
@@ -30,7 +30,8 @@ skip_install = true
deps =
flake8
check-manifest
- check-python-versions
+ check-python-versions >= 0.19.1
+ wheel
commands =
flake8 src setup.py
check-manifest
@@ -39,8 +40,6 @@ commands =
[testenv:docs]
basepython = python3
skip_install = false
-# Until repoze.sphinx.autointerface supports Sphinx 4.x we cannot use it:
-deps = Sphinx < 4
extras =
docs
commands_pre =
@@ -54,7 +53,6 @@ allowlist_externals =
deps =
coverage
coverage-python-version
- zope.testrunner
commands =
mkdir -p {toxinidir}/parts/htmlcov
coverage run -m zope.testrunner --test-path=src {posargs:-vc}
@@ -64,7 +62,7 @@ commands =
[coverage:run]
branch = True
plugins = coverage_python_version
-source = src
+source = zope.tales
[coverage:report]
precision = 2