diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..b35f2d6 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,12 @@ +[*] +indent_style = space +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[*.{py,cfg}] +indent_size = 4 + +[Makefile] +indent_style = tab diff --git a/.gitignore b/.gitignore index 089627f..a384c94 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ *.mo -*.pyc +*.py[cod] .coverage* +pip-selfcheck.json +pyvenv.cfg /.python-version /*.egg-info /.Python diff --git a/.travis.yml b/.travis.yml index e39f912..79a753c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: - 2.7 - 3.4 - 3.5 - - 3.6-dev + - 3.6 - pypy env: - ENVIRON=py @@ -13,7 +13,7 @@ matrix: exclude: - env: ENVIRON=isort include: - - python: "3.5" + - python: "3.6" env: ENVIRON=isort install: - pip install tox coveralls coverage diff --git a/buildout.cfg b/buildout.cfg index 7e40b14..45430dc 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -16,7 +16,6 @@ eggs = RestrictedPython[test,develop,docs] recipe = zc.recipe.testrunner eggs = RestrictedPython - [pytest] recipe = zc.recipe.egg eggs = diff --git a/docs/update_notes.rst b/docs/update_notes.rst index 4184213..cb1ff29 100644 --- a/docs/update_notes.rst +++ b/docs/update_notes.rst @@ -122,12 +122,10 @@ Targeted Versions to support For a RestrictedPython 4.0.0+ Update we aim to support only current Python Versions (under active Security Support): -* 2.6 * 2.7 -* 3.2 -* 3.3 * 3.4 * 3.5 +* 3.6 Targeted API ............ diff --git a/docs_de/RestrictedPython4/index.rst b/docs_de/RestrictedPython4/index.rst index 5dea6a2..96fadb2 100644 --- a/docs_de/RestrictedPython4/index.rst +++ b/docs_de/RestrictedPython4/index.rst @@ -18,14 +18,17 @@ Eine der Kernfunktionalitäten von Zope2 und damit für Plone ist die Möglichke Targeted Versions to support ---------------------------- -For a RestrictedPython 4.0.0+ Update we aim to support only current Python Versions (under active Security Support): +For the RestrictedPython 4 update we aim to support only current Python +versions (the ones that will have active `security support`_ after this update +will be completed): -* 2.6 * 2.7 -* 3.2 -* 3.3 * 3.4 * 3.5 +* 3.6 +* PyPy2.7 + +.. _`security support` : https://docs.python.org/devguide/index.html#branchstatus Abhängigkeiten -------------- diff --git a/setup.cfg b/setup.cfg index 2fb54db..8802da3 100644 --- a/setup.cfg +++ b/setup.cfg @@ -8,11 +8,11 @@ upload-dir = docs/html [check-manifest] ignore = - .travis.yml - bootstrap-buildout.py - buildout.cfg - jenkins.cfg - travis.cfg + .travis.yml + bootstrap-buildout.py + buildout.cfg + jenkins.cfg + travis.cfg [isort] force_alphabetical_sort = True diff --git a/setup.py b/setup.py index 634e4ab..892be3d 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ def read(*rnames): return open(os.path.join(os.path.dirname(__file__), *rnames)).read() + setup(name='RestrictedPython', version='4.0.0.dev0', url='http://pypi.python.org/pypi/RestrictedPython', @@ -30,13 +31,24 @@ def read(*rnames): 'environment for Python, e.g. for running untrusted code.', long_description=(read('src', 'RestrictedPython', 'README.txt') + '\n' + read('CHANGES.txt')), + classifiers=[ + 'License :: OSI Approved :: Zope Public License', + 'Programming Language :: Python', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: Implementation :: CPython', + 'Programming Language :: Python :: Implementation :: PyPy', + 'Topic :: Security', + ], author='Zope Foundation and Contributors', author_email='zope-dev@zope.org', packages=find_packages('src'), package_dir={'': 'src'}, install_requires=[ 'setuptools', - #'zope.deprecation', 'six', ], extras_require={ @@ -50,8 +62,7 @@ def read(*rnames): 'pytest', ], 'develop': [ - 'ipdb', - 'ipython', + 'pdbpp', 'isort', ], }, diff --git a/src/RestrictedPython/transformer.py b/src/RestrictedPython/transformer.py index a066da3..29f6503 100644 --- a/src/RestrictedPython/transformer.py +++ b/src/RestrictedPython/transformer.py @@ -152,10 +152,10 @@ ast.Raise, ast.TryExcept, ast.TryFinally, - ast.ExceptHandler + ast.ExceptHandler, ]) -if version >= (3, 0): +if version >= (3, 4): AST_WHITELIST.extend([ ast.Bytes, ast.Starred, @@ -166,10 +166,6 @@ ast.withitem ]) -if version >= (3, 4): - AST_WHITELIST.extend([ - ]) - if version >= (3, 5): IOPERATOR_TO_STR[ast.MatMult] = '@=' diff --git a/tox.ini b/tox.ini index 9b900c8..89d1a6e 100644 --- a/tox.ini +++ b/tox.ini @@ -1,31 +1,48 @@ [tox] -envlist = coverage-clean,py{27,34,35,36,py},coverage-report,isort +envlist = + basetest, + coverage-clean, + py27, + py34, + py35, + py36, + pypy, + pypy2, + coverage-report, + isort, + #flake8, +skip_missing_interpreters = False [testenv] install_command = pip install --egg {opts} {packages} usedevelop = True commands = -# py.test --cov=src --cov-report=xml {posargs} -# py.test --cov=src --isort --flake8 --tb=long --cov-report=xml {posargs} - py.test -x --pdb --tb=long --cov=src --cov-report=xml {posargs} + py.test --cov=src --cov-report=xml {posargs} + # py.test -x --pdb --tb=long --cov=src --cov-report=xml {posargs} setenv = COVERAGE_FILE=.coverage.{envname} deps = - .[test] - ipdb - ipython + .[test,develop] pytest < 3.0 pytest-cov pytest-remove-stale-bytecode pytest-mock # pytest-mypy +[testenv:basetest] +# Additional Test step to show which basepython is used. +# python2 should be used, python3 fails on coverage-report. +basepython = python +commands = python -V + [testenv:coverage-clean] +basepython = python deps = coverage skip_install = true commands = coverage erase [testenv:coverage-report] +basepython = python deps = coverage setenv = COVERAGE_FILE=.coverage @@ -37,11 +54,11 @@ commands = coverage xml [testenv:isort] -basepython = python3.4 +basepython = python deps = isort commands = isort --check-only --recursive {toxinidir}/src {posargs} [testenv:flake8] -basepython = python3.4 +basepython = python deps = flake8 -commands = flake8 src setup.py --doctests +commands = flake8 --doctests src setup.py