Skip to content

Commit

Permalink
Drop support for Python 3.7 (#156)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored May 29, 2023
2 parents 5d1e9ab + 39c3119 commit 8823ae4
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[flake8]
max_line_length = 88
max-line-length = 88
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["pypy3.9", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"]
python-version: ["pypy3.9", "3.8", "3.9", "3.10", "3.11", "3.12"]
os: [windows-latest, macos-latest, ubuntu-latest]

steps:
Expand All @@ -21,6 +21,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: pip
cache-dependency-path: pyproject.toml

Expand Down
17 changes: 10 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.4.0
hooks:
- id: pyupgrade
args: [--py37-plus]
args: [--py38-plus]

- repo: https://github.com/psf/black
rev: 23.3.0
Expand All @@ -26,33 +26,36 @@ repos:
rev: v1.10.0
hooks:
- id: python-check-blanket-noqa
- id: python-no-log-warn

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-json
- id: check-case-conflict
- id: check-merge-conflict
- id: check-json
- id: check-toml
- id: check-yaml
- id: requirements-txt-fixer
- id: end-of-file-fixer

- repo: https://github.com/tox-dev/pyproject-fmt
rev: 0.9.2
rev: 0.10.0
hooks:
- id: pyproject-fmt

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.12.2
rev: v0.13
hooks:
- id: validate-pyproject

- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.0.0
rev: 1.3.0
hooks:
- id: tox-ini-fmt

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.6
rev: v3.0.0-alpha.9-for-vscode
hooks:
- id: prettier
args: [--prose-wrap=always, --print-width=88]
Expand Down
32 changes: 15 additions & 17 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,30 +16,28 @@ keywords = [
]
license = {text = "MIT"}
authors = [{name = "Hugo van Kemenade"}]
requires-python = ">=3.7"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: End Users/Desktop",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
dynamic = [
"version",
]
dependencies = [
"httpx>=0.19",
'importlib-metadata; python_version < "3.8"',
"platformdirs",
"prettytable>=2.4",
"pytablewriter[html]>=0.63",
Expand Down
10 changes: 2 additions & 8 deletions src/norwegianblue/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import annotations

import datetime as dt
import importlib.metadata
import json
import logging
from functools import lru_cache
Expand All @@ -14,14 +15,7 @@

from norwegianblue import _cache

try:
# Python 3.8+
import importlib.metadata as importlib_metadata
except ImportError:
# Python 3.7
import importlib_metadata # type: ignore

__version__ = importlib_metadata.version(__name__)
__version__ = importlib.metadata.version(__name__)


__all__ = ["__version__"]
Expand Down
8 changes: 5 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[tox]
envlist =
requires =
tox>=4.2
env_list =
cog
lint
pins
py{py3, 312, 311, 310, 39, 38, 37}
py{py3, 312, 311, 310, 39, 38}

[testenv]
extras =
Expand All @@ -26,7 +28,7 @@ commands =
skip_install = true
deps =
pre-commit
passenv =
pass_env =
PRE_COMMIT_COLOR
commands =
pre-commit run --all-files --show-diff-on-failure
Expand Down

0 comments on commit 8823ae4

Please sign in to comment.