Skip to content

Commit bb04265

Browse files
authored
Merge pull request #85 from kurtmckee/release-0.20
Release 0.20
2 parents 1910c45 + 57328b6 commit bb04265

File tree

86 files changed

+3348
-1004
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3348
-1004
lines changed

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[{*.yaml,*.yml}]
12+
indent_size = 2

.github/FUNDING.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github: "kurtmckee"
2+
ko_fi: "kurtmckee"

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
groups:
8+
github-actions:
9+
patterns:
10+
- "*"

.github/workflows/test.yaml

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
name: "Test"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "main"
8+
- "releases"
9+
10+
jobs:
11+
build:
12+
name: "Build wheel"
13+
runs-on: "ubuntu-latest"
14+
outputs:
15+
wheel-filename: "${{ steps.get-filename.outputs.wheel-filename }}"
16+
steps:
17+
- name: "Checkout branch"
18+
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
19+
20+
- name: "Setup Python"
21+
id: "setup-python"
22+
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
23+
with:
24+
python-version: "3.12"
25+
26+
- name: "Build the project"
27+
run: "pip wheel ."
28+
29+
- name: "Identify the wheel filename"
30+
id: "get-filename"
31+
run: |
32+
echo "wheel-filename=$(find listparser-*.whl | head -n 1)" >> "$GITHUB_OUTPUT"
33+
34+
- name: "Upload the build artifact"
35+
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
36+
with:
37+
name: "listparser-${{ github.sha }}.whl"
38+
path: "${{ steps.get-filename.outputs.wheel-filename }}"
39+
retention-days: 1
40+
41+
test:
42+
name: "Test on ${{ matrix.run.os.name }}"
43+
runs-on: "${{ matrix.run.os.id }}"
44+
needs: "build"
45+
46+
strategy:
47+
matrix:
48+
run:
49+
- os:
50+
id: "ubuntu-latest"
51+
name: "Ubuntu"
52+
pythons: |
53+
pypy3.9
54+
3.8
55+
3.9
56+
3.10
57+
3.11
58+
3.12
59+
tox-environments:
60+
- "py312-http-lxml"
61+
- "py311-http-lxml"
62+
- "py310-http-lxml"
63+
- "py39-http-lxml"
64+
- "py38-http-lxml"
65+
- "pypy39"
66+
67+
# Test lowest and highest versions on Windows.
68+
- os:
69+
id: "windows-latest"
70+
name: "Windows"
71+
pythons: |
72+
3.8
73+
3.11
74+
tox-environments:
75+
- "py38"
76+
- "py311"
77+
78+
# Test lowest and highest versions on Mac.
79+
- os:
80+
name: "MacOS"
81+
id: "macos-latest"
82+
pythons: |
83+
3.8
84+
3.11
85+
tox-environments:
86+
- "py38"
87+
- "py311"
88+
89+
steps:
90+
# The week number is used for cache-busting.
91+
- name: "Identify week number"
92+
shell: "bash"
93+
run: "date +'%V' > week-number.txt"
94+
95+
- name: "Checkout branch"
96+
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
97+
98+
- name: "Setup Pythons"
99+
id: "setup-python"
100+
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
101+
with:
102+
python-version: "${{ matrix.run.pythons }}"
103+
allow-prereleases: true
104+
105+
- name: "Restore cache"
106+
id: "restore-cache"
107+
uses: "actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319" # v4.0.1
108+
with:
109+
path: |
110+
.tox/
111+
.venv/
112+
key: "test-os=${{ matrix.run.os.id }}-hash=${{ hashFiles('.github/workflows/test.yaml', 'pyproject.toml', 'tox.ini', 'week-number.txt', 'requirements/*/*.txt') }}"
113+
114+
- name: "Identify venv path"
115+
shell: "bash"
116+
run: |
117+
echo 'venv-path=${{ runner.os == 'Windows' && '.venv/Scripts' || '.venv/bin' }}' >> "$GITHUB_ENV"
118+
119+
- name: "Create a virtual environment"
120+
if: "steps.restore-cache.outputs.cache-hit == false"
121+
run: |
122+
python -m venv .venv
123+
${{ env.venv-path }}/python -m pip install --upgrade pip setuptools wheel
124+
${{ env.venv-path }}/pip install tox
125+
126+
- name: "Download the build artifact"
127+
uses: "actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85" # v4.1.3
128+
with:
129+
name: "listparser-${{ github.sha }}.whl"
130+
131+
- name: "Test"
132+
run: >
133+
${{ env.venv-path }}/tox run
134+
--installpkg "${{ needs.build.outputs.wheel-filename }}"
135+
-e ${{ join(matrix.run.tox-environments, ',') }}
136+
137+
- name: "Upload coverage data files"
138+
uses: "actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3" # v4.3.1
139+
with:
140+
name: "coverage-data-files-${{ matrix.run.os.id }}"
141+
path: ".coverage.*"
142+
retention-days: 1
143+
144+
coverage:
145+
name: "Calculate code coverage"
146+
needs: "test"
147+
runs-on: "ubuntu-latest"
148+
steps:
149+
- name: "Checkout branch"
150+
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
151+
152+
- name: "Setup Pythons"
153+
id: "setup-python"
154+
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
155+
with:
156+
python-version: "3.12"
157+
158+
- name: "Restore cache"
159+
id: "restore-cache"
160+
uses: "actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319" # v4.0.1
161+
with:
162+
path: ".venv/"
163+
key: "coverage-hash=${{ hashFiles('.github/workflows/test.yaml', 'pyproject.toml', 'week-number.txt', 'requirements/*/*.txt') }}"
164+
165+
- name: "Create a virtual environment"
166+
if: "steps.restore-cache.outputs.cache-hit == false"
167+
run: |
168+
python -m venv .venv
169+
.venv/bin/python -m pip install --upgrade pip setuptools wheel
170+
.venv/bin/python -m pip install coverage[toml]
171+
172+
- name: "Download coverage data files"
173+
uses: "actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85" # v4.1.3
174+
with:
175+
pattern: "coverage-data-files-*"
176+
merge-multiple: true
177+
178+
- name: "Calculate coverage"
179+
run: |
180+
.venv/bin/coverage combine
181+
.venv/bin/coverage report
182+
183+
quality:
184+
name: "Quality"
185+
runs-on: "ubuntu-latest"
186+
needs: "build"
187+
steps:
188+
# The week number is used for cache-busting.
189+
- name: "Identify week number"
190+
run: "date +'%V' > week-number.txt"
191+
192+
- name: "Checkout branch"
193+
uses: "actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11" # v4.1.1
194+
195+
- name: "Setup Pythons"
196+
id: "setup-python"
197+
uses: "actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c" # v5.0.0
198+
with:
199+
python-version: "3.12"
200+
201+
- name: "Restore cache"
202+
id: "restore-cache"
203+
uses: "actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319" # v4.0.1
204+
with:
205+
path: |
206+
.mypy_cache/
207+
.tox/
208+
.venv/
209+
key: "lint-hash=${{ hashFiles('.github/workflows/test.yaml', 'pyproject.toml', 'tox.ini', 'week-number.txt', 'requirements/*/*.txt') }}"
210+
211+
- name: "Create a virtual environment"
212+
if: "steps.restore-cache.outputs.cache-hit == false"
213+
run: |
214+
python -m venv .venv
215+
.venv/bin/python -m pip install --upgrade pip setuptools wheel
216+
.venv/bin/pip install tox
217+
218+
- name: "Download the build artifact"
219+
uses: "actions/download-artifact@87c55149d96e628cc2ef7e6fc2aab372015aec85" # v4.1.3
220+
with:
221+
name: "listparser-${{ github.sha }}.whl"
222+
223+
- name: "Lint type annotations"
224+
run: >
225+
.venv/bin/tox run
226+
--installpkg "${{ needs.build.outputs.wheel-filename }}"
227+
-e mypy
228+
229+
- name: "Lint documentation"
230+
run: ".venv/bin/tox run -e docs"

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ build
77
listparser.egg-info/
88
.cache
99
htmlcov/
10-
.coverage
11-
venv/
10+
.coverage*
1211
.idea/
1312
.venv/
14-
poetry.lock
13+
/poetry.lock

