Skip to content

Commit

Permalink
Add support for Python 3.10; drop support for Python 2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
kislyuk committed Oct 27, 2021
1 parent 8659769 commit 9226dd4
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 22 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
max-parallel: 8
matrix:
os: [ubuntu-20.04, macos-10.15]
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
python-version: ["3.5", "3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test_deps:
pip install coverage flake8 wheel

lint: test_deps
./setup.py flake8
flake8 $$(python setup.py --name) test

test: test_deps lint
coverage run --source=$$(python setup.py --name) ./test/test.py
Expand Down
3 changes: 1 addition & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ payload security in `SAML 2.0 <http://en.wikipedia.org/wiki/SAML_2.0>`_ and
some SAML implementations)
* Modern Python compatibility (3.5-3.9+ and PyPy)
* Well-supported, portable, reliable dependencies: `lxml <https://github.com/lxml/lxml>`_,
`cryptography <https://github.com/pyca/cryptography>`_, `eight <https://github.com/kislyuk/eight>`_,
`pyOpenSSL <https://github.com/pyca/pyopenssl>`_
`cryptography <https://github.com/pyca/cryptography>`_, `pyOpenSSL <https://github.com/pyca/pyopenssl>`_
* Comprehensive testing (including the XMLDSig interoperability suite) and `continuous integration
<https://github.com/XML-Security/signxml/actions>`_
* Simple interface with useful defaults
Expand Down
2 changes: 1 addition & 1 deletion common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ release:
$(MAKE) release-docs

release-pypi:
python setup.py sdist bdist_wheel
python -m build
twine upload dist/*.tar.gz dist/*.whl --sign --verbose

release-docs:
Expand Down
9 changes: 1 addition & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,13 @@
# Dependencies are restricted by major version range according to semver.
# By default, version minimums are set to be compatible with the oldest supported Ubuntu LTS (currently 18.04).
'lxml >= 4.2.1, < 5',
'eight >= 0.4.2, < 2',
'cryptography >= 2.1.4',
'pyOpenSSL >= 17.5.0, < 21',
'certifi >= 2018.1.18'
],
extras_require={
':python_version == "2.7"': [
'enum34 >= 1.1.6, < 2',
'ipaddress >= 1.0.17, < 2'
]
},
packages=find_packages(exclude=['test']),
platforms=['MacOS X', 'Posix'],
package_data={'signxml': ['schemas/*.xsd']},
zip_safe=False,
include_package_data=True,
test_suite='test',
classifiers=[
Expand All @@ -43,6 +35,7 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Software Development :: Libraries :: Python Modules'
]
)
1 change: 0 additions & 1 deletion signxml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from base64 import b64encode, b64decode
from enum import Enum

from eight import str, bytes
from lxml import etree
from lxml.etree import Element, SubElement

Expand Down
1 change: 0 additions & 1 deletion signxml/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from xml.etree import ElementTree as stdlibElementTree
from base64 import b64encode, b64decode

from eight import str, bytes
from lxml import etree

from ..exceptions import RedundantCert, InvalidCertificate, InvalidInput
Expand Down
1 change: 0 additions & 1 deletion test/generate_125_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import os.path
from base64 import b64encode

from eight import str, bytes
from lxml import etree
from lxml.etree import Element, SubElement

Expand Down
10 changes: 6 additions & 4 deletions test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
import cryptography.exceptions
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import rsa, dsa, ec
from eight import str, open

sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from signxml import (XMLSigner, XMLVerifier, XMLSignatureProcessor, methods, namespaces, InvalidInput, InvalidSignature,
InvalidCertificate, InvalidDigest)
from signxml import (XMLSigner, XMLVerifier, XMLSignatureProcessor, methods, namespaces, InvalidInput, # noqa
InvalidSignature, InvalidCertificate, InvalidDigest)

def reset_tree(t, method):
if not isinstance(t, str):
Expand Down Expand Up @@ -475,7 +474,10 @@ def test_signature_properties_with_detached_method_re_enveloping(self):
key=key,
reference_uri="#mytest",
signature_properties=sigprop)
fulldoc = b'<ns0:root xmlns:ns0="http://enveloping.namespace">' + etree.tostring(signature) + etree.tostring(doc) + b'</ns0:root>'
fulldoc = b'<ns0:root xmlns:ns0="http://enveloping.namespace">' \
+ etree.tostring(signature) \
+ etree.tostring(doc) \
+ b'</ns0:root>'
XMLVerifier().verify(etree.fromstring(fulldoc), x509_cert=cert, expect_references=2)


Expand Down

0 comments on commit 9226dd4

Please sign in to comment.