Skip to content

Commit

Permalink
chore: Remove support for py2 (#355)
Browse files Browse the repository at this point in the history
  • Loading branch information
farleyb-amazon committed Jul 1, 2021
1 parent 2f4773f commit 1332086
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 140 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/ci_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
- windows-latest
- macos-latest
python:
- 2.7
- 3.5
- 3.6
- 3.7
Expand Down Expand Up @@ -84,22 +83,3 @@ jobs:
env:
TOXENV: ${{ matrix.category }}
run: tox -- -vv
upstream-py2:
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
category:
- test-upstream-requirements-py27
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 2.7
- run: |
python -m pip install --upgrade pip
pip install --upgrade -r ci-requirements.txt
- name: run test
env:
TOXENV: ${{ matrix.category }}
run: tox -- -vv
7 changes: 1 addition & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,7 @@ Getting Started
Required Prerequisites
======================

* Python 2.7+ or 3.4+

**NOTE: 2.x is the last major version of this library that will
support Python 2. Future major versions will begin to adopt changes
known to break Python 2. Python 3.4 support will also be removed
in future major versions; Python 3.5+ will be required.**
* Python 3.5+
* cryptography >= 2.5.0
* boto3 >= 1.10.0
* attrs
Expand Down
7 changes: 0 additions & 7 deletions buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ version: 0.2
batch:
fast-fail: false
build-list:
- identifier: py27_integ
buildspec: codebuild/py27/integ.yml
- identifier: py27_examples
buildspec: codebuild/py27/examples.yml
- identifier: py27_awses_local
buildspec: codebuild/py27/awses_local.yml

- identifier: py35_integ
buildspec: codebuild/py35/integ.yml
- identifier: py35_examples
Expand Down
25 changes: 0 additions & 25 deletions codebuild/py27/awses_local.yml

This file was deleted.

22 changes: 0 additions & 22 deletions codebuild/py27/examples.yml

This file was deleted.

22 changes: 0 additions & 22 deletions codebuild/py27/integ.yml

This file was deleted.

3 changes: 3 additions & 0 deletions decrypt_oracle/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def get_requirements():
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Security",
"Topic :: Security :: Cryptography",
Expand Down
2 changes: 1 addition & 1 deletion decrypt_oracle/tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{27,34,35,36,37}-{local,integ},
py{35,36,37,38,39}-{local,integ},
bandit, doc8, readme, docs,
{flake8,pylint}{,-tests},
# prone to false positives
Expand Down
5 changes: 2 additions & 3 deletions src/aws_encryption_sdk/internal/crypto/elliptic_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.asymmetric.utils import Prehashed, decode_dss_signature, encode_dss_signature
from cryptography.utils import InterfaceNotImplemented, int_from_bytes, int_to_bytes, verify_interface
from cryptography.utils import InterfaceNotImplemented, int_to_bytes, verify_interface

from ...exceptions import NotSupportedError
from ..str_ops import to_bytes
Expand Down Expand Up @@ -123,8 +123,7 @@ def _ecc_decode_compressed_point(curve, compressed_point):
y_order_map = {b"\x02": 0, b"\x03": 1}
raw_x = compressed_point[1:]
raw_x = to_bytes(raw_x)
# pylint gives a false positive that int_from_bytes is not callable
x = int_from_bytes(raw_x, "big") # pylint: disable=not-callable
x = int.from_bytes(raw_x, "big")
raw_y = compressed_point[0]
# In Python3, bytes index calls return int values rather than strings
if isinstance(raw_y, six.integer_types):
Expand Down
5 changes: 2 additions & 3 deletions test_vector_handlers/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,12 @@ def get_requirements():
"Natural Language :: English",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Security",
"Topic :: Security :: Cryptography",
Expand Down
14 changes: 1 addition & 13 deletions test_vector_handlers/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
envlist =
# The test vectors depend on new features now,
# so until release we can only effectively test the local version of the ESDK.
py{27,34,35,36,37}-awses_local,
py{35,36,37,38,39}-awses_local,
# 1.2.0 and 1.2.max are being difficult because of attrs
bandit, doc8, readme, docs,
{flake8,pylint}{,-tests},
Expand Down Expand Up @@ -102,18 +102,6 @@ commands =
{posargs}
{[testenv:mypy-coverage]commands}

[testenv:mypy-py2]
# We only test 2.7, please upgrade
basepython = python2.7
deps = {[testenv:mypy-common]deps}
commands =
python -m mypy \
--py2 \
--linecoverage-report build \
src/awses_test_vectors/ \
{posargs}
{[testenv:mypy-coverage]commands}

# Linters
[testenv:flake8]
basepython = python3
Expand Down
19 changes: 1 addition & 18 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tox]
envlist =
py{27,34,35,36,37,38,39}-{local,integ,accept,examples}, nocmk,
py{35,36,37,38,39}-{local,integ,accept,examples}, nocmk,
bandit, doc8, readme, docs,
{flake8,pylint}{,-tests,-examples},
isort-check, black-check,
Expand Down Expand Up @@ -94,15 +94,6 @@ recreate = True
deps =
commands = {toxinidir}/test/freeze-upstream-requirements.sh

# Freeze for Python 2.7
[testenv:freeze-upstream-requirements-py27]
basepython = python2.7
sitepackages = {[testenv:freeze-upstream-requirements-base]sitepackages}
skip_install = {[testenv:freeze-upstream-requirements-base]skip_install}
recreate = {[testenv:freeze-upstream-requirements-base]recreate}
deps = {[testenv:freeze-upstream-requirements-base]deps}
commands = {[testenv:freeze-upstream-requirements-base]commands} test/upstream-requirements-py27.txt

# Freeze for Python 3.7
[testenv:freeze-upstream-requirements-py37]
basepython = python3.7
Expand All @@ -118,14 +109,6 @@ sitepackages = False
recreate = True
commands = {[testenv:base-command]commands} test/ -m local

# Test frozen upstream requirements for Python 2.7
[testenv:test-upstream-requirements-py27]
basepython = python2.7
deps = -rtest/upstream-requirements-py27.txt
sitepackages = {[testenv:test-upstream-requirements-base]sitepackages}
recreate = {[testenv:test-upstream-requirements-base]recreate}
commands = {[testenv:test-upstream-requirements-base]commands}

# Test frozen upstream requirements for Python 3.7
[testenv:test-upstream-requirements-py37]
basepython = python3.7
Expand Down

0 comments on commit 1332086

Please sign in to comment.