Skip to content

Commit

Permalink
BLD: drop support for CPython 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Feb 12, 2023
1 parent 4bb8fa0 commit a318a73
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.11'
- name: Install build dependencies
run: python -m pip install build wheel
- name: Build distributions
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ jobs:
os:
- ubuntu-latest
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
Expand Down Expand Up @@ -109,7 +108,7 @@ jobs:
with:
# Match minimal supported Python version
# to make sure we're not using unparseable syntax
python-version: '3.7'
python-version: '3.8'

- name: Build
run: |
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
]
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"rich>=10.13.0",
"importlib-metadata;python_version < \"3.8\"",
"stdlib-list>=0.8;python_version < \"3.10\"",
]

Expand Down Expand Up @@ -53,7 +52,7 @@ exclude = [
namespaces = false

[tool.ruff]
target-version = "py37" # https://github.com/charliermarsh/ruff/issues/2039
target-version = "py38" # https://github.com/charliermarsh/ruff/issues/2039
exclude = ["*__init__.py"]
ignore = ["E501"]
select = [
Expand Down Expand Up @@ -100,7 +99,7 @@ omit = [
parallel = true

[tool.mypy]
python_version = "3.7"
python_version = "3.8"
show_error_codes = true
pretty = true
warn_return_any = true
Expand Down
5 changes: 1 addition & 4 deletions wxc/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,7 @@ def get_version(package_name: str) -> str:
continue
return retv

if sys.version_info >= (3, 8):
import importlib.metadata as md
else:
import importlib_metadata as md
import importlib.metadata as md

try:
return str(md.version(package_name))
Expand Down
6 changes: 2 additions & 4 deletions wxc/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ def main(argv: list[str] | None = None) -> int:
# this is a simple module request
# let's try to get the result without actually importing it first
if args.version:
if sys.version_info >= (3, 8):
import importlib.metadata as md
else:
import importlib_metadata as md
import importlib.metadata as md

try:
version = md.version(args.name)
except md.PackageNotFoundError:
Expand Down

0 comments on commit a318a73

Please sign in to comment.