Skip to content

Commit

Permalink
Move to py38
Browse files Browse the repository at this point in the history
  • Loading branch information
Hal Wine committed Sep 25, 2020
1 parent 8127155 commit bac09e3
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 36 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions aws/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""

Expand All @@ -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.
Expand All @@ -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()

Expand Down
3 changes: 1 addition & 2 deletions docs/CodingConventions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 7 additions & 7 deletions github/branches/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 6 additions & 6 deletions github/orgs/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions github/orgs/retrieve_github_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 2 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py36,py38
envlist = py38
isolated_build = True
skipsdist = True

Expand Down

0 comments on commit bac09e3

Please sign in to comment.