Skip to content

Commit 88b9ff1

Browse files
hugovkhukkin
andauthored
Add support for Python 3.11 and 3.12, drop EOL 3.7 (#15)
* Bump GitHub Actions * Update pre-commit * Add noqa for: A004 import statement "format" is shadowing a Python builtin * Add support for Python 3.11 and 3.12 * Drop support for EOL Python 3.7 * Update .github/workflows/tests.yaml --------- Co-authored-by: Taneli Hukkinen <3275109+hukkin@users.noreply.github.com>
1 parent 3ac2cfd commit 88b9ff1

6 files changed

Lines changed: 27 additions & 25 deletions

File tree

.github/workflows/tests.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
17-
- uses: actions/setup-python@v2
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v4
1818
with:
1919
python-version: '3.8'
2020

@@ -32,17 +32,18 @@ jobs:
3232
runs-on: ${{ matrix.os }}
3333
strategy:
3434
matrix:
35-
python-version: ['pypy-3.7', '3.7', '3.8', '3.9', '3.10', '3.11-dev']
35+
python-version: ['pypy-3.10', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13-dev']
3636
os: [ubuntu-latest, macos-latest, windows-latest]
37-
continue-on-error: ${{ matrix.python-version == '3.11-dev' }}
37+
continue-on-error: ${{ matrix.python-version == '3.13-dev' }}
3838

3939
steps:
40-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v4
4141

4242
- name: Set up Python ${{ matrix.python-version }}
43-
uses: actions/setup-python@v2
43+
uses: actions/setup-python@v4
4444
with:
4545
python-version: ${{ matrix.python-version }}
46+
allow-prereleases: true
4647

4748
- name: Install test deps
4849
run: |
@@ -55,7 +56,7 @@ jobs:
5556
5657
- name: Report coverage
5758
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
58-
uses: codecov/codecov-action@v1
59+
uses: codecov/codecov-action@v3
5960

6061
allgood:
6162
runs-on: ubuntu-latest
@@ -71,10 +72,10 @@ jobs:
7172
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
7273
runs-on: ubuntu-latest
7374
steps:
74-
- uses: actions/checkout@v2
75-
- uses: actions/setup-python@v2
75+
- uses: actions/checkout@v4
76+
- uses: actions/setup-python@v4
7677
with:
77-
python-version: '3.7'
78+
python-version: '3.x'
7879
- name: Install build and publish tools
7980
run: |
8081
pip install build twine

.pre-commit-config.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
repos:
22
- repo: https://github.com/executablebooks/mdformat
3-
rev: 82f84976fc57d5ae61cbf2d457a26a89d4b4eef4 # frozen: 0.7.16
3+
rev: 08fba30538869a440b5059de90af03e3502e35fb # frozen: 0.7.17
44
hooks:
55
- id: mdformat
66
additional_dependencies:
77
- mdformat-gfm
88
- repo: https://github.com/asottile/yesqa
9-
rev: 265e9ff7c83add4949f81bb5fe14f4a743ffb04c # frozen: v1.4.0
9+
rev: f2ae90cf9e1661ade79d0881186ce4fd7ba6ee79 # frozen: v1.5.0
1010
hooks:
1111
- id: yesqa
1212
additional_dependencies:
@@ -17,16 +17,16 @@ repos:
1717
rev: dbf82f2dd09ae41d9355bcd7ab69187a19e6bf2f # frozen: 5.12.0
1818
hooks:
1919
- id: isort
20-
- repo: https://github.com/psf/black
21-
rev: b0d1fba7ac3be53c71fb0d3211d911e629f8aecb # frozen: 23.1.0
20+
- repo: https://github.com/psf/black-pre-commit-mirror
21+
rev: 34974913abb598ee76541db1900f24fde7dd1d76 # frozen: 23.11.0
2222
hooks:
2323
- id: black
2424
- repo: https://github.com/PyCQA/docformatter
25-
rev: 11d9a03865ae1f859d56517daec72e4f9f2401f0 # frozen: v1.5.1
25+
rev: dfefe062799848234b4cd60b04aa633c0608025e # frozen: v1.7.5
2626
hooks:
2727
- id: docformatter
2828
- repo: https://github.com/pre-commit/pre-commit-hooks
29-
rev: f71fa2c1f9cf5cb705f73dffe4b21f7c61470ba9 # frozen: v4.4.0
29+
rev: c4a0b883114b00d8d76b479c820ce7950211c99b # frozen: v4.5.0
3030
hooks:
3131
- id: check-yaml
3232
- repo: https://github.com/pre-commit/pygrep-hooks
@@ -36,15 +36,15 @@ repos:
3636
- id: python-check-blanket-noqa
3737
- id: python-check-blanket-type-ignore
3838
- repo: https://github.com/PyCQA/flake8
39-
rev: c838a5e98878f17889cfce311e1406d252f87ec5 # frozen: 6.0.0
39+
rev: 10f4af6dbcf93456ba7df762278ae61ba3120dc6 # frozen: 6.1.0
4040
hooks:
4141
- id: flake8
4242
additional_dependencies:
4343
- flake8-bugbear
4444
- flake8-builtins
4545
- flake8-comprehensions
4646
- repo: https://github.com/pre-commit/mirrors-mypy
47-
rev: b176ead5d5b92b1d4e651c118017f8fd32de424a # frozen: v1.1.1
47+
rev: 4c8a8c7d5eb892ab5a6e23e11f36dbba5874d40c # frozen: v1.7.0
4848
hooks:
4949
- id: mypy
5050
args: ["--scripts-are-modules"]

pyproject.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,19 @@ authors = [
1010
{ name = "Taneli Hukkinen", email = "hukkin@users.noreply.github.com" },
1111
]
1212
license = { file = "LICENSE" }
13-
requires-python = ">=3.7"
13+
requires-python = ">=3.8"
1414
readme = "README.md"
1515
classifiers = [
1616
"License :: OSI Approved :: MIT License",
1717
"Operating System :: MacOS",
1818
"Operating System :: Microsoft :: Windows",
1919
"Operating System :: POSIX :: Linux",
2020
"Programming Language :: Python :: 3 :: Only",
21-
"Programming Language :: Python :: 3.7",
2221
"Programming Language :: Python :: 3.8",
2322
"Programming Language :: Python :: 3.9",
2423
"Programming Language :: Python :: 3.10",
24+
"Programming Language :: Python :: 3.11",
25+
"Programming Language :: Python :: 3.12",
2526
"Programming Language :: Python :: Implementation :: CPython",
2627
"Programming Language :: Python :: Implementation :: PyPy",
2728
"Topic :: Software Development :: Libraries :: Python Modules",
@@ -55,10 +56,10 @@ xfail_strict = true
5556
legacy_tox_ini = '''
5657
[tox]
5758
# Only run pytest envs when no args given to tox
58-
envlist = py{37,38,39,310}
59+
envlist = py{38,39,310,311,312}
5960
isolated_build = True
6061
61-
[testenv:py{37,38,39,310}]
62+
[testenv:py{38,39,310,311,312}]
6263
description = run tests
6364
deps = -r tests/requirements.txt
6465
commands =

src/mdurl/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313

1414
from mdurl._decode import DECODE_COMPONENT_CHARS, DECODE_DEFAULT_CHARS, decode
1515
from mdurl._encode import ENCODE_COMPONENT_CHARS, ENCODE_DEFAULT_CHARS, encode
16-
from mdurl._format import format
16+
from mdurl._format import format # noqa: A004
1717
from mdurl._parse import url_parse as parse
1818
from mdurl._url import URL

src/mdurl/_parse.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def __init__(self) -> None:
113113
self.search: str | None = None
114114
self.pathname: str | None = None
115115

116-
def parse(self, url: str, slashes_denote_host: bool) -> "MutableURL":
116+
def parse(self, url: str, slashes_denote_host: bool) -> MutableURL:
117117
lower_proto = ""
118118
slashes = False
119119
rest = url

tests/test_format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import pytest
22

3-
from mdurl import format, parse
3+
from mdurl import format, parse # noqa: A004
44
from tests.fixtures.url import PARSED as FIXTURES
55

66

0 commit comments

Comments
 (0)