Skip to content

Commit 4732d44

Browse files
committed
Modernize CI, switch to Ruff for formatting, drop Python 3.9
Also drop PyPy and Coverage
1 parent b7eda33 commit 4732d44

File tree

23 files changed

+195
-219
lines changed

23 files changed

+195
-219
lines changed

.codecov.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/autofix.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@ jobs:
66
style:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v4
10-
- name: Setup Python
11-
uses: actions/setup-python@v5
9+
- name: Download source
10+
uses: actions/checkout@v6
11+
- name: Install Python
12+
uses: actions/setup-python@v6
1213
with:
13-
python-version: '3.11'
14-
- name: Install Python dependencies
14+
python-version: '3.13'
15+
- name: Install Hatch
1516
run: |
16-
python -m pip install --upgrade hatch
17+
pip install hatch
18+
- name: Install dependencies
19+
run: |
20+
hatch run style:pip freeze
1721
- name: Fix code style
18-
run: hatch run style:fix --fix-only
22+
run: |
23+
hatch run style:fix --fix-only
1924
- name: Check if any edits are necessary
20-
run: git diff --color --exit-code
25+
run: |
26+
git diff --color --exit-code
2127
- name: Apply automatic fixes using pre-commit-ci-lite
2228
if: failure() && github.event_name == 'pull_request'
23-
uses: pre-commit-ci/lite-action@v1.0.1
29+
uses: pre-commit-ci/lite-action@5d6cc0eb514c891a40562a58a8e71576c5c7fb43 # v1.1.0

.github/workflows/ci.yml