.pre-commit-config.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
ci:
2+
autoupdate_schedule: "quarterly"
3+
4+
default_language_version:
5+
python: "python3.12"
6+
7+
repos:
8+
- repo: "meta"
9+
hooks:
10+
- id: "check-hooks-apply"
11+
- id: "check-useless-excludes"
12+
13+
- repo: "https://github.com/pre-commit/pre-commit-hooks"
14+
rev: "v4.5.0"
15+
hooks:
16+
- id: "check-added-large-files"
17+
- id: "check-merge-conflict"
18+
- id: "check-yaml"
19+
- id: "end-of-file-fixer"
20+
- id: "mixed-line-ending"
21+
args:
22+
- "--fix=lf"
23+
- id: "trailing-whitespace"
24+
25+
- repo: "https://github.com/asottile/pyupgrade"
26+
rev: "v3.15.2"
27+
hooks:
28+
- id: "pyupgrade"
29+
name: "Enforce Python 3.8+ idioms"
30+
args:
31+
- "--py38-plus"
32+
33+
- repo: "https://github.com/psf/black-pre-commit-mirror"
34+
rev: "24.3.0"
35+
hooks:
36+
- id: "black"
37+
38+
- repo: "https://github.com/pycqa/isort"
39+
rev: "5.13.2"
40+
hooks:
41+
- id: "isort"
42+
43+
- repo: "https://github.com/pycqa/flake8"
44+
rev: "7.0.0"
45+
hooks:
46+
- id: "flake8"
47+
additional_dependencies:
48+
- "flake8-bugbear==24.2.6"
49+
50+
- repo: "https://github.com/editorconfig-checker/editorconfig-checker.python"
51+
rev: "2.7.3"
52+
hooks:
53+
- id: "editorconfig-checker"
54+
55+
- repo: "https://github.com/python-jsonschema/check-jsonschema"
56+
rev: "0.28.0"
57+
hooks:
58+
- id: "check-dependabot"
59+
- id: "check-github-workflows"
60+
- id: "check-readthedocs"
61+
62+
- repo: "https://github.com/rhysd/actionlint"
63+
rev: "v1.6.27"
64+
hooks:
65+
- id: "actionlint"
66+
67+
- repo: "https://github.com/kurtmckee/pre-commit-hooks"
68+
rev: "v0.1.1"
69+
hooks:
70+
- id: "verify-consistent-pyproject-toml-python-requirements"

.readthedocs.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Configure ReadTheDocs.
2+
3+
version: 2
4+
5+
build:
6+
os: "ubuntu-22.04"
7+
tools:
8+
python: "3.12"
9+
10+
python:
11+
install:
12+
- requirements: "requirements/docs/requirements.txt"
13+
14+
sphinx:
15+
configuration: "docs/conf.py"
16+
fail_on_warning: true

0 commit comments

Comments
 (0)