Skip to content

Commit 82b4b28

Browse files
committed
update(chore): switch from setup.* to pyproject.toml
1 parent 457eece commit 82b4b28

19 files changed

+301
-305
lines changed

.github/labeler.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ ci-cd:
1313
dependencies:
1414
- changed-files:
1515
- any-glob-to-any-file:
16-
- requirements/*.txt
17-
- requirements.txt
16+
- pyproject.toml
1817

1918
documentation:
2019
- changed-files:
2120
- any-glob-to-any-file:
2221
- "*.md"
2322
- docs/**
24-
- requirements/documentation.txt
2523
- head-branch:
2624
- ^docs
2725
- documentation
@@ -37,7 +35,6 @@ packaging:
3735
- changed-files:
3836
- any-glob-to-any-file:
3937
- MANIFEST.in
40-
- setup.py
4138
- head-branch:
4239
- ^packaging
4340
- packaging
@@ -52,7 +49,6 @@ tooling:
5249
- any-glob-to-any-file:
5350
- ".*"
5451
- codecov.yml
55-
- setup.cfg
5652
- .vscode/**/*
5753
- head-branch:
5854
- ^tooling

.github/workflows/docker-test.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ name: "🐳 Docker Builder"
44
# events but only for the master branch
55
on:
66
pull_request:
7-
branches: [main]
7+
branches:
8+
- main
89
paths-ignore:
910
- "docs/**"
1011
push:
11-
branches: [main]
12+
branches:
13+
- main
1214
paths-ignore:
1315
- "docs/**"
1416

.github/workflows/documentation.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- "*.md"
1313
- ".github/workflows/documentation.yml"
1414
- ./mkdocs_rss_plugin
15-
- requirements/documentation.txt
15+
- pyproject.toml
1616
tags:
1717
- "*"
1818

@@ -22,19 +22,19 @@ on:
2222
paths:
2323
- .github/workflows/documentation.yml
2424
- docs/
25-
- requirements/documentation.txt
25+
- pyproject.toml
2626

2727
workflow_dispatch:
2828

2929
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
3030
permissions:
3131
contents: read
32-
pages: write
3332
id-token: write
33+
pages: write
3434

3535
# Allow one concurrent deployment
3636
concurrency:
37-
group: "pages"
37+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
3838
cancel-in-progress: true
3939

4040
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
@@ -56,13 +56,13 @@ jobs:
5656
with:
5757
python-version: "3.11"
5858
cache: "pip"
59-
cache-dependency-path: "requirements/documentation.txt"
59+
cache-dependency-path: pyproject.toml
6060

6161
- name: Install dependencies
62-
run: |
63-
python -m pip install --upgrade pip setuptools wheel
64-
python -m pip install --upgrade -r requirements.txt
65-
python -m pip install --upgrade -r requirements/documentation.txt
62+
run: python -m pip install --upgrade pip setuptools wheel
63+
64+
- name: Install project as a package
65+
run: python -m pip install .[docs]
6666

6767
- name: Build static website
6868
env:

.github/workflows/lint-and-tests.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ jobs:
3838
with:
3939
python-version: ${{ matrix.python-version }}
4040
cache: "pip"
41-
cache-dependency-path: "requirements/*.txt"
41+
cache-dependency-path: pyproject.toml
4242

43-
- name: Install dependencies
44-
run: |
45-
python -m pip install --upgrade pip setuptools wheel
46-
python -m pip install --upgrade -r requirements.txt
47-
python -m pip install --upgrade -r requirements/development.txt
48-
python -m pip install --upgrade -r requirements/testing.txt
43+
- name: Upgrade installation dependencies
44+
run: python -m pip install --upgrade pip setuptools wheel
45+
46+
- name: Install project as a package
47+
run: python -m pip install .[test]
4948

5049
- name: Lint with flake8
5150
run: |
@@ -54,9 +53,6 @@ jobs:
5453
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
5554
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
5655
57-
- name: Install project
58-
run: python -m pip install -e .
59-
6056
- name: Run Unit tests
6157
run: python -m pytest
6258

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ jobs:
1616
url: https://pypi.org/project/mkdocs-rss-plugin/
1717
permissions:
1818
contents: write
19-
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
2019
discussions: write
20+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
2121

