Skip to content

Commit

Permalink
Drop Python 2 support
Browse files Browse the repository at this point in the history
  • Loading branch information
bluetech committed Aug 25, 2021
1 parent 913e21d commit ffa92eb
Show file tree
Hide file tree
Showing 17 changed files with 200 additions and 393 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
python: ['3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -36,16 +36,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
python: ['3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
old_cryptography: ['']
extra_name: ['']
include:
- python: '3.8'
old_cryptography: 2.6.1
extra_name: ', cryptography 2.6.1'
- python: pypy2
old_cryptography: ''
extra_name: ', PyPy 2'
- python: pypy3
old_cryptography: ''
extra_name: ', PyPy 3'
Expand All @@ -70,7 +67,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ['2.7', '3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
python: ['3.6', '3.7', '3.8', '3.9', '3.10.0-beta.2']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Expand Up @@ -33,7 +33,7 @@ Vital statistics

**Bug tracker and source code:** https://github.com/python-trio/trustme

**Tested on:** Python 2.7 and Python 3.5+, CPython and PyPy
**Tested on:** Python 3.6+, CPython and PyPy

**License:** MIT or Apache 2, your choice.

Expand Down
6 changes: 1 addition & 5 deletions ci.sh
Expand Up @@ -12,11 +12,7 @@ python -m pip install dist/*.zip

# Actual tests

if [[ $(python -c 'import sys; print(sys.version_info < (3,))') = 'True' ]]; then
python -m pip install -Ur test-requirements.txt
else
python -m pip install -Ur test-requirements-py3.txt
fi
python -m pip install -Ur test-requirements.txt
if [ -n "${OLD_CRYPTOGRAPHY:-}" ]; then
python -m pip install cryptography=="${OLD_CRYPTOGRAPHY}"
fi
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst
Expand Up @@ -11,9 +11,9 @@ works. It demonstrates a simple TLS server and client that connect to
each other using :mod:`trustme`\-generated certs.

This example requires `Trio <https://trio.readthedocs.io>`__ (``pip
install -U trio``) and Python 3.5+. Note that while :mod:`trustme` is
install -U trio``) and Python 3.6+. Note that while :mod:`trustme` is
maintained by the Trio project, :mod:`trustme` is happy to work with
any networking library, and also supports Python 2.
any networking library.

The key lines are the calls to :meth:`~CA.configure_trust`,
:meth:`~LeafCert.configure_cert` – try commenting them out one at a
Expand Down
5 changes: 2 additions & 3 deletions lint-requirements.in
@@ -1,6 +1,5 @@
# Typing
mypy[python2]==0.910
mypy==0.910
# TODO: Switch to cryptography>=35.0.0 once it's released.
types-cryptography>=3.3.3
types-pyopenssl>=20.0.4
py>=1.9.0
pytest>=6.2
30 changes: 26 additions & 4 deletions lint-requirements.txt
@@ -1,17 +1,35 @@
#
# This file is autogenerated by pip-compile with python 3.9
# This file is autogenerated by pip-compile with python 3.6
# To update, run:
#
# pip-compile lint-requirements.in
#
mypy[python2]==0.910
attrs==21.2.0
# via pytest
importlib-metadata==4.6.4
# via
# pluggy
# pytest
iniconfig==1.1.1
# via pytest
mypy==0.910
# via -r lint-requirements.in
mypy-extensions==0.4.3
# via mypy
packaging==21.0
# via pytest
pluggy==0.13.1
# via pytest
py==1.10.0
# via pytest
pyparsing==2.4.7
# via packaging
pytest==6.2.4
# via -r lint-requirements.in
toml==0.10.2
# via mypy
# via
# mypy
# pytest
typed-ast==1.4.3
# via mypy
types-cryptography==3.3.5
Expand All @@ -25,4 +43,8 @@ types-ipaddress==0.1.5
types-pyopenssl==20.0.5
# via -r lint-requirements.in
typing-extensions==3.10.0.0
# via mypy
# via
# importlib-metadata
# mypy
zipp==3.5.0
# via importlib-metadata
1 change: 0 additions & 1 deletion lint.sh
Expand Up @@ -14,4 +14,3 @@ python -m pip install -Ur lint-requirements.txt
# Linting

mypy trustme tests
mypy -2 trustme tests
7 changes: 1 addition & 6 deletions pyproject.toml
Expand Up @@ -34,9 +34,4 @@ warn_redundant_casts = true
warn_return_any = true
warn_unreachable = true
warn_unused_configs = true
# Some ignores are only for python2/python3.
# warn_unused_ignores = true

[[tool.mypy.overrides]]
module = "pytest"
ignore_missing_imports = true
warn_unused_ignores = true
4 changes: 1 addition & 3 deletions setup.py
Expand Up @@ -22,7 +22,6 @@
# cryptography depends on both of these too, so we should declare our
# dependencies to be accurate, but they don't actually cost anything:
"idna",
"ipaddress; python_version < '3.3'",
],
classifiers=[
"Development Status :: 4 - Beta",
Expand All @@ -31,9 +30,8 @@
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down
63 changes: 0 additions & 63 deletions test-requirements-py3.txt

This file was deleted.

13 changes: 2 additions & 11 deletions test-requirements.in
@@ -1,15 +1,6 @@
pytest
pytest>=6.2
pytest-cov
PyOpenSSL
service-identity
cryptography
# Those are the last version with py2 support
# and pip-compile won't let us pin it just on py2, so we have to pin it
# everywhere
more-itertools==5.0.0; python_version < "3"
zipp<2.0; python_version < "3"
idna<3; python_version < "3"
# Really only needed on py2, but again, pip-compile doesn't handle
# environment markers well, so we install it everywhere and on py3 it
# just doesn't get used.
futures; python_version < "3.2"
idna
72 changes: 20 additions & 52 deletions test-requirements.txt
@@ -1,97 +1,65 @@
#
# This file is autogenerated by pip-compile
# This file is autogenerated by pip-compile with python 3.6
# To update, run:
#
# pip-compile test-requirements.in
#
atomicwrites==1.4.0
# via pytest
attrs==21.2.0
# via
# pytest
# service-identity
backports.functools-lru-cache==1.6.4
# via wcwidth
cffi==1.14.5
cffi==1.14.6
# via cryptography
configparser==4.0.2
# via importlib-metadata
contextlib2==0.6.0.post1
# via
# importlib-metadata
# zipp
coverage==5.5
# via pytest-cov
cryptography==2.9.2
cryptography==3.4.8
# via
# -r test-requirements.in
# pyopenssl
# service-identity
enum34==1.1.10
# via cryptography
funcsigs==1.0.2
# via pytest
futures==3.1.1 ; python_version < "3.2"
# via -r test-requirements.in
idna==2.10 ; python_version < "3"
idna==3.2
# via -r test-requirements.in
importlib-metadata==2.0.0
importlib-metadata==4.6.4
# via
# pluggy
# pytest
ipaddress==1.0.23
# via
# cryptography
# service-identity
more-itertools==5.0.0 ; python_version < "3"
# via
# -r test-requirements.in
# pytest
packaging==20.9
iniconfig==1.1.1
# via pytest
packaging==21.0
# via pytest
pathlib2==2.3.5
# via
# importlib-metadata
# pytest
pluggy==0.13.1
# via pytest
py==1.10.0
# via pytest
pyasn1-modules==0.2.8
# via service-identity
pyasn1==0.4.8
# via
# pyasn1-modules
# service-identity
pyasn1-modules==0.2.8
# via service-identity
pycparser==2.20
# via cffi
pyopenssl==19.1.0
pyopenssl==20.0.1
# via -r test-requirements.in
pyparsing==2.4.7
# via packaging
pytest-cov==2.12.1
# via -r test-requirements.in
pytest==4.6.3
pytest==6.2.4
# via
# -r test-requirements.in
# pytest-cov
scandir==1.10.0
# via pathlib2
pytest-cov==2.12.1
# via -r test-requirements.in
service-identity==21.1.0
# via -r test-requirements.in
six==1.16.0
# via
# cryptography
# more-itertools
# pathlib2
# pyopenssl
# pytest
# service-identity
toml==0.10.2
# via pytest-cov
wcwidth==0.2.5
# via pytest
zipp==1.2.0 ; python_version < "3"
# via
# -r test-requirements.in
# importlib-metadata
# pytest
# pytest-cov
typing-extensions==3.10.0.0
# via importlib-metadata
zipp==3.5.0
# via importlib-metadata

0 comments on commit ffa92eb

Please sign in to comment.