summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Howitz <mh@gocept.com>2022-07-08 09:03:28 +0200
committerGitHub <noreply@github.com>2022-07-08 09:03:28 +0200
commit5c53fd90b1a529f2d1d4ed361d3bfa646520ba58 (patch)
treeb3566acd0b8d3c15a4818b64248e769ec54ba6a5
parentbd3cf813b81ded3dba9baf3f9d4fd990136471c4 (diff)
downloadzope-proxy-5c53fd90b1a529f2d1d4ed361d3bfa646520ba58.tar.gz
Fix PyPy2 run on GHA. (#52)
* isort lines.
-rw-r--r--.github/workflows/tests.yml24
-rw-r--r--.gitignore1
-rwxr-xr-x.manylinux-install.sh8
-rw-r--r--.meta.toml2
-rw-r--r--CONTRIBUTING.md23
-rw-r--r--MANIFEST.in1
-rw-r--r--setup.cfg11
-rw-r--r--setup.py5
-rw-r--r--src/zope/proxy/__init__.py13
-rw-r--r--src/zope/proxy/_compat.py1
-rw-r--r--src/zope/proxy/decorator.py8
-rw-r--r--src/zope/proxy/tests/test_decorator.py2
-rw-r--r--src/zope/proxy/tests/test_proxy.py6
-rw-r--r--tox.ini18
14 files changed, 94 insertions, 29 deletions
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 3e42c56..8802779 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -139,11 +139,18 @@ jobs:
restore-keys: |
${{ runner.os }}-pip-
- - name: Install Build Dependencies
+ - name: Install Build Dependencies (PyPy2)
+ if: >
+ startsWith(matrix.python-version, 'pypy-2.7')
+ run: |
+ pip install -U pip
+ pip install -U setuptools wheel twine "cffi != 1.15.1"
+ - name: Install Build Dependencies (other Python versions)
+ if: >
+ !startsWith(matrix.python-version, 'pypy-2.7')
run: |
pip install -U pip
pip install -U setuptools wheel twine cffi
- pip install -U coveralls coverage
- name: Build zope.proxy
run: |
@@ -152,7 +159,6 @@ jobs:
python setup.py build_ext -i
python setup.py bdist_wheel
# Also install it, so that we get dependencies in the (pip) cache.
- pip install -U coverage
pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"'
pip install .[test]
@@ -169,7 +175,11 @@ jobs:
# We cannot 'uses: pypa/gh-action-pypi-publish@v1.4.1' because
# that's apparently a container action, and those don't run on
# the Mac.
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') && startsWith(runner.os, 'Mac') && !startsWith(matrix.python-version, 'pypy')
+ if: >
+ github.event_name == 'push'
+ && startsWith(github.ref, 'refs/tags')
+ && startsWith(runner.os, 'Mac')
+ && !startsWith(matrix.python-version, 'pypy')
env:
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
@@ -234,7 +244,7 @@ jobs:
- name: Install zope.proxy
run: |
pip install -U wheel setuptools
- pip install -U coverage coverage-python-version
+ pip install -U coverage
pip install -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"'
# Unzip into src/ so that testrunner can find the .so files
# when we ask it to load tests from that directory. This
@@ -444,7 +454,9 @@ jobs:
run: sudo chown -R $(whoami) ${{ steps.pip-cache.outputs.dir }}
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@v1.4.1
- if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
+ if: >
+ github.event_name == 'push'
+ && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.TWINE_PASSWORD }}
diff --git a/.gitignore b/.gitignore
index 20b2128..6e5e8ef 100644
--- a/.gitignore
+++ b/.gitignore
@@ -28,4 +28,5 @@ lib64
log/
parts/
pyvenv.cfg
+testing.log
var/
diff --git a/.manylinux-install.sh b/.manylinux-install.sh
index c730ec9..c6bc43f 100755
--- a/.manylinux-install.sh
+++ b/.manylinux-install.sh
@@ -39,10 +39,10 @@ for PYBIN in /opt/python/*/bin; do
"${PYBIN}/pip" install -e /io/
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
if [ `uname -m` == 'aarch64' ]; then
- cd /io/
- "${PYBIN}/pip" install tox
- "${PYBIN}/tox" -e py
- cd ..
+ cd /io/
+ "${PYBIN}/pip" install tox
+ "${PYBIN}/tox" -e py
+ cd ..
fi
rm -rf /io/build /io/*.egg-info
fi
diff --git a/.meta.toml b/.meta.toml
index 63a5404..3428da6 100644
--- a/.meta.toml
+++ b/.meta.toml
@@ -2,7 +2,7 @@
# https://github.com/zopefoundation/meta/tree/master/config/c-code
[meta]
template = "c-code"
-commit-id = "aef18fe5ee64014d8b1b9de21f1e0a0991be874e"
+commit-id = "cde9741a5a0d9d04cee25cb617ee1590afebb17d"
[python]
with-appveyor = true
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..e6d84b8
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,23 @@
+<!--
+Generated from:
+https://github.com/zopefoundation/meta/tree/master/config/c-code
+-->
+# 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 c8bc394..dfb0903 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,6 @@
# Generated from:
# https://github.com/zopefoundation/meta/tree/master/config/c-code
+include *.md
include *.rst
include *.txt
include buildout.cfg
diff --git a/setup.cfg b/setup.cfg
index 94e0661..cefd05d 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -19,3 +19,14 @@ ignore =
docs/_build
docs/_build/*
docs/_build/*/*
+
+[isort]
+force_single_line = True
+combine_as_imports = True
+sections = FUTURE,STDLIB,THIRDPARTY,ZOPE,FIRSTPARTY,LOCALFOLDER
+known_third_party = six, docutils, pkg_resources
+known_zope =
+known_first_party =
+default_section = ZOPE
+line_length = 79
+lines_after_imports = 2
diff --git a/setup.py b/setup.py
index 7d41eeb..f1c11c1 100644
--- a/setup.py
+++ b/setup.py
@@ -19,17 +19,16 @@
"""Setup for zope.proxy package
"""
from __future__ import print_function
+
import os
import platform
-
-
from distutils.errors import CCompilerError
from distutils.errors import DistutilsExecError
from distutils.errors import DistutilsPlatformError
from setuptools import Extension
-from setuptools.command.build_ext import build_ext
from setuptools import setup
+from setuptools.command.build_ext import build_ext
class optional_build_ext(build_ext):
diff --git a/src/zope/proxy/__init__.py b/src/zope/proxy/__init__.py
index d17187a..3fc4b53 100644
--- a/src/zope/proxy/__init__.py
+++ b/src/zope/proxy/__init__.py
@@ -18,8 +18,10 @@ import os
import pickle
from zope.interface import moduleProvides
+
from zope.proxy.interfaces import IProxyIntrospection
+
moduleProvides(IProxyIntrospection)
__all__ = tuple(IProxyIntrospection)
@@ -544,17 +546,16 @@ class PyNonOverridable(object):
if _c_available: # pragma: no cover
# Python API: not used in this module
+ # API for proxy-using C extensions.
+ from zope.proxy._zope_proxy_proxy import _CAPI # noqa: F401 unused
from zope.proxy._zope_proxy_proxy import ProxyBase
from zope.proxy._zope_proxy_proxy import getProxiedObject
- from zope.proxy._zope_proxy_proxy import setProxiedObject
from zope.proxy._zope_proxy_proxy import isProxy
- from zope.proxy._zope_proxy_proxy import sameProxiedObjects
- from zope.proxy._zope_proxy_proxy import queryProxy
from zope.proxy._zope_proxy_proxy import queryInnerProxy
+ from zope.proxy._zope_proxy_proxy import queryProxy
from zope.proxy._zope_proxy_proxy import removeAllProxies
-
- # API for proxy-using C extensions.
- from zope.proxy._zope_proxy_proxy import _CAPI # noqa: F401 unused
+ from zope.proxy._zope_proxy_proxy import sameProxiedObjects
+ from zope.proxy._zope_proxy_proxy import setProxiedObject
else:
# no C extension available, fall back
diff --git a/src/zope/proxy/_compat.py b/src/zope/proxy/_compat.py
index bbd91c3..4f0b0e3 100644
--- a/src/zope/proxy/_compat.py
+++ b/src/zope/proxy/_compat.py
@@ -1,3 +1,4 @@
import sys
+
PY3 = sys.version_info[0] >= 3
diff --git a/src/zope/proxy/decorator.py b/src/zope/proxy/decorator.py
index 9a53dfb..178687e 100644
--- a/src/zope/proxy/decorator.py
+++ b/src/zope/proxy/decorator.py
@@ -18,11 +18,13 @@ additional features.
"""
__docformat__ = "reStructuredText"
-from zope.proxy import getProxiedObject, ProxyBase
+from zope.interface import providedBy
+from zope.interface.declarations import ObjectSpecification
from zope.interface.declarations import ObjectSpecificationDescriptor
from zope.interface.declarations import getObjectSpecification
-from zope.interface.declarations import ObjectSpecification
-from zope.interface import providedBy
+
+from zope.proxy import ProxyBase
+from zope.proxy import getProxiedObject
class DecoratorSpecificationDescriptor(ObjectSpecificationDescriptor):
diff --git a/src/zope/proxy/tests/test_decorator.py b/src/zope/proxy/tests/test_decorator.py
index a2a27ee..6d6c8f9 100644
--- a/src/zope/proxy/tests/test_decorator.py
+++ b/src/zope/proxy/tests/test_decorator.py
@@ -65,6 +65,7 @@ class DecoratorSpecificationDescriptorTests(unittest.TestCase):
from zope.interface import Interface
from zope.interface import implementer
from zope.interface import provider
+
from zope.proxy import ProxyBase
class IContextFactory(Interface):
@@ -86,6 +87,7 @@ class DecoratorSpecificationDescriptorTests(unittest.TestCase):
from zope.interface import Interface
from zope.interface import implementer
from zope.interface import provider
+
from zope.proxy import ProxyBase
class IContextFactory(Interface):
diff --git a/src/zope/proxy/tests/test_proxy.py b/src/zope/proxy/tests/test_proxy.py
index 9d21d3a..973cb2c 100644
--- a/src/zope/proxy/tests/test_proxy.py
+++ b/src/zope/proxy/tests/test_proxy.py
@@ -15,6 +15,7 @@
"""
import unittest
+
try:
import zope.security
except ImportError: # pragma: no cover
@@ -30,6 +31,7 @@ class ModuleConformanceCase(unittest.TestCase):
def test_module_conforms_to_IProxyIntrospection(self):
from zope.interface.verify import verifyObject
+
import zope.proxy
from zope.proxy.interfaces import IProxyIntrospection
verifyObject(IProxyIntrospection, zope.proxy)
@@ -1133,8 +1135,8 @@ class Test_py_sameProxiedObjects(unittest.TestCase):
return PyProxyBase(obj)
def _makeSecurityProxy(self, obj):
- from zope.security.proxy import ProxyPy
from zope.security.checker import CheckerPy
+ from zope.security.proxy import ProxyPy
checker = CheckerPy({})
return ProxyPy(obj, checker)
@@ -1231,8 +1233,8 @@ class Test_sameProxiedObjects(Test_py_sameProxiedObjects):
return ProxyBase(obj)
def _makeSecurityProxy(self, obj):
- from zope.security.proxy import Proxy
from zope.security.checker import Checker
+ from zope.security.proxy import Proxy
checker = Checker({})
return Proxy(obj, checker)
diff --git a/tox.ini b/tox.ini
index 16d3641..768e3e7 100644
--- a/tox.ini
+++ b/tox.ini
@@ -46,15 +46,25 @@ commands =
[testenv:lint]
basepython = python3
skip_install = true
+commands =
+ isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py
+ flake8 src setup.py
+ check-manifest
+ check-python-versions
deps =
- flake8
check-manifest
check-python-versions >= 0.19.1
wheel
+ flake8
+ isort
+
+[testenv:isort-apply]
+basepython = python3
+commands_pre =
+deps =
+ isort
commands =
- flake8 src setup.py
- check-manifest
- check-python-versions
+ isort {toxinidir}/src {toxinidir}/setup.py []
[testenv:docs]
basepython = python3