2222
steps:
2323
- uses: actions/checkout@v5
2424

2525
- name: Set up Python
2626
uses: actions/setup-python@v6
2727
with:
28-
python-version: "3.x"
28+
python-version: "3.13"
2929
cache: "pip"
30-
cache-dependency-path: "requirements/base.txt"
30+
cache-dependency-path: pyproject.toml
3131

3232
- name: Install dependencies
3333
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,5 +216,6 @@ dmypy.json
216216
# ################################
217217

218218
**/*.xml
219+
mkdocs_rss_plugin/_version.py
219220
site/
220221
tests/fixtures/docs/temp_page_not_in_git_log.md

.pre-commit-config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ repos:
1818
- id: detect-private-key
1919
- id: end-of-file-fixer
2020
- id: fix-byte-order-marker
21+
- id: name-tests-test
22+
args:
23+
- --pytest-test-first
2124
- id: trailing-whitespace
2225
args:
2326
- --markdown-linebreak-ext=md
@@ -37,7 +40,7 @@ repos:
3740
- repo: https://github.com/astral-sh/ruff-pre-commit
3841
rev: "v0.14.3"
3942
hooks:
40-
- id: ruff
43+
- id: ruff-check
4144
args:
4245
- --fix-only
4346
- --target-version=py310
@@ -66,7 +69,6 @@ repos:
6669
- flake8-docstrings<2
6770
language: python
6871
args:
69-
- --config=setup.cfg
7072
- --select=E9,F63,F7,F82
7173
- --docstring-convention=google
7274

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,24 @@ Following initiative from the author of Material for MkDocs, this plugin provide
8484
8585
## Development
8686
87-
Clone the repository:
87+
Once you cloned the repository:
8888
8989
```sh
90-
# install development dependencies
91-
python -m pip install -U -r requirements/development.txt
92-
# alternatively: pip install -e .[dev]
93-
9490
# install project as editable
9591
python -m pip install -e .
9692

93+
# including development dependencies
94+
python -m pip install -e .[dev]
95+
96+
# including documentation dependencies
97+
python -m pip install -e .[docs]
98+
99+
# including testing dependencies
100+
python -m pip install -e .[test]
101+
102+
# all inclusive
103+
python -m pip install -e .[dev,docs,test]
104+
97105
# install git hooks
98106
pre-commit install
99107
```
@@ -104,8 +112,7 @@ Then follow the [contribution guidelines](CONTRIBUTING.md).
104112

105113
```sh
106114
# install development dependencies
107-
python -m pip install -U -r requirements/testing.txt
108-
# alternatively: pip install -e .[test]
115+
python -m pip install -e .[test]
109116

110117
# run tests
111118
pytest
@@ -115,8 +122,7 @@ pytest
115122

116123
```sh
117124
# install dependencies for documentation
118-
python -m pip install -U -r requirements/documentation.txt
119-
# alternatively: pip install -e .[doc]
125+
python -m pip install -e .[docs]
120126

121127
# build the documentation
122128
mkdocs build

docs/contributing.md

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,24 @@ These are mostly guidelines, not rules. Use your best judgment, and feel free to
1212

1313
## Development
1414

15-
Clone the repository:
15+
Once you cloned the repository:
1616

1717
```sh
18-
# install development dependencies
19-
python -m pip install -U -r requirements/development.txt
20-
# alternatively: pip install -e .[dev]
21-
2218
# install project as editable
2319
python -m pip install -e .
2420

21+
# including development dependencies
22+
python -m pip install -e .[dev]
23+
24+
# including documentation dependencies
25+
python -m pip install -e .[docs]
26+
27+
# including testing dependencies
28+
python -m pip install -e .[test]
29+
30+
# all inclusive
31+
python -m pip install -e .[dev,docs,test]
32+
2533
# install git hooks
2634
pre-commit install
2735
```
@@ -32,8 +40,7 @@ Then follow the [contribution guidelines](#guidelines).
3240

3341
```sh
3442
# install development dependencies
35-
python -m pip install -U -r requirements/testing.txt
36-
# alternatively: pip install -e .[test]
43+
python -m pip install -e .[test]
3744

3845
# run tests
3946
pytest
@@ -43,8 +50,7 @@ pytest
4350

4451
```sh
4552
# install dependencies for documentation
46-
python -m pip install -U -r requirements/documentation.txt
47-
# alternatively: pip install -e .[doc]
53+
python -m pip install -e .[docs]
4854

4955
# build the documentation
5056
mkdocs build
@@ -90,10 +96,15 @@ Feel free to use the IDE you love. Here come configurations for some popular IDE
9096

9197
```jsonc
9298
{
93-
// Editor
94-
"files.associations": {
95-
"./requirements/*.txt": "pip-requirements"
99+
// JSON
100+
"[json]": {
101+
"editor.bracketPairColorization.enabled": true,
102+
"editor.defaultFormatter": "vscode.json-language-features",
103+
"editor.formatOnSave": true,
104+
"editor.guides.bracketPairs": "active"
96105
},
106+
"json.format.enable": true,
107+
"json.schemaDownload.enable": true,
97108
// Markdown
98109
"markdown.updateLinksOnFileMove.enabled": "prompt",
99110
"markdown.updateLinksOnFileMove.enableForDirectories": true,
@@ -104,9 +115,16 @@ Feel free to use the IDE you love. Here come configurations for some popular IDE
104115
"editor.bracketPairColorization.enabled": true,
105116
"editor.formatOnSave": true,
106117
"editor.guides.bracketPairs": "active",
107-
"files.trimTrailingWhitespace": false,
118+
"files.trimTrailingWhitespace": false
108119
},
109120
// Python
121+
"python.analysis.autoFormatStrings": true,
122+
"python.analysis.autoImportCompletions": true,
123+
"python.analysis.typeCheckingMode": "basic",
124+
"python.terminal.activateEnvInCurrentTerminal": true,
125+
"python.terminal.activateEnvironment": true,
126+
"python.testing.unittestEnabled": true,
127+
"python.testing.pytestEnabled": true,
110128
"[python]": {
111129
"editor.codeActionsOnSave": {
112130
"source.organizeImports": "explicit"
@@ -119,25 +137,38 @@ Feel free to use the IDE you love. Here come configurations for some popular IDE
119137
],
120138
"editor.wordWrapColumn": 88,
121139
},
122-
// Extensions
140+
// YAML
141+
"[yaml]": {
142+
"editor.autoIndent": "keep",
143+
"editor.formatOnSave": true,
144+
"editor.insertSpaces": true,
145+
"editor.tabSize": 2,
146+
"diffEditor.ignoreTrimWhitespace": false,
147+
"editor.quickSuggestions": {
148+
"other": true,
149+
"comments": false,
150+
"strings": true
151+
}
152+
},
153+
// extensions
154+
"autoDocstring.guessTypes": true,
155+
"autoDocstring.docstringFormat": "google-notypes",
156+
"autoDocstring.generateDocstringOnEnter": false,
123157
"flake8.args": [
124-
"--config=setup.cfg",
125158
"--verbose"
126159
],
127160
"isort.args": [
128161
"--profile",
129162
"black"
130163
],
131164
"isort.check": true,
132-
"autoDocstring.guessTypes": true,
133-
"autoDocstring.docstringFormat": "google",
134-
"autoDocstring.generateDocstringOnEnter": false,
135165
"yaml.customTags": [
136166
"!ENV scalar",
137167
"!ENV sequence",
138-
"tag:yaml.org,2002:python/name:materialx.emoji.to_svg",
139-
"tag:yaml.org,2002:python/name:materialx.emoji.twemoji",
168+
"!relative scalar",
169+
"tag:yaml.org,2002:python/name:material.extensions.emoji.to_svg",
170+
"tag:yaml.org,2002:python/name:material.extensions.emoji.twemoji",
140171
"tag:yaml.org,2002:python/name:pymdownx.superfences.fence_code_format"
141-
],
172+
]
142173
}
143174
```

0 commit comments

Comments
 (0)