Lines changed: 57 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,87 @@ on:
44
pull_request:
55
schedule:
66
- cron: '0 6 * * 6'
7+
defaults:
8+
run:
9+
shell: bash
710
jobs:
811
test:
912
strategy:
1013
fail-fast: false
1114
matrix:
12-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9-v7.x']
13-
os: [ubuntu-latest, windows-latest, macos-latest]
1415
include:
15-
- python-version: pypy-3.9-v7.x
16-
py: pypy3
17-
# Just to slim down the test matrix:
18-
exclude:
19-
- python-version: '3.9'
16+
- python: '^3.14'
17+
os: ubuntu-latest
18+
- python: '3.14'
19+
os: windows-latest
20+
- python: '3.14'
2021
os: macos-latest
21-
- python-version: '3.9'
22+
- python: '3.13'
23+
os: ubuntu-latest
24+
- python: '3.13'
2225
os: windows-latest
23-
- python-version: '3.10'
26+
- python: '3.12'
27+
os: macos-latest
28+
- python: '3.12'
2429
os: ubuntu-latest
25-
- python-version: '3.11'
30+
- python: '3.12'
31+
os: windows-latest
32+
- python: '3.11'
33+
os: ubuntu-latest
34+
- python: '3.11'
2635
os: macos-latest
27-
- python-version: '3.11'
36+
- python: '3.10'
2837
os: windows-latest
29-
runs-on: ${{ matrix.os }}
38+
- python: '3.10'
39+
os: ubuntu-latest
40+
versions: minimal
41+
runs-on: ${{matrix.os}}
3042
steps:
31-
- uses: actions/checkout@v4
32-
- name: Setup Python ${{ matrix.python-version }}
33-
uses: actions/setup-python@v5
43+
- name: Download source
44+
uses: actions/checkout@v6
45+
- name: Install Python
46+
uses: actions/setup-python@v6
3447
with:
35-
python-version: ${{ matrix.python-version }}
48+
python-version: ${{matrix.python}}
49+
- name: Pin to lowest versions
50+
if: matrix.versions == 'minimal'
51+
run: |
52+
sed -i -E 's/#min //; s/\b >=([0-9])/ ==\1/' pyproject.toml
53+
- name: Install Hatch
54+
run: |
55+
pip install hatch
3656
- name: Install dependencies
3757
run: |
38-
python -m pip install --upgrade hatch
58+
hatch run test:pip freeze
3959
- name: Run tests
4060
run: |
41-
hatch run +py=${{ matrix.py || matrix.python-version }} test:with-coverage
61+
hatch run +py=${{ matrix.py || matrix.python-version }} test:test
4262
- name: Run integration tests
4363
run: |
4464
hatch run +py=${{ matrix.py || matrix.python-version }} integration:test
45-
shell: bash
46-
- name: Upload Codecov Results
47-
if: success()
48-
uses: codecov/codecov-action@v3
49-
with:
50-
file: ./coverage.xml
51-
flags: unittests
52-
name: ${{ matrix.os }}/${{ matrix.python-version }}
53-
fail_ci_if_error: false
54-
55-
lint:
65+
style:
5666
runs-on: ubuntu-latest
5767
steps:
58-
- uses: actions/checkout@v4
59-
- name: Setup Python
60-
uses: actions/setup-python@v5
68+
- name: Download source
69+
uses: actions/checkout@v6
70+
- name: Install Python
71+
uses: actions/setup-python@v6
6172
with:
62-
python-version: '3.11'
63-
- name: Install Python dependencies
73+
python-version: '3.13'
74+
- name: Install Hatch
6475
run: |
65-
python -m pip install --upgrade hatch
66-
- name: Setup Node
67-
uses: actions/setup-node@v4
76+
pip install hatch
77+
- name: Install Node
78+
uses: actions/setup-node@v6
6879
with:
69-
node-version: 20
80+
node-version: 24
81+
- name: Install dependencies
82+
run: |
83+
hatch run style:pip freeze
84+
hatch run types:pip freeze
7085
- name: Check with ruff
7186
if: always()
72-
run: hatch run style:lint
87+
run: hatch run style:check
7388
- name: Check with mypy
7489
if: always()
7590
run: hatch run types:check
@@ -86,11 +101,11 @@ jobs:
86101
package:
87102
runs-on: ubuntu-latest
88103
steps:
89-
- uses: actions/checkout@v4
104+
- uses: actions/checkout@v6
90105
- name: Setup Python
91-
uses: actions/setup-python@v5
106+
uses: actions/setup-python@v6
92107
with:
93-
python-version: '3.11'
108+
python-version: '3.13'
94109
- name: Install dependencies
95110
run: pip install -U build
96111
- name: Build package

.github/workflows/deploy-docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy docs
2+
on:
3+
push:
4+
pull_request:
5+
schedule:
6+
- cron: '0 6 * * 6'
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Download source
12+
uses: actions/checkout@v6
13+
- name: Install Python
14+
uses: actions/setup-python@v6
15+
with:
16+
python-version: '3.13'
17+
- name: Install dependencies
18+
run: pip install --no-deps -r requirements/requirements-docs.txt && pip install .
19+
- name: Build site
20+
run: mkdocs build --strict
21+
- name: Upload to GitHub Pages
22+
uses: actions/upload-pages-artifact@v4
23+
with:
24+
path: site
25+
deploy:
26+
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch
27+
needs: build
28+
permissions:
29+
pages: write
30+
id-token: write
31+
runs-on: ubuntu-latest
32+
steps:
33+
- name: Deploy to GitHub Pages
34+
id: deployment
35+
uses: actions/deploy-pages@v4
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}

.github/workflows/deploy-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ jobs:
99
id-token: write
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v4
12+
- uses: actions/checkout@v6
1313
- name: Setup Python
14-
uses: actions/setup-python@v5
14+
uses: actions/setup-python@v6
1515
with:
16-
python-version: '3.11'
16+
python-version: '3.13'
1717
- name: Install dependencies
1818
run: pip install -U build
1919
- name: Build package

.github/workflows/docs.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
55
[![PyPI Version][pypi-v-image]][pypi-v-link]
66
[![Build Status][GHAction-image]][GHAction-link]
7-
[![Coverage Status][codecov-image]][codecov-link]
87

