From bac09e38db9712f4cb2b7ca21f75a5555fc3caa6 Mon Sep 17 00:00:00 2001 From: Hal Wine Date: Thu, 24 Sep 2020 17:39:39 -0700 Subject: [PATCH] Move to py38 --- .pre-commit-config.yaml | 2 +- Makefile | 10 +++++----- aws/client.py | 6 +++--- docs/CodingConventions.rst | 3 +-- github/branches/conftest.py | 14 +++++++------- github/orgs/conftest.py | 12 ++++++------ github/orgs/retrieve_github_data.py | 12 ++++++------ requirements.txt | 3 +-- setup.py | 5 ++--- tox.ini | 2 +- 10 files changed, 33 insertions(+), 36 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b1c38db..1cbd603 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: rev: v2.7.2 hooks: - id: pyupgrade - args: ["--py36-plus"] + args: ["--py38-plus"] ## ## - repo: https://github.com/jumanjihouse/pre-commit-hooks ## ## rev: master # or specific git tag diff --git a/Makefile b/Makefile index 0e7b8da..265b3f2 100644 --- a/Makefile +++ b/Makefile @@ -7,11 +7,11 @@ AWS_PROFILE := default PYTEST_OPTS := '' -PYTHON_MIN_VERSION := 3.6 +PYTHON_MIN_VERSION := 3.8 PYTHON_VER_WARNING = $(warning Warning! Frost supports Python $(PYTHON_MIN_VERSION), \ - you're running $(shell python -V)) + you're running $(shell python3 -V)) PYTHON_VER_ERROR = $(error Frost supports Python $(PYTHON_MIN_VERSION), \ - you're running $(shell python -V)) + you're running $(shell python3 -V)) all: check_venv pytest @@ -25,7 +25,7 @@ check_venv: ifeq ($(VIRTUAL_ENV),) $(error "Run frost from a virtualenv (try 'make install && source venv/bin/activate')") else - python -V | grep $(PYTHON_MIN_VERSION) || true ; $(PYTHON_VER_WARNING) + python3 -V | grep $(PYTHON_MIN_VERSION) || true ; $(PYTHON_VER_WARNING) endif check_conftest_imports: @@ -46,7 +46,7 @@ clean-cache: check_venv clean-python: find . -type d -name venv -prune -o -type d -name __pycache__ -print0 | xargs -0 rm -rf -doc-build: +doc-build: type sphinx-build || { echo "please install sphinx to build docs"; false; } make -C docs html diff --git a/aws/client.py b/aws/client.py index 87a26a1..7e24ec1 100644 --- a/aws/client.py +++ b/aws/client.py @@ -12,7 +12,7 @@ SERVICES_WITHOUT_REGIONS = ["iam", "s3"] -@functools.lru_cache() +@functools.lru_cache def get_session(profile=None): """Returns a new or cached botocore session for the AWS profile.""" @@ -30,7 +30,7 @@ def get_session(profile=None): return botocore.session.Session(profile=profile) -@functools.lru_cache() +@functools.lru_cache def get_client(profile, region, service): """Returns a new or cached botocore service client for the AWS profile, region, and service. @@ -56,7 +56,7 @@ def get_available_regions(profile=None): return get_session(profile=profile).get_available_regions("ec2") -@functools.lru_cache() +@functools.lru_cache def get_available_services(profile=None): return get_session(profile=profile).get_available_services() diff --git a/docs/CodingConventions.rst b/docs/CodingConventions.rst index 6e7f448..4c371a2 100644 --- a/docs/CodingConventions.rst +++ b/docs/CodingConventions.rst @@ -15,5 +15,4 @@ Conventions in ``pytest.mark.parametrize`` contain sufficient information for downstream processing. -.. _doctest: https://docs.python.org/3.6/library/doctest.html - +.. _doctest: https://docs.python.org/3.8/library/doctest.html diff --git a/github/branches/conftest.py b/github/branches/conftest.py index 4fbdae5..f91eaa5 100755 --- a/github/branches/conftest.py +++ b/github/branches/conftest.py @@ -54,13 +54,13 @@ def repos_to_check() -> List[str]: ] # python 3.6 doesn't support capture_output - # status = subprocess.run(cmd, capture_output=True) - # fmt: off - status = subprocess.run( # nosec - cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE # nosec - ) - # fmt:on - # return as array of non-empty, unquoted, "lines" + status = subprocess.run(cmd, capture_output=True) # nosec + ## ## # fmt: off + ## ## status = subprocess.run( # nosec + ## ## cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE # nosec + ## ## ) + ## ## # fmt:on + ## ## # return as array of non-empty, unquoted, "lines" return [ x.translate({ord('"'): None, ord("'"): None}) for x in status.stdout.decode("utf-8").split("\n") diff --git a/github/orgs/conftest.py b/github/orgs/conftest.py index a8179d1..bd39093 100755 --- a/github/orgs/conftest.py +++ b/github/orgs/conftest.py @@ -47,12 +47,12 @@ def orgs_to_check() -> Set[str]: ] # python 3.6 doesn't support capture_output - # status = subprocess.run(cmd, capture_output=True) - # fmt: off - status = subprocess.run( # nosec - cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE # nosec - ) - # fmt:on + status = subprocess.run(cmd, capture_output=True) # nosec + ## ## # fmt: off + ## ## status = subprocess.run( # nosec + ## ## cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE # nosec + ## ## ) + ## ## # fmt:on assert not status.stderr.decode("utf-8") # return as array of non-empty, unquoted, "lines" return { diff --git a/github/orgs/retrieve_github_data.py b/github/orgs/retrieve_github_data.py index b986297..39fde70 100755 --- a/github/orgs/retrieve_github_data.py +++ b/github/orgs/retrieve_github_data.py @@ -202,12 +202,12 @@ def _orgs_to_check() -> Set[str]: ] # python 3.6 doesn't support capture_output - # status = subprocess.run(cmd, capture_output=True) - # fmt: off - status = subprocess.run( # nosec - cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE # nosec - ) - # fmt:on + status = subprocess.run(cmd, capture_output=True) # nosec + ## ## # fmt: off + ## ## status = subprocess.run( # nosec + ## ## cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE # nosec + ## ## ) + ## ## # fmt:on assert not status.stderr.decode("utf-8") # return as array of non-empty, unquoted, "lines" return { diff --git a/requirements.txt b/requirements.txt index 01c36e5..c67c92d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,9 +7,8 @@ pytest-metadata==1.8.0 pytest==3.10.1 python-dateutil==2.7.5 git+https://github.com/hwine/python-herokuadmintools.git#egg=herokuadmintools -pre-commit==1.17.0 +#pre-commit==1.17.0 ruamel.yaml==0.15.85 wheel==0.33.1 sgqlc==11.0 -dataclasses==0.6 # 0.7 won't work in python > 3.6 (it's built in & not needed) argcomplete==1.12.0 diff --git a/setup.py b/setup.py index 956b925..3f2444a 100644 --- a/setup.py +++ b/setup.py @@ -18,8 +18,7 @@ "Natural Language :: English", "License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)", "Operating System :: OS Independent", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", ], - python_requires=">=3.6", + python_requires=">=3.8", ) diff --git a/tox.ini b/tox.ini index e2d2108..9d71f81 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py38 +envlist = py38 isolated_build = True skipsdist = True