From 36e02008256cf98f9f9eb3b51926bb43346f1318 Mon Sep 17 00:00:00 2001 From: catronnc <127542022+catronnc@users.noreply.github.com> Date: Fri, 10 Mar 2023 16:42:25 -0500 Subject: [PATCH] Update cryptography version (#33) * Update cryptography version * Remove Python2 support --- README.md | 4 +- README.rst | 5 -- doc/source/README.rst | 5 -- doc/source/conf.py | 2 +- ec2instanceconnectcli/__init__.py | 2 +- ec2instanceconnectcli/py2py3.py | 85 ------------------------------- requirements.txt | 2 +- setup.cfg | 4 +- setup.py | 6 +-- 9 files changed, 6 insertions(+), 109 deletions(-) delete mode 100644 ec2instanceconnectcli/py2py3.py diff --git a/README.md b/README.md index 907eb90..6236390 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # AWS EC2 Instance Connect CLI This is a Python client for accessing EC2 instances via AWS EC2 Instance Connect. -This module supports Python 2.7.x and 3+. [This package is available on PyPI for pip installation](https://pypi.org/project/ec2instanceconnectcli/), ie, `pip install ec2instanceconnectcli` +This module supports Python 3.6.x+. [This package is available on PyPI for pip installation](https://pypi.org/project/ec2instanceconnectcli/), ie, `pip install ec2instanceconnectcli` ## Setup @@ -31,8 +31,6 @@ Unit tests can be run with standard pytest. They may be run, for example, by `python -m pytest` -For Python2, ensure **mock** is installed: `pip2 install mock`. - Also, for corrcting import when using virtualenv, you have to export PYTHONPATH by running: `export PYTHONPATH=$(pwd)` ## Generating Documentation diff --git a/README.rst b/README.rst index c2525be..f91f75f 100644 --- a/README.rst +++ b/README.rst @@ -10,11 +10,6 @@ This client supports all standard ssh operations with the `mssh` command and all The ec2-connect-cli package works on Python versions: -* 2.6.x and greater -* 2.7.x and greater -* 3.3.x and greater -* 3.4.x and greater -* 3.5.x and greater * 3.6.x and greater ------------ diff --git a/doc/source/README.rst b/doc/source/README.rst index c15807a..a77e19b 100644 --- a/doc/source/README.rst +++ b/doc/source/README.rst @@ -10,11 +10,6 @@ This client supports all standard ssh operations with the `mssh` command and all The ec2-connect-cli package works on Python versions: -* 2.6.x and greater -* 2.7.x and greater -* 3.3.x and greater -* 3.4.x and greater -* 3.5.x and greater * 3.6.x and greater ------------ diff --git a/doc/source/conf.py b/doc/source/conf.py index 2751dad..e738483 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -26,7 +26,7 @@ # The short X.Y version version = '1.0' # The full version, including alpha/beta/rc tags -release = '1.0.2' +release = '1.0.3' # -- General configuration --------------------------------------------------- diff --git a/ec2instanceconnectcli/__init__.py b/ec2instanceconnectcli/__init__.py index ed96722..41d2a95 100644 --- a/ec2instanceconnectcli/__init__.py +++ b/ec2instanceconnectcli/__init__.py @@ -17,7 +17,7 @@ """ import os -__version__ = '1.0.2' +__version__ = '1.0.3' EnvironmentVariables = { 'ca_bundle': ('ca_bundle', 'AWS_CA_BUNDLE', None, None), diff --git a/ec2instanceconnectcli/py2py3.py b/ec2instanceconnectcli/py2py3.py deleted file mode 100644 index 18d7cd2..0000000 --- a/ec2instanceconnectcli/py2py3.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. - -import sys - -__all__ = ['PY2', 'input', 'StringIO', 'BytesIO', 'ConfigParser', 'u'] - -PY2 = sys.version_info[0] < 3 - -if PY2: - input = raw_input - - try: - import cStringIO - - StringIO = cStringIO.StringIO - except ImportError: - import StringIO - - StringIO = StringIO.StringIO - - BytesIO = StringIO - - import ConfigParser - ConfigParser = ConfigParser - - def u(s, encoding='utf8'): - """ - Cast bytes or unicode to unicode - - :param s: unicode or bytes - :type s: bytearray or str - """ - if isinstance(s, str): - try: - return s.decode(encoding, errors='replace') - except: - return str(s) - elif isinstance(s, unicode): - return s - elif isinstance(s, buffer): - try: - return s.decode(encoding, errors='replace') - except: - return str(s) - else: - raise TypeError("Expected unicode or bytes, got %r" % s) - -else: - - input = input - - import io - StringIO = io.StringIO - BytesIO = io.BytesIO - - import configparser - ConfigParser = configparser - - def u(s, encoding='utf8'): - """ - Cast bytes or unicode to unicode - - :param s: unicode or bytes - :type s: bytearray or str - """ - if isinstance(s, bytes): - try: - return s.decode(encoding, errors='replace') - except: - return str(s) - elif isinstance(s, str): - return s - else: - raise TypeError("Expected unicode or bytes, got %r" % s) diff --git a/requirements.txt b/requirements.txt index bcb16d7..db2259b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ setuptools>=3.3 -cryptography>=1.9 +cryptography>=39.0.1 botocore>=1.12.179 pytest>=3.2.3 pytest-cov>=2.5.1 diff --git a/setup.cfg b/setup.cfg index 813f45e..4c5e889 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,10 +1,8 @@ [bdist_wheel] -# Flag indicating code works for both Python 2 and Python 3. -universal=1 [metadata] requires-dist= - cryptography>=1.9 + cryptography>=39.0.1 botocore>=1.12.179 [tool:pytest] diff --git a/setup.py b/setup.py index 268b1c8..54d9753 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def find_version(*file_paths): raise RuntimeError("Unable to find version string.") -requires = ['cryptography>=1.9', +requires = ['cryptography>=39.0.1', 'botocore>=1.12.179' ] @@ -50,11 +50,7 @@ def find_version(*file_paths): 'Operating System :: OS Independent', 'Operating System :: Unix', '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',