repo-review 0.10.6__tar.gz → 0.11.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. {repo_review-0.10.6 → repo_review-0.11.1}/.devcontainer/devcontainer.json +2 -2
  2. {repo_review-0.10.6 → repo_review-0.11.1}/.github/CONTRIBUTING.md +31 -21
  3. repo_review-0.11.1/.github/ISSUE_TEMPLATE/new-issue.md +11 -0
  4. repo_review-0.11.1/.github/release.yml +5 -0
  5. {repo_review-0.10.6 → repo_review-0.11.1}/.github/workflows/ci.yml +21 -23
  6. {repo_review-0.10.6 → repo_review-0.11.1}/.pre-commit-config.yaml +19 -6
  7. repo_review-0.11.1/.readthedocs.yaml +18 -0
  8. {repo_review-0.10.6 → repo_review-0.11.1}/PKG-INFO +7 -6
  9. {repo_review-0.10.6 → repo_review-0.11.1}/README.md +3 -3
  10. {repo_review-0.10.6 → repo_review-0.11.1}/action.yml +1 -1
  11. {repo_review-0.10.6 → repo_review-0.11.1}/docs/conf.py +21 -0
  12. {repo_review-0.10.6 → repo_review-0.11.1}/docs/index.html +7 -7
  13. {repo_review-0.10.6 → repo_review-0.11.1}/docs/plugins.md +1 -1
  14. {repo_review-0.10.6 → repo_review-0.11.1}/docs/webapp.js +4 -7
  15. {repo_review-0.10.6 → repo_review-0.11.1}/docs/webapp.md +1 -4
  16. {repo_review-0.10.6 → repo_review-0.11.1}/pyproject.toml +51 -9
  17. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/__main__.py +12 -0
  18. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/_version.py +2 -2
  19. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/checks.py +2 -3
  20. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/ghpath.py +7 -1
  21. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/resources/repo-review.schema.json +12 -1
  22. {repo_review-0.10.6 → repo_review-0.11.1}/tests/conftest.py +2 -2
  23. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_multi.py +9 -5
  24. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_package.py +40 -2
  25. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_utilities/pyproject.toml +1 -1
  26. repo_review-0.10.6/.github/matchers/pylint.json +0 -32
  27. repo_review-0.10.6/.readthedocs.yaml +0 -22
  28. repo_review-0.10.6/noxfile.py +0 -138
  29. {repo_review-0.10.6 → repo_review-0.11.1}/.git_archival.txt +0 -0
  30. {repo_review-0.10.6 → repo_review-0.11.1}/.gitattributes +0 -0
  31. {repo_review-0.10.6 → repo_review-0.11.1}/.github/dependabot.yml +0 -0
  32. {repo_review-0.10.6 → repo_review-0.11.1}/.github/workflows/cd.yml +0 -0
  33. {repo_review-0.10.6 → repo_review-0.11.1}/.gitignore +0 -0
  34. {repo_review-0.10.6 → repo_review-0.11.1}/.pre-commit-hooks.yaml +0 -0
  35. {repo_review-0.10.6 → repo_review-0.11.1}/LICENSE +0 -0
  36. {repo_review-0.10.6 → repo_review-0.11.1}/docs/.nojekyll +0 -0
  37. {repo_review-0.10.6 → repo_review-0.11.1}/docs/api/repo_review.resources.rst +0 -0
  38. {repo_review-0.10.6 → repo_review-0.11.1}/docs/api/repo_review.rst +0 -0
  39. {repo_review-0.10.6 → repo_review-0.11.1}/docs/changelog.md +0 -0
  40. {repo_review-0.10.6 → repo_review-0.11.1}/docs/checks.md +0 -0
  41. {repo_review-0.10.6 → repo_review-0.11.1}/docs/cli.md +0 -0
  42. {repo_review-0.10.6 → repo_review-0.11.1}/docs/families.md +0 -0
  43. {repo_review-0.10.6 → repo_review-0.11.1}/docs/fixtures.md +0 -0
  44. {repo_review-0.10.6 → repo_review-0.11.1}/docs/index.md +0 -0
  45. {repo_review-0.10.6 → repo_review-0.11.1}/docs/intro.md +0 -0
  46. {repo_review-0.10.6 → repo_review-0.11.1}/docs/programmatic.md +0 -0
  47. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/__init__.py +0 -0
  48. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/_compat/__init__.py +0 -0
  49. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/_compat/importlib/__init__.py +0 -0
  50. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/_compat/importlib/resources/__init__.py +0 -0
  51. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/_compat/importlib/resources/abc.py +0 -0
  52. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/_compat/tomllib.py +0 -0
  53. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/_compat/typing.py +0 -0
  54. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/_version.pyi +0 -0
  55. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/families.py +0 -0
  56. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/fixtures.py +0 -0
  57. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/html.py +0 -0
  58. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/processor.py +0 -0
  59. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/py.typed +0 -0
  60. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/resources/__init__.py +0 -0
  61. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/schema.py +0 -0
  62. {repo_review-0.10.6 → repo_review-0.11.1}/src/repo_review/testing.py +0 -0
  63. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_checks.py +0 -0
  64. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_cmd.py +0 -0
  65. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_depends.py +0 -0
  66. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_families.py +0 -0
  67. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_fixtures.py +0 -0
  68. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_self.py +0 -0
  69. {repo_review-0.10.6 → repo_review-0.11.1}/tests/test_utilities/pyproject.py +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "repo-review[dev]",