98
ProperDocs is a **fast**, **simple** and **downright gorgeous** static site
109
generator that's geared towards building project documentation. Documentation
@@ -58,8 +57,6 @@ Everyone interacting in the ProperDocs project's codebases, issue trackers, and
5857
discussion forums is expected to follow the [PyPA Code of Conduct].
5958

6059
<!-- Badges -->
61-
[codecov-image]: https://codecov.io/github/properdocs/properdocs/coverage.svg?branch=master
62-
[codecov-link]: https://codecov.io/github/properdocs/properdocs?branch=master
6360
[pypi-v-image]: https://img.shields.io/pypi/v/properdocs.svg
6461
[pypi-v-link]: https://pypi.org/project/properdocs/
6562
[GHAction-image]: https://github.com/properdocs/properdocs/actions/workflows/ci.yml/badge.svg

properdocs/__main__.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,12 @@
1212

1313
import click
1414

15-
from properdocs import replacement # noqa: F401
16-
from properdocs import __version__, config, utils
15+
from properdocs import (
16+
__version__,
17+
config,
18+
replacement, # noqa: F401
19+
utils,
20+
)
1721

1822
if sys.platform.startswith("win"):
1923
try:
@@ -122,16 +126,13 @@ def __del__(self):
122126
reload_help = "Enable the live reloading in the development server (this is the default)"
123127
no_reload_help = "Disable the live reloading in the development server."
124128
serve_dirty_help = "Only re-build files that have changed."
125-
serve_clean_help = (
126-
"Build the site without any effects of `properdocs serve` - pure `properdocs build`, then serve."
127-
)
129+
serve_clean_help = "Build the site without any effects of `properdocs serve` - pure `properdocs build`, then serve."
128130
commit_message_help = (
129131
"A commit message to use when committing to the "
130132
"GitHub Pages remote branch. Commit {sha} and ProperDocs {version} are available as expansions"
131133
)
132134
remote_branch_help = (
133-
"The remote branch to commit to for GitHub Pages. This "
134-
"overrides the value specified in config"
135+
"The remote branch to commit to for GitHub Pages. This overrides the value specified in config"
135136
)
136137
remote_name_help = (
137138
"The remote name to commit to for GitHub Pages. This overrides the value specified in config"
@@ -243,7 +244,7 @@ def callback(ctx, param, value):
243244
__version__,
244245
'-V',
245246
'--version',
246-
message=f'%(prog)s, version %(version)s from { PKG_DIR } (Python { PYTHON_VERSION })',
247+
message=f'%(prog)s, version %(version)s from {PKG_DIR} (Python {PYTHON_VERSION})',
247248
)
248249
@common_options
249250
@color_option

properdocs/commands/build.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
from properdocs.structure.files import File, Files, InclusionLevel, get_files, set_exclusions
1717
from properdocs.structure.nav import Navigation, get_navigation
1818
from properdocs.structure.pages import Page
19-
from properdocs.utils import DuplicateFilter # noqa: F401 - legacy re-export
20-
from properdocs.utils import templates
19+
from properdocs.utils import (
20+
DuplicateFilter, # noqa: F401 - legacy re-export
21+
templates,
22+
)
2123

2224
if TYPE_CHECKING:
2325
from properdocs.config.defaults import ProperDocsConfig

properdocs/config/base.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,10 @@ def __set_name__(self, owner, name):
8686
self._name = name
8787

8888
@overload
89-
def __get__(self, obj: Config, type=None) -> T:
90-
...
89+
def __get__(self, obj: Config, type=None) -> T: ...
9190

9291
@overload
93-
def __get__(self, obj, type=None) -> BaseConfigOption:
94-
...
92+
def __get__(self, obj, type=None) -> BaseConfigOption: ...
9593

9694
def __get__(self, obj, type=None):
9795
if not isinstance(obj, Config):

0 commit comments

Comments
 (0)