Skip to content

Commit 1332086

Browse files
chore: Remove support for py2 (#355)
1 parent 2f4773f commit 1332086

File tree

12 files changed

+11
-140
lines changed

12 files changed

+11
-140
lines changed

Diff for: .github/workflows/ci_tests.yaml

-20
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
- windows-latest
2929
- macos-latest
3030
python:
31-
- 2.7
3231
- 3.5
3332
- 3.6
3433
- 3.7
@@ -84,22 +83,3 @@ jobs:
8483
env:
8584
TOXENV: ${{ matrix.category }}
8685
run: tox -- -vv
87-
upstream-py2:
88-
runs-on: ubuntu-latest
89-
strategy:
90-
fail-fast: true
91-
matrix:
92-
category:
93-
- test-upstream-requirements-py27
94-
steps:
95-
- uses: actions/checkout@v2
96-
- uses: actions/setup-python@v1
97-
with:
98-
python-version: 2.7
99-
- run: |
100-
python -m pip install --upgrade pip
101-
pip install --upgrade -r ci-requirements.txt
102-
- name: run test
103-
env:
104-
TOXENV: ${{ matrix.category }}
105-
run: tox -- -vv

Diff for: README.rst

+1-6
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ Getting Started
3434
Required Prerequisites
3535
======================
3636

37-
* Python 2.7+ or 3.4+
38-
39-
**NOTE: 2.x is the last major version of this library that will
40-
support Python 2. Future major versions will begin to adopt changes
41-
known to break Python 2. Python 3.4 support will also be removed
42-
in future major versions; Python 3.5+ will be required.**
37+
* Python 3.5+
4338
* cryptography >= 2.5.0
4439
* boto3 >= 1.10.0
4540
* attrs

Diff for: buildspec.yml

-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ version: 0.2
33
batch:
44
fast-fail: false
55
build-list:
6-
- identifier: py27_integ
7-
buildspec: codebuild/py27/integ.yml
8-
- identifier: py27_examples
9-
buildspec: codebuild/py27/examples.yml
10-
- identifier: py27_awses_local
11-
buildspec: codebuild/py27/awses_local.yml
12-
136
- identifier: py35_integ
147
buildspec: codebuild/py35/integ.yml
158
- identifier: py35_examples

Diff for: codebuild/py27/awses_local.yml

-25
This file was deleted.

Diff for: codebuild/py27/examples.yml

-22
This file was deleted.

Diff for: codebuild/py27/integ.yml

-22
This file was deleted.

Diff for: decrypt_oracle/setup.py

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def get_requirements():
4646
"License :: OSI Approved :: Apache Software License",
4747
"Programming Language :: Python",
4848
"Programming Language :: Python :: 3.6",
49+
"Programming Language :: Python :: 3.7",
50+
"Programming Language :: Python :: 3.8",
51+
"Programming Language :: Python :: 3.9",
4952
"Programming Language :: Python :: Implementation :: CPython",
5053
"Topic :: Security",
5154
"Topic :: Security :: Cryptography",

Diff for: decrypt_oracle/tox.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{27,34,35,36,37}-{local,integ},
3+
py{35,36,37,38,39}-{local,integ},
44
bandit, doc8, readme, docs,
55
{flake8,pylint}{,-tests},
66
# prone to false positives

Diff for: src/aws_encryption_sdk/internal/crypto/elliptic_curve.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
from cryptography.hazmat.backends import default_backend
1919
from cryptography.hazmat.primitives.asymmetric import ec
2020
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed, decode_dss_signature, encode_dss_signature
21-
from cryptography.utils import InterfaceNotImplemented, int_from_bytes, int_to_bytes, verify_interface
21+
from cryptography.utils import InterfaceNotImplemented, int_to_bytes, verify_interface
2222

2323
from ...exceptions import NotSupportedError
2424
from ..str_ops import to_bytes
@@ -123,8 +123,7 @@ def _ecc_decode_compressed_point(curve, compressed_point):
123123
y_order_map = {b"\x02": 0, b"\x03": 1}
124124
raw_x = compressed_point[1:]
125125
raw_x = to_bytes(raw_x)
126-
# pylint gives a false positive that int_from_bytes is not callable
127-
x = int_from_bytes(raw_x, "big") # pylint: disable=not-callable
126+
x = int.from_bytes(raw_x, "big")
128127
raw_y = compressed_point[0]
129128
# In Python3, bytes index calls return int values rather than strings
130129
if isinstance(raw_y, six.integer_types):

Diff for: test_vector_handlers/setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,12 @@ def get_requirements():
4545
"Natural Language :: English",
4646
"License :: OSI Approved :: Apache Software License",
4747
"Programming Language :: Python",
48-
"Programming Language :: Python :: 2",
49-
"Programming Language :: Python :: 2.7",
5048
"Programming Language :: Python :: 3",
51-
"Programming Language :: Python :: 3.4",
5249
"Programming Language :: Python :: 3.5",
5350
"Programming Language :: Python :: 3.6",
5451
"Programming Language :: Python :: 3.7",
52+
"Programming Language :: Python :: 3.8",
53+
"Programming Language :: Python :: 3.9",
5554
"Programming Language :: Python :: Implementation :: CPython",
5655
"Topic :: Security",
5756
"Topic :: Security :: Cryptography",

Diff for: test_vector_handlers/tox.ini

+1-13
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
envlist =
33
# The test vectors depend on new features now,
44
# so until release we can only effectively test the local version of the ESDK.
5-
py{27,34,35,36,37}-awses_local,
5+
py{35,36,37,38,39}-awses_local,
66
# 1.2.0 and 1.2.max are being difficult because of attrs
77
bandit, doc8, readme, docs,
88
{flake8,pylint}{,-tests},
@@ -102,18 +102,6 @@ commands =
102102
{posargs}
103103
{[testenv:mypy-coverage]commands}
104104

105-
[testenv:mypy-py2]
106-
# We only test 2.7, please upgrade
107-
basepython = python2.7
108-
deps = {[testenv:mypy-common]deps}
109-
commands =
110-
python -m mypy \
111-
--py2 \
112-
--linecoverage-report build \
113-
src/awses_test_vectors/ \
114-
{posargs}
115-
{[testenv:mypy-coverage]commands}
116-
117105
# Linters
118106
[testenv:flake8]
119107
basepython = python3

Diff for: tox.ini

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
envlist =
3-
py{27,34,35,36,37,38,39}-{local,integ,accept,examples}, nocmk,
3+
py{35,36,37,38,39}-{local,integ,accept,examples}, nocmk,
44
bandit, doc8, readme, docs,
55
{flake8,pylint}{,-tests,-examples},
66
isort-check, black-check,
@@ -94,15 +94,6 @@ recreate = True
9494
deps =
9595
commands = {toxinidir}/test/freeze-upstream-requirements.sh
9696

97-
# Freeze for Python 2.7
98-
[testenv:freeze-upstream-requirements-py27]
99-
basepython = python2.7
100-
sitepackages = {[testenv:freeze-upstream-requirements-base]sitepackages}
101-
skip_install = {[testenv:freeze-upstream-requirements-base]skip_install}
102-
recreate = {[testenv:freeze-upstream-requirements-base]recreate}
103-
deps = {[testenv:freeze-upstream-requirements-base]deps}
104-
commands = {[testenv:freeze-upstream-requirements-base]commands} test/upstream-requirements-py27.txt
105-
10697
# Freeze for Python 3.7
10798
[testenv:freeze-upstream-requirements-py37]
10899
basepython = python3.7
@@ -118,14 +109,6 @@ sitepackages = False
118109
recreate = True
119110
commands = {[testenv:base-command]commands} test/ -m local
120111

121-
# Test frozen upstream requirements for Python 2.7
122-
[testenv:test-upstream-requirements-py27]
123-
basepython = python2.7
124-
deps = -rtest/upstream-requirements-py27.txt
125-
sitepackages = {[testenv:test-upstream-requirements-base]sitepackages}
126-
recreate = {[testenv:test-upstream-requirements-base]recreate}
127-
commands = {[testenv:test-upstream-requirements-base]commands}
128-
129112
# Test frozen upstream requirements for Python 3.7
130113
[testenv:test-upstream-requirements-py37]
131114
basepython = python3.7

0 commit comments

Comments
 (0)