3
- "image": "mcr.microsoft.com/devcontainers/python:0-3.11",
4
- "postCreateCommand": "pipx install nox && pip install -e.[cli,test] pylint",
3
+ "image": "mcr.microsoft.com/devcontainers/python:0-3.12",
4
+ "postCreateCommand": "pipx install hatch && pip install -e.[cli,test] pylint",
5
5
  "customizations": {
6
6
  "vscode": {
7
7
  "extensions": [
@@ -5,28 +5,32 @@ detailed description of best practices for developing Scikit-HEP packages.
5
5
 
6
6
  ## Quick development
7
7
 
8
- The fastest way to start with development is to use nox. If you don't have nox,
9
- you can use `pipx run nox` to run it without installing, or `pipx install nox`.
10
- If you don't have pipx (pip for applications), then you can install with with
11
- `pip install pipx` (the only case were installing an application with regular
12
- pip is reasonable). If you use macOS, then pipx and nox are both in brew, use
13
- `brew install pipx nox`.
8
+ The fastest way to start with development is to use hatch. If you don't have
9
+ hatch, you can use `pipx run hatch` to run it without installing, or `pipx
10
+ install hatch`. If you don't have pipx (pip for applications), then you can
11
+ install with with `pip install pipx` (the only case were installing an
12
+ application with regular pip is reasonable). If you use macOS, then pipx and
13
+ hatch are both in brew, use `brew install pipx hatch`. Hatch 1.10+ is required.
14
14
 
15
- To use, run `nox`. This will lint and test using every installed version of
16
- Python on your system, skipping ones that are not installed. You can also run
17
- specific jobs:
15
+ Here are some common tasks you might want to run:
18
16
 
19
17
  ```console
20
- $ nox -s lint # Lint only
21
- $ nox -s tests # Tests
22
- $ nox -s docs -- --serve # Build and serve the docs
23
- $ nox -s build # Make an SDist and wheel
18
+ $ hatch run lint:lint # all linters (pre-commit)
19
+ $ hatch run pylint:lint # pylint
20
+ $ hatch fmt # just format & basic lint
21
+ $ hatch tests # run the tests
22
+ $ hatch build # build SDist and wheel
23
+ $ hatch run docs:serve # build and serve the docs
24
+ $ hatch run docs:html # just build the docs
25
+ $ hatch run docs:man # build manpage
26
+ $ hatch run docs:linkcheck # check for broken links
27
+ $ hatch run api-docs:build # rebuild the API docs
28
+ $ hatch run webapp:serve # serve the webapp
29
+ $ hatch run example:repo-review <args> # Run an example
24
30
  ```
25
31
 
26
- Nox handles everything for you, including setting up an temporary virtual
27
- environment for each run.
28
-
29
- You can also use `nox -s run -- .` to run an example set of checks on a repo.
32
+ Hatch handles everything for you, including setting up an temporary virtual
33
+ environment.
30
34
 
31
35
  ## Setting up a development environment manually
32
36
 
@@ -71,19 +75,25 @@ pytest
71
75
  You can build the docs using:
72
76
 
73
77
  ```bash
74
- nox -s docs
78
+ hatch run docs:docs
75
79
  ```
76
80
 
77
81
  You can see a preview with:
78
82
 
79
83
  ```bash
80
- nox -s docs -- --serve
84
+ hatch run docs:serve
85
+ ```
86
+
87
+ You can rebuild the API docs with:
88
+
89
+ ```bash
90
+ $ hatch run api-docs:build
81
91
  ```
82
92
 
83
93
  ## Pre-commit
84
94
 
85
95
  This project uses pre-commit for all style checking. While you can run it with
86
- nox, this is such an important tool that it deserves to be installed on its
96
+ hatch, this is such an important tool that it deserves to be installed on its
87
97
  own. Install pre-commit and run:
88
98
 
89
99
  ```bash
@@ -94,5 +104,5 @@ to check all files.
94
104
 
95
105
  ## Running DevContainer
96
106
 
97
- You can use DevContainer, such as in GitHub Codespaces or locally. Nox and a
107
+ You can use DevContainer, such as in GitHub Codespaces or locally. Hatch and a
98
108
  local install will be available.
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: New Issue
3
+ about: Prepare a new bug report or feature request
4
+ title: ""
5
+ labels: ""
6
+ assignees: ""
7
+ ---
8
+
9
+ <!--
10
+ Thanks for making a bug report or feature request! Please note, repo-review is a framework for running checks. If you have an issue with a particular check, please open the issue with the plugin that provides the check. The repo-review demo uses the sp-repo-review plugin, which lives at http://github.com/scientific-python/cookie, for example.
11
+ -->
@@ -0,0 +1,5 @@
1
+ changelog:
2
+ exclude:
3
+ authors:
4
+ - dependabot
5
+ - pre-commit-ci
@@ -27,21 +27,15 @@ jobs:
27
27
  with:
28
28
  python-version: "3.x"
29
29
  - uses: pre-commit/action@v3.0.1
30
- with:
31
- extra_args: --hook-stage manual --all-files
32
30
  - name: Run PyLint
33
- run: |
34
- echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
35
- pipx run --python=python nox -s pylint
31
+ run: pipx run --python=python hatch run pylint:lint --output-format=github
36
32
 
37
33
  checks:
38
- name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
34
+ name: Check Python on ${{ matrix.runs-on }}
39
35
  runs-on: ${{ matrix.runs-on }}
40
- needs: [pre-commit]
41
36
  strategy:
42
37
  fail-fast: false
43
38
  matrix:
44
- python-version: ["3.10", "3.11", "3.12"]
45
39
  runs-on: [ubuntu-latest, macos-latest, windows-latest]
46
40
 
47
41
  steps:
@@ -51,20 +45,21 @@ jobs:
51
45
 
52
46
  - uses: actions/setup-python@v5
53
47
  with:
54
- python-version: ${{ matrix.python-version }}
48
+ python-version: |
49
+ 3.10
50
+ 3.11
51
+ 3.12
52
+ 3.13
53
+ allow-prereleases: true
55
54
 
56
55
  - name: Setup uv
57
56
  uses: yezz123/setup-uv@v4
58
- with:
59
- uv-venv: ".venv"
60
57
 
61
- - name: Install package
62
- run: uv pip install .[test,cli]
58
+ - name: Install hatch
59
+ run: uv pip install --system hatch
63
60
 
64
- - name: Test package
65
- run: python -m pytest -ra
66
- env:
67
- PYTHONUTF8: "1"
61
+ - name: Test package (all Pythons)
62
+ run: hatch test -a
68
63
 
69
64
  dist:
70
65
  name: Distribution build
@@ -88,19 +83,22 @@ jobs:
88
83
  - name: Setup uv
89
84
  uses: yezz123/setup-uv@v4
90
85
 
91
- - uses: wntrblm/nox@2024.04.15
86
+ - uses: actions/setup-python@v5
92
87
  with:
93
- python-versions: "3.11"
88
+ python-version: "3.12"
89
+
90
+ - name: Install hatch
91
+ run: uv pip install --system hatch
94
92
 
95
93
  - name: Linkcheck
96
- run: nox -s docs -- -b linkcheck
94
+ run: hatch run docs:linkcheck
97
95
 
98
96
  - name: Build docs with warnings as errors
99
- run: nox -s docs -- -W
97
+ run: hatch run docs:html -W
100
98
 
101
99
  - name: Verify no changes required to API docs
102
100
  run: |
103
- nox -s build_api_docs
101
+ hatch run api-docs:build
104
102
  git diff --exit-code
105
103
 
106
104
  action:
@@ -114,4 +112,4 @@ jobs:
114
112
  - name: Run repo-review action
115
113
  uses: ./
116
114
  with:
117
- plugins: sp-repo-review==2024.03.10
115
+ plugins: sp-repo-review==2024.04.23
@@ -1,23 +1,24 @@
1
1
  ci:
2
2
  autoupdate_commit_msg: "chore(deps): update pre-commit hooks"
3
3
  autofix_commit_msg: "style: pre-commit fixes"
4
+ autoupdate_schedule: monthly
4
5
 
5
6
  repos:
6
7
  - repo: https://github.com/adamchainz/blacken-docs
7
- rev: 1.16.0
8
+ rev: 1.18.0
8
9
  hooks:
9
10
  - id: blacken-docs
10
11
  additional_dependencies: [black==23.*]
11
12
 
12
13
  - repo: https://github.com/astral-sh/ruff-pre-commit
13
- rev: "v0.4.1"
14
+ rev: "v0.6.1"
14
15
  hooks:
15
16
  - id: ruff
16
17
  args: ["--fix", "--show-fixes"]
17
18
  - id: ruff-format
18
19
 
19
- - repo: https://github.com/pre-commit/mirrors-prettier
20
- rev: "v4.0.0-alpha.8"
20
+ - repo: https://github.com/rbubley/mirrors-prettier
21
+ rev: "v3.3.3"
21
22
  hooks:
22
23
  - id: prettier
23
24
  types_or: [yaml, markdown, html, css, scss, javascript, json]
@@ -44,7 +45,7 @@ repos:
44
45
  - id: rst-inline-touching-normal
45
46
 
46
47
  - repo: https://github.com/pre-commit/mirrors-mypy
47
- rev: v1.9.0
48
+ rev: v1.11.1
48
49
  hooks:
49
50
  - id: mypy
50
51
  files: (src|web|tests)
@@ -58,7 +59,7 @@ repos:
58
59
  - types-PyYAML
59
60
 
60
61
  - repo: https://github.com/codespell-project/codespell
61
- rev: v2.2.6
62
+ rev: v2.3.0
62
63
  hooks:
63
64
  - id: codespell
64
65
  args: ["-Lhist,absense", "-w"]
@@ -75,3 +76,15 @@ repos:
75
76
  language: pygrep
76
77
  entry: PyBind|Numpy|Cmake|CCache|Github|PyTest
77
78
  exclude: .pre-commit-config.yaml
79
+
80
+ - repo: https://github.com/henryiii/validate-pyproject-schema-store
81
+ rev: 2024.08.19
82
+ hooks:
83
+ - id: validate-pyproject
84
+
85
+ - repo: https://github.com/python-jsonschema/check-jsonschema
86
+ rev: 0.29.1
87
+ hooks:
88
+ - id: check-dependabot
89
+ - id: check-github-workflows
90
+ - id: check-readthedocs
@@ -0,0 +1,18 @@
1
+ # .readthedocs.yaml
2
+ # Read the Docs configuration file
3
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
+
5
+ # Required
6
+ version: 2
7
+
8
+ build:
9
+ os: "ubuntu-22.04"
10
+ tools:
11
+ python: "3.12"
12
+ commands:
13
+ - asdf plugin add uv
14
+ - asdf install uv latest
15
+ - asdf global uv latest
16
+ - uv venv
17
+ - uv pip install .[docs]
18
+ - . .venv/bin/activate && sphinx-build -T -b html -d docs/_build/doctrees -D language=en docs $READTHEDOCS_OUTPUT/html
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: repo_review
3
- Version: 0.10.6
3
+ Version: 0.11.1
4
4
  Summary: Framework that can run checks on repos
5
5
  Project-URL: Changelog, https://github.com/scientific-python/repo-review/releases
6
6
  Project-URL: Demo, https://scientific-python.github.io/repo-review
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3
21
21
  Classifier: Programming Language :: Python :: 3.10
22
22
  Classifier: Programming Language :: Python :: 3.11
23
23
  Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Programming Language :: Python :: 3.13
24
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
26
  Classifier: Topic :: Software Development :: Quality Assurance
26
27
  Classifier: Typing :: Typed
@@ -38,7 +39,7 @@ Requires-Dist: click>=8; extra == 'dev'
38
39
  Requires-Dist: pytest>=7; extra == 'dev'
39
40
  Requires-Dist: rich-click; extra == 'dev'
40
41
  Requires-Dist: rich>=12.2; extra == 'dev'
41
- Requires-Dist: sp-repo-review>=2023.12.21; extra == 'dev'
42
+ Requires-Dist: sp-repo-review>=2024.04.23; extra == 'dev'
42
43
  Requires-Dist: validate-pyproject>=0.14; extra == 'dev'
43
44
  Provides-Extra: docs
44
45
  Requires-Dist: click>=8; extra == 'docs'
@@ -54,7 +55,7 @@ Requires-Dist: sphinxcontrib-programoutput; extra == 'docs'
54
55
  Requires-Dist: sphinxext-opengraph; extra == 'docs'
55
56
  Provides-Extra: test
56
57
  Requires-Dist: pytest>=7; extra == 'test'
57
- Requires-Dist: sp-repo-review>=2023.12.21; extra == 'test'
58
+ Requires-Dist: sp-repo-review>=2024.04.23; extra == 'test'
58
59
  Requires-Dist: validate-pyproject>=0.14; extra == 'test'
59
60
  Description-Content-Type: text/markdown
60
61
 
@@ -76,7 +77,7 @@ least one plugin to be installed.
76
77
  With one or more plugins, it will produce a list of results - green checkmarks
77
78
  mean this rule is followed, red x’s mean the rule is not. A yellow warning sign
78
79
  means that the check was skipped because a previous required check failed. Four
79
- output formats are supported; `rich`, `svg`, `html`, and `json`.
80
+ output formats are supported: `rich`, `svg`, `html`, and `json`.
80
81
 
81
82
  ## Plugins
82
83
 
@@ -140,7 +141,7 @@ the files that interest the plugin in question.
140
141
 
141
142
  So if you want to lint Python code, use Flake8 or Ruff. But if you want to
142
143
  check Flake8 or Ruff's configuration, use repo-review! Generally, repo-review
143
- plugins are more about requiring things to be present, like making use all your
144
+ plugins are more about requiring things to be present, like making sure all your
144
145
  repos have some [pre-commit][] check.
145
146
 
146
147
  ## Development of repo-review and plugins
@@ -169,7 +170,7 @@ accept fixtures, allowing dynamic check listings.
169
170
  Check files do not depend on the main library, and can be extended (similar to
170
171
  Flake8). You register new check files via entry-points - so extending this is
171
172
  with custom checks or custom fixtures is easy and trivial. There's no need to
172
- subclass or do anything with the base library - no dependency required.
173
+ subclass or do anything with the base library - no dependency on repo-review required.
173
174
 
174
175
  Checks are as simple as possible so they are easy to write. A check is a class
175
176
  with the name (1-2 letters + number) and a docstring (the check message). It
@@ -16,7 +16,7 @@ least one plugin to be installed.
16
16
  With one or more plugins, it will produce a list of results - green checkmarks
17
17
  mean this rule is followed, red x’s mean the rule is not. A yellow warning sign
18
18
  means that the check was skipped because a previous required check failed. Four
19
- output formats are supported; `rich`, `svg`, `html`, and `json`.
19
+ output formats are supported: `rich`, `svg`, `html`, and `json`.
20
20
 
21
21
  ## Plugins
22
22
 
@@ -80,7 +80,7 @@ the files that interest the plugin in question.
80
80
 
81
81
  So if you want to lint Python code, use Flake8 or Ruff. But if you want to
82
82
  check Flake8 or Ruff's configuration, use repo-review! Generally, repo-review
83
- plugins are more about requiring things to be present, like making use all your
83
+ plugins are more about requiring things to be present, like making sure all your
84
84
  repos have some [pre-commit][] check.
85
85
 
86
86
  ## Development of repo-review and plugins
@@ -109,7 +109,7 @@ accept fixtures, allowing dynamic check listings.
109
109
  Check files do not depend on the main library, and can be extended (similar to
110
110
  Flake8). You register new check files via entry-points - so extending this is
111
111
  with custom checks or custom fixtures is easy and trivial. There's no need to
112
- subclass or do anything with the base library - no dependency required.
112
+ subclass or do anything with the base library - no dependency on repo-review required.
113
113
 
114
114
  Checks are as simple as possible so they are easy to write. A check is a class
115
115
  with the name (1-2 letters + number) and a docstring (the check message). It
@@ -26,7 +26,7 @@ runs:
26
26
  - uses: actions/setup-python@v5
27
27
  id: python
28
28
  with:
29
- python-version: "3.11"
29
+ python-version: "3.12"
30
30
  update-environment: false
31
31
 
32
32
  - name: Install repo-review and plugins
@@ -1,8 +1,11 @@
1
+ from __future__ import annotations
2
+
1
3
  import importlib
2
4
  import importlib.metadata
3
5
  import inspect
4
6
  import os
5
7
  from pathlib import Path
8
+ from typing import Any
6
9
 
7
10
  import repo_review
8
11
 
@@ -39,6 +42,24 @@ exclude_patterns = [
39
42
 
40
43
  html_theme = "furo"
41
44
 
45
+ html_theme_options: dict[str, Any] = {
46
+ "footer_icons": [
47
+ {
48
+ "name": "GitHub",
49
+ "url": "https://github.com/scientific-python/repo-review",
50
+ "html": """
51
+ <svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 16 16">
52
+ <path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"></path>
53
+ </svg>
54
+ """,
55
+ "class": "",
56
+ },
57
+ ],
58
+ "source_repository": "https://github.com/scientific-python/repo-review/",
59
+ "source_branch": "main",
60
+ "source_directory": "docs/",
61
+ }
62
+
42
63
  myst_enable_extensions = [
43
64
  "colon_fence",
44
65
  "deflist",
@@ -6,7 +6,7 @@
6
6
  content="initial-scale=1, width=device-width"
7
7
  />
8
8
  <script
9
- src="https://cdn.jsdelivr.net/pyodide/v0.23.3/full/pyodide.js"
9
+ src="https://cdn.jsdelivr.net/pyodide/v0.26.2/full/pyodide.js"
10
10
  crossorigin
11
11
  ></script>
12
12
  <!-- Production -->
@@ -19,7 +19,7 @@
19
19
  crossorigin
20
20
  ></script>
21
21
  <script
22
- src="https://unpkg.com/@mui/material@v5.13.3/umd/material-ui.production.min.js"
22
+ src="https://unpkg.com/@mui/material@v5.16.7/umd/material-ui.production.min.js"
23
23
  crossorigin
24
24
  ></script>
25
25
  <!-- Development
@@ -32,7 +32,7 @@
32
32
  crossorigin
33
33
  ></script>
34
34
  <script
35
- src="https://unpkg.com/@mui/material@v5.13.3/umd/material-ui.development.js"
35
+ src="https://unpkg.com/@mui/material@v5.16.7/umd/material-ui.development.js"
36
36
  crossorigin
37
37
  ></script>
38
38
  -->
@@ -64,10 +64,10 @@
64
64
  <App
65
65
  header={true}
66
66
  deps={[
67
- "repo-review~=0.10.0",
68
- "sp-repo-review==2024.03.10",
69
- "validate-pyproject-schema-store==2024.04.20",
70
- "validate-pyproject[all]~=0.16.0",
67
+ "repo-review~=0.11.0",
68
+ "sp-repo-review==2024.04.23",
69
+ "validate-pyproject-schema-store== 2024.08.19",
70
+ "validate-pyproject[all]~=0.19.0",
71
71
  ]}
72
72
  />,
73
73
  );
@@ -43,7 +43,7 @@ def test_has_tool_ruff(tmp_path: Path) -> None:
43
43
  # In this example, tool.ruff is required to be present by this plugin
44
44
  d = tmp_path / "some_package"
45
45
  d.mkdir()
46
- d.joinpath("pyproject.toml").write_text("[tool.ruff]")
46
+ d.joinpath("pyproject.toml").write_text("[tool.ruff]", encoding="utf-8")
47
47
  processed = repo_review_processor.process(d)
48
48
  assert all(r.result for r in processed.results), f"{processed.results}"
49
49
  ```
@@ -33,7 +33,6 @@ function IfUrlLink({ name, url, color }) {
33
33
  return (
34
34
  <MaterialUI.Typography
35
35
  sx={{ display: "inline" }}
36
- component="span"
37
36
  variant="body2"
38
37
  color={color}
39
38
  component="a"
@@ -192,12 +191,13 @@ function MyThemeProvider(props) {
192
191
  class App extends React.Component {
193
192
  constructor(props) {
194
193
  super(props);
195
- const deps_str = props.deps.join(" ");
194
+ const inner_deps_str = props.deps.join("\n");
195
+ const deps_str = `<pre><code>${inner_deps_str}</code></pre>`;
196
196
  this.state = {
197
197
  results: [],
198
198
  repo: urlParams.get("repo") || "",
199
199
  branch: urlParams.get("branch") || "",
200
- msg: `${DEFAULT_MSG} Packages: ${deps_str}`,
200
+ msg: `<p>${DEFAULT_MSG}</p><h4>Packages:</h4> ${deps_str}`,
201
201
  progress: false,
202
202
  err_msg: "",
203
203
  url: "",
@@ -229,12 +229,9 @@ class App extends React.Component {
229
229
  var families_checks;
230
230
  try {
231
231
  families_checks = pyodide.runPython(`
232
- from pyodide.http import open_url
233
232
  from repo_review.processor import process, md_as_html
234
233
  from repo_review.ghpath import GHPath
235
234
 
236
- GHPath.open_url = staticmethod(open_url)
237
-
238
235
  package = GHPath(repo="${state.repo}", branch="${state.branch}")
239
236
  result = process(package)
240
237
 
@@ -366,7 +363,7 @@ class App extends React.Component {
366
363
  <MaterialUI.Paper elevation={3}>
367
364
  <MaterialUI.Box sx={{ p: 2 }}>
368
365
  <MaterialUI.Typography variant="body1" component="div">
369
- {this.state.msg}
366
+ <span dangerouslySetInnerHTML={{ __html: this.state.msg }} />
370
367
  </MaterialUI.Typography>
371
368
  {this.state.progress && <MaterialUI.LinearProgress />}
372
369
  {this.state.err_msg && (
@@ -20,7 +20,7 @@ You can also use the `html` output and write your own webapp. You need to provid
20
20
 
21
21
  ```html
22
22
  <script
23
- src="https://cdn.jsdelivr.net/pyodide/v0.23.2/full/pyodide.js"
23
+ src="https://cdn.jsdelivr.net/pyodide/v0.25.1/full/pyodide.js"
24
24
  crossorigin
25
25
  ></script>
26
26
  ```
@@ -44,13 +44,10 @@ You can get the families and the checks:
44
44
 
45
45
  ```js
46
46
  result_html_py = pyodide.runPython(`
47
- from pyodide.http import open_url
48
47
  from repo_review.processor import process
49
48
  from repo_review.ghpath import GHPath
50
49
  from repo_review.html import to_html
51
50
 
52
- GHPath.open_url = staticmethod(open_url)
53
-
54
51
  package = GHPath(repo="${state.repo}", branch="${state.branch}")
55
52
  to_html(*process(package))
56
53
  `);
@@ -23,6 +23,7 @@ classifiers = [
23
23
  "Programming Language :: Python :: 3.10",
24
24
  "Programming Language :: Python :: 3.11",
25
25
  "Programming Language :: Python :: 3.12",
26
+ "Programming Language :: Python :: 3.13",
26
27
  "Programming Language :: Python",
27
28
  "Topic :: Software Development :: Quality Assurance",
28
29
  "Topic :: Software Development :: Libraries :: Python Modules",
@@ -44,7 +45,7 @@ cli = [
44
45
  ]
45
46
  test = [
46
47
  "pytest >=7",
47
- "sp-repo-review >=2023.12.21",
48
+ "sp-repo-review >=2024.04.23",
48
49
  "validate-pyproject >=0.14",
49
50
  ]
50
51
  dev = [
@@ -84,6 +85,47 @@ repo-review = "repo_review.schema:get_schema"
84
85
  version.source = "vcs"
85
86
  build.hooks.vcs.version-file = "src/repo_review/_version.py"
86
87
 
88
+ [tool.hatch.envs.default]
89
+ installer = "uv"
90
+
91
+ [tool.hatch.envs.hatch-test]
92
+ features = ["test", "cli"]
93
+ env-vars.PYTHONWARNDEFAULTENCODING = "1"
94
+
95
+ [tool.hatch.envs.lint]
96
+ dependencies = ["pre-commit"]
97
+ skip-install = true
98
+ scripts.lint = "pre-commit run --all-files --show-diff-on-failure {args}"
99
+
100
+ [tool.hatch.envs.pylint]
101
+ features = ["cli"]
102
+ dependencies = ["pylint>=3.2"]
103
+ scripts.lint = "pylint repo_review {args}"
104
+
105
+ [tool.hatch.envs.docs]
106
+ features = ["docs"]
107
+ dependencies = ["sphinx-autobuild"]
108
+ scripts.linkcheck = "sphinx-build -b=linkcheck docs docs/_build/linkcheck {args}"
109
+ scripts.html = "sphinx-build --keep-going -n -T -b=html docs docs/_build/html {args}"
110
+ scripts.serve = "sphinx-autobuild -n -T -b=html docs docs/_build/html {args}"
111
+ scripts.man = "sphinx-build --keep-going -n -T -b=man docs docs/_build/man {args}"
112
+
113
+ [tool.hatch.envs.api-docs]
114
+ skip-install = true
115
+ dependencies = ["sphinx"]
116
+ scripts.build = "sphinx-apidoc -o docs/api/ --module-first --no-toc --force src/repo_review"
117
+
118
+ [tool.hatch.envs.example]
119
+ features = ["cli"]
120
+ post-install-commands = ["$HATCH_UV pip install -e tests/test_utilities"]
121
+
122
+ [tool.hatch.envs.webapp]
123
+ skip-install = true
124
+ scripts.serve = "cd docs && echo 'Serving on http://localhost:8080' && python -m http.server 8080"
125
+
126
+ [[tool.hatch.envs.hatch-test.matrix]]
127
+ python = ["3.13", "3.12", "3.11", "3.10"]
128
+
87
129
 
88
130
  [tool.pytest.ini_options]
89
131
  minversion = "7.0"
@@ -92,6 +134,8 @@ xfail_strict = true
92
134
  log_cli_level = "INFO"
93
135
  filterwarnings = [
94
136
  "error",
137
+ "ignore:OptionHighlighter:DeprecationWarning", # rich-click triggers its own warning
138
+ "ignore:`highlighter`:DeprecationWarning", # rich-click triggers its own warning
95
139
  ]
96
140
  testpaths = ["tests"]
97
141
  pythonpath = ["tests/test_utilities"]
@@ -113,8 +157,9 @@ disallow_untyped_defs = true
113
157
 
114
158
 
115
159
  [tool.pylint]
116
- master.py-version = "3.10"
117
- master.ignore-paths= ["src/repo_review/_version.py"]
160
+ py-version = "3.10"
161
+ ignore-paths = ["src/repo_review/_version.py"]
162
+ ignored-modules = ["pyodide"]
118
163
  reports.output-format = "colorized"
119
164
  similarities.ignore-imports = "yes"
120
165
  messages_control.disable = [
@@ -131,12 +176,10 @@ messages_control.disable = [
131
176
  "no-member", # better handled by mypy, etc.
132
177
  "used-before-assignment", # False positive on conditional import
133
178
  "unnecessary-ellipsis", # Not correct for typing
179
+ "import-outside-toplevel", # better handled elsewhere
134
180
  ]
135
181
 
136
182
 
137
- [tool.ruff]
138
- src = ["src"]
139
-
140
183
  [tool.ruff.lint]
141
184
  extend-select = [
142
185
  "B", # flake8-bugbear
@@ -160,7 +203,7 @@ extend-select = [
160
203
  "YTT", # flake8-2020
161
204
  ]
162
205
  ignore = [
163
- "ISC001", # May collide with formatter
206
+ "ISC001", # May collide with formatter
164
207
  "PT004", # Incorrect check, usefixtures is the correct way to do this
165
208
  "PLR09", # Too many X
166
209
  "PLR2004", # Magic value in comparison
@@ -181,6 +224,5 @@ typing-modules = ["repo_review._compat.typing"]
181
224
  "src/repo_review/_compat/**.py" = ["TID251"]
182
225
  "src/**/__main__.py" = ["T20"]
183
226
 
184
-
185
227
  [tool.repo-review]
186
- ignore = ["PC110"]
228
+ ignore = ["RF003", "PC180"] # Will be fixed in next sp-repo-review release
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import itertools
4
4
  import json
5
+ import os
5
6
  import sys
6
7
  import typing
7
8
  from collections.abc import Mapping, Sequence
@@ -83,6 +84,17 @@ def rich_printer(
83
84
  status: Status,
84
85
  header: str = "",
85
86
  ) -> None:
87
+ # Before Python 3.15, this isn't always unicode
88
+ if (
89
+ sys.version_info < (3, 15)
90
+ and "PYTHONIOENCODING" not in os.environ
91
+ and "PYTHONUTF8" not in os.environ
92
+ ):
93
+ if sys.stdout.encoding != "utf-8":
94
+ sys.stdout.reconfigure(encoding="utf-8") # type: ignore[union-attr]
95
+ if sys.stderr.encoding != "utf-8":
96
+ sys.stderr.reconfigure(encoding="utf-8") # type: ignore[union-attr]
97
+
86
98
  console = rich.console.Console(
87
99
  record=svg, quiet=svg, stderr=stderr, color_system="auto" if color else None
88
100
  )
@@ -12,5 +12,5 @@ __version__: str
12
12
  __version_tuple__: VERSION_TUPLE
13
13
  version_tuple: VERSION_TUPLE
14
14
 
15
- __version__ = version = '0.10.6'
16
- __version_tuple__ = version_tuple = (0, 10, 6)
15
+ __version__ = version = '0.11.1'
16
+ __version_tuple__ = version_tuple = (0, 11, 1)
@@ -89,9 +89,8 @@ def is_allowed(select: Set[str], ignore: Set[str], name: str) -> bool:
89
89
  and "*" not in select
90
90
  ):
91
91
  return False
92
- if name in ignore or name.rstrip("0123456789") in ignore:
93
- return False
94
- return True
92
+
93
+ return name not in ignore and name.rstrip("0123456789") not in ignore
95
94
 
96
95
 
97
96
  def get_check_url(name: str, check: Check) -> str:
@@ -7,6 +7,7 @@ from __future__ import annotations
7
7
  import dataclasses
8
8
  import io
9
9
  import json
10
+ import sys
10
11
  import typing
11
12
  from collections.abc import Iterator
12
13
  from typing import Literal
@@ -47,7 +48,12 @@ class GHPath(Traversable):
47
48
 
48
49
  @staticmethod
49
50
  def open_url(url: str) -> io.StringIO:
50
- "This method can be overridden for pyodide with pyodide.open_url"
51
+ "This method can be overridden manually for WASM. Supports pyodide currently."
52
+ if sys.platform == "emscripten":
53
+ import pyodide.http
54
+
55
+ return pyodide.http.open_url(url)
56
+
51
57
  import urllib.request # pylint: disable=import-outside-toplevel
52
58
 
53
59
  with urllib.request.urlopen(url) as response:
@@ -9,7 +9,18 @@
9
9
  "$ref": "#/$defs/checks"
10
10
  },
11
11
  "ignore": {
12
- "$ref": "#/$defs/checks"
12
+ "oneOf": [
13
+ {
14
+ "$ref": "#/$defs/checks"
15
+ },
16
+ {
17
+ "type": "object",
18
+ "patternProperties": {
19
+ "^[A-Z]+[0-9]*$": { "type": "string" }
20
+ },
21
+ "additionalProperties": false
22
+ }
23
+ ]
13
24
  }
14
25
  },
15
26
  "$defs": {
@@ -9,7 +9,7 @@ def nocolor(monkeypatch: pytest.MonkeyPatch) -> None:
9
9
  monkeypatch.delenv("FORCE_COLOR", raising=False)
10
10
 
11
11
 
12
- @pytest.fixture()
12
+ @pytest.fixture
13
13
  def no_entry_points(monkeypatch: pytest.MonkeyPatch) -> None:
14
14
  monkeypatch.setattr(
15
15
  importlib.metadata,
@@ -18,7 +18,7 @@ def no_entry_points(monkeypatch: pytest.MonkeyPatch) -> None:
18
18
  )
19
19
 
20
20
 
21
- @pytest.fixture()
21
+ @pytest.fixture
22
22
  def local_entry_points(monkeypatch: pytest.MonkeyPatch) -> None:
23
23
  orig_ep = importlib.metadata.entry_points
24
24
  ep1 = importlib.metadata.EntryPoint(
@@ -10,7 +10,7 @@ from click.testing import CliRunner
10
10
  from repo_review.__main__ import main
11
11
 
12
12
 
13
- @pytest.fixture()
13
+ @pytest.fixture
14
14
  def multiple_packages(tmp_path: Path) -> tuple[str, str]:
15
15
  packages = (tmp_path / "package_1", tmp_path / "package_2")
16
16
 
@@ -28,7 +28,7 @@ def multiple_packages(tmp_path: Path) -> tuple[str, str]:
28
28
  """
29
29
  )
30
30
 
31
- package.joinpath("pyproject.toml").write_text(basic_toml)
31
+ package.joinpath("pyproject.toml").write_text(basic_toml, encoding="utf-8")
32
32
  package.joinpath(".pre-commit-config.yaml").touch()
33
33
  package.joinpath("README.md").touch()
34
34
 
@@ -41,7 +41,7 @@ def multiple_packages(tmp_path: Path) -> tuple[str, str]:
41
41
  @pytest.mark.usefixtures("local_entry_points")
42
42
  def test_multiple_packages_rich(multiple_packages: Sequence[str]) -> None:
43
43
  runner = CliRunner()
44
- result = runner.invoke(main, [*multiple_packages])
44
+ result = runner.invoke(main, [*multiple_packages], catch_exceptions=False)
45
45
  assert result.exit_code == 0
46
46
  assert "package_1" in result.output
47
47
  assert "package_2" in result.output
@@ -51,7 +51,9 @@ def test_multiple_packages_rich(multiple_packages: Sequence[str]) -> None:
51
51
  @pytest.mark.usefixtures("local_entry_points")
52
52
  def test_multiple_packages_json(multiple_packages: Sequence[str]) -> None:
53
53
  runner = CliRunner()
54
- result = runner.invoke(main, [*multiple_packages, "--format", "json"])
54
+ result = runner.invoke(
55
+ main, [*multiple_packages, "--format", "json"], catch_exceptions=False
56
+ )
55
57
  assert result.exit_code == 0
56
58
  output = json.loads(result.output)
57
59
  assert len(output) == 2
@@ -62,7 +64,9 @@ def test_multiple_packages_json(multiple_packages: Sequence[str]) -> None:
62
64
  @pytest.mark.usefixtures("local_entry_points")
63
65
  def test_multiple_packages_html(multiple_packages: Sequence[str]) -> None:
64
66
  runner = CliRunner()
65
- result = runner.invoke(main, [*multiple_packages, "--format", "html"])
67
+ result = runner.invoke(
68
+ main, [*multiple_packages, "--format", "html"], catch_exceptions=False
69
+ )
66
70
  assert result.exit_code == 0
67
71
  tree = ET.fromstring(f"<body>{result.output}</body>")
68
72
  assert len(tree) == 2
@@ -36,16 +36,54 @@ def test_broken_validate_pyproject(tmp_path: Path) -> None:
36
36
  [tool.repo-review]
37
37
  ignore = ["a2"]
38
38
  """
39
- )
39
+ ),
40
+ encoding="utf-8",
40
41
  )
41
42
 
42
43
  results = process(tmp_path)
43
44
 
44
45
  (result,) = (r for r in results.results if r.name == "VPP001")
45
- assert "must match pattern" in result.err_msg
46
+ assert "must be valid exactly by one definition" in result.err_msg
46
47
  assert not result.result
47
48
 
48
49
 
50
+ def test_broken_validate_pyproject_object(tmp_path: Path) -> None:
51
+ pytest.importorskip("validate_pyproject")
52
+ tmp_path.joinpath("pyproject.toml").write_text(
53
+ textwrap.dedent(
54
+ """\
55
+ [tool.repo-review.ignore]
56
+ a2 = "some message"
57
+ """
58
+ ),
59
+ encoding="utf-8",
60
+ )
61
+
62
+ results = process(tmp_path)
63
+
64
+ (result,) = (r for r in results.results if r.name == "VPP001")
65
+ assert "must be valid exactly by one definition" in result.err_msg
66
+ assert not result.result
67
+
68
+
69
+ def test_working_validate_pyproject_object(tmp_path: Path) -> None:
70
+ pytest.importorskip("validate_pyproject")
71
+ tmp_path.joinpath("pyproject.toml").write_text(
72
+ textwrap.dedent(
73
+ """\
74
+ [tool.repo-review.ignore]
75
+ PP102 = "some message"
76
+ """
77
+ ),
78
+ encoding="utf-8",
79
+ )
80
+
81
+ results = process(tmp_path)
82
+
83
+ (result,) = (r for r in results.results if r.name == "VPP001")
84
+ assert result.result
85
+
86
+
49
87
  def test_testing_function():
50
88
  pytest.importorskip("sp_repo_review")
51
89
 
@@ -5,7 +5,7 @@ build-backend = "flit_core.buildapi"
5
5
  [project]
6
6
  name = "pyproject"
7
7
  version = "0.0.1"
8
- classfiers = [
8
+ classifiers = [
9
9
  "Private :: Do Not Upload",
10
10
  ]
11
11
  description = "Simple repo-review example for testing"
@@ -1,32 +0,0 @@
1
- {
2
- "problemMatcher": [
3
- {
4
- "severity": "warning",
5
- "pattern": [
6
- {
7
- "regexp": "^([^:]+):(\\d+):(\\d+): ([A-DF-Z]\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
8
- "file": 1,
9
- "line": 2,
10
- "column": 3,
11
- "code": 4,
12
- "message": 5
13
- }
14
- ],
15
- "owner": "pylint-warning"
16
- },
17
- {
18
- "severity": "error",
19
- "pattern": [
20
- {
21
- "regexp": "^([^:]+):(\\d+):(\\d+): (E\\d+): \\033\\[[\\d;]+m([^\\033]+).*$",
22
- "file": 1,
23
- "line": 2,
24
- "column": 3,
25
- "code": 4,
26
- "message": 5
27
- }
28
- ],
29
- "owner": "pylint-error"
30
- }
31
- ]
32
- }
@@ -1,22 +0,0 @@
1
- # .readthedocs.yaml
2
- # Read the Docs configuration file
3
- # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4
-
5
- # Required
6
- version: 2
7
-
8
- build:
9
- os: "ubuntu-22.04"
10
- tools:
11
- python: "3.11"
12
-
13
- # Build documentation in the docs/ directory with Sphinx
14
- sphinx:
15
- configuration: docs/conf.py
16
-
17
- python:
18
- install:
19
- - method: pip
20
- path: .
21
- extra_requirements:
22
- - docs
@@ -1,138 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import argparse
4
- import shutil
5
- from pathlib import Path
6
-
7
- import nox
8
-
9
- DIR = Path(__file__).parent.resolve()
10
-
11
- nox.needs_version = ">=2024.3.2"
12
- nox.options.default_venv_backend = "uv|virtualenv"
13
- nox.options.sessions = ["lint", "pylint", "tests"]
14
-
15
-
16
- @nox.session(reuse_venv=True)
17
- def run(session: nox.Session) -> None:
18
- """
19
- Run the program with a few example checks.
20
- """
21
-
22
- session.install("-e", ".[cli]")
23
- session.install("-e", "tests/test_utilities")
24
- session.run("python", "-m", "repo_review", *session.posargs)
25
-
26
-
27
- @nox.session
28
- def lint(session: nox.Session) -> None:
29
- """
30
- Run the linter.
31
- """
32
- session.install("pre-commit")
33
- session.run("pre-commit", "run", "--all-files", *session.posargs)
34
-
35
-
36
- @nox.session
37
- def pylint(session: nox.Session) -> None:
38
- """
39
- Run PyLint.
40
- """
41
- # This needs to be installed into the package environment, and is slower
42
- # than a pre-commit check
43
- session.install("-e.[cli]", "pylint")
44
- session.run("pylint", "src", *session.posargs)
45
-
46
-
47
- @nox.session
48
- def tests(session: nox.Session) -> None:
49
- """
50
- Run the unit and regular tests.
51
- """
52
- session.install("-e.[test,cli]")
53
- session.run("pytest", *session.posargs)
54
-
55
-
56
- @nox.session(reuse_venv=True)
57
- def build(session: nox.Session) -> None:
58
- """
59
- Build an SDist and wheel.
60
- """
61
-
62
- build_p = DIR.joinpath("build")
63
- if build_p.exists():
64
- shutil.rmtree(build_p)
65
-
66
- session.install("build")
67
- session.run("python", "-m", "build")
68
-
69
-
70
- @nox.session(venv_backend="none")
71
- def serve(session: nox.Session) -> None:
72
- """
73
- Serve the webapp.
74
- """
75
-
76
- session.cd("docs")
77
- session.log("Serving on http://localhost:8080")
78
- session.run("python3", "-m", "http.server", "8080")
79
-
80
-
81
- @nox.session(reuse_venv=True)
82
- def docs(session: nox.Session) -> None:
83
- """
84
- Build the docs. Pass "--serve" to serve.
85
- """
86
-
87
- parser = argparse.ArgumentParser()
88
- parser.add_argument("--serve", action="store_true", help="Serve after building")
89
- parser.add_argument(
90
- "-b", dest="builder", default="html", help="Build target (default: html)"
91
- )
92
- args, posargs = parser.parse_known_args(session.posargs)
93
-
94
- if args.builder != "html" and args.serve:
95
- session.error("Must not specify non-HTML builder with --serve")
96
-
97
- extra_installs = ["sphinx-autobuild"] if args.serve else []
98
-
99
- session.install("-e.[docs]", *extra_installs)
100
- session.chdir("docs")
101
-
102
- if args.builder == "linkcheck":
103
- session.run(
104
- "sphinx-build", "-b", "linkcheck", ".", "_build/linkcheck", *posargs
105
- )
106
- return
107
-
108
- shared_args = (
109
- "-n", # nitpicky mode
110
- "-T", # full tracebacks
111
- f"-b={args.builder}",
112
- ".",
113
- f"_build/{args.builder}",
114
- *posargs,
115
- )
116
-
117
- if args.serve:
118
- session.run("sphinx-autobuild", *shared_args)
119
- else:
120
- session.run("sphinx-build", "--keep-going", *shared_args)
121
-
122
-
123
- @nox.session
124
- def build_api_docs(session: nox.Session) -> None:
125
- """
126
- Build (regenerate) API docs.
127
- """
128
- session.install("sphinx")
129
- session.chdir("docs")
130
- session.run(
131
- "sphinx-apidoc",
132
- "-o",
133
- "api/",
134
- "--module-first",
135
- "--no-toc",
136
- "--force",
137
- "../src/repo_review",
138
- )
File without changes
File without changes
File without changes
File without changes
File without changes