Skip to content

Commit

Permalink
Merge branch 'Python3_update' into python3_migrate_tests_part0
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/RestrictedPython/transformer.py
  • Loading branch information
Michael Howitz committed Jan 31, 2017
2 parents 3f8a078 + 603f864 commit 4d98e21
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 35 deletions.
12 changes: 12 additions & 0 deletions .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
4 changes: 3 additions & 1 deletion .gitignore
@@ -1,6 +1,8 @@
*.mo
*.pyc
*.py[cod]
.coverage*
pip-selfcheck.json
pyvenv.cfg
/.python-version
/*.egg-info
/.Python
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -4,7 +4,7 @@ python:
- 2.7
- 3.4
- 3.5
- 3.6-dev
- 3.6
- pypy
env:
- ENVIRON=py
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion buildout.cfg
Expand Up @@ -16,7 +16,6 @@ eggs = RestrictedPython[test,develop,docs]
recipe = zc.recipe.testrunner
eggs = RestrictedPython


[pytest]
recipe = zc.recipe.egg
eggs =
Expand Down
4 changes: 1 addition & 3 deletions docs/update_notes.rst
Expand Up @@ -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
............
Expand Down
11 changes: 7 additions & 4 deletions docs_de/RestrictedPython4/index.rst
Expand Up @@ -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
--------------
Expand Down
10 changes: 5 additions & 5 deletions setup.cfg
Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions setup.py
Expand Up @@ -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',
Expand All @@ -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={
Expand All @@ -50,8 +62,7 @@ def read(*rnames):
'pytest',
],
'develop': [
'ipdb',
'ipython',
'pdbpp',
'isort',
],
},
Expand Down
8 changes: 2 additions & 6 deletions src/RestrictedPython/transformer.py
Expand Up @@ -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,
Expand All @@ -166,10 +166,6 @@
ast.withitem
])

if version >= (3, 4):
AST_WHITELIST.extend([
])

if version >= (3, 5):
IOPERATOR_TO_STR[ast.MatMult] = '@='

Expand Down
37 changes: 27 additions & 10 deletions 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
Expand All @@ -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

0 comments on commit 4d98e21

Please sign in to comment.