Skip to content

Commit 476d61d

Browse files
committed
Update packaing guide and repo-review to match spec13
See scientific-python/specs#324
1 parent 8dec1ed commit 476d61d

15 files changed

+93
-20
lines changed

.github/workflows/reusable-rr-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
python-version: ${{ matrix.python-version }}
2929

3030
- name: Install package
31-
run: python -m pip install .[test,cli]
31+
run: python -m pip install .[tests,cli]
3232

3333
- name: Test package
3434
run: python -m pytest -ra

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ backports structure with a small typing example.
143143
- An pylint nox target can be used to run pylint, which integrated GHA
144144
annotations
145145
- A ReadTheDocs-ready Sphinx docs folder and `[docs]` extra
146-
- A test folder and pytest `[test]` extra
146+
- A test folder and pytest `[tests]` extra
147147
- A noxfile is included with a few common targets
148148

149149
Setuptools only:

docs/_includes/pyproject.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Here is an example of a simple extras:
5858

5959
```toml
6060
[project.optional-dependencies]
61-
test = [
61+
tests = [
6262
"pytest >=6.0",
6363
]
6464
mpl = [

docs/pages/guides/gha_basic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ tests:
115115
allow-prereleases: true
116116
117117
- name: Install package
118-
run: python -m pip install -e .[test]
118+
run: python -m pip install -e .[tests]
119119
120120
- name: Test package
121121
run: python -m pytest

docs/pages/guides/gha_wheels.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ test-command = "pytest {project}/tests"
6262
build-verbosity = 1
6363
```
6464

65-
The `test-extras` will cause the pip install to use `[test]`. The `test-command`
66-
will use pytest to run your tests. You can also set the build verbosity (`-v` in
67-
pip) if you want to.
65+
The `test-extras` will cause the pip install to use `[tests]`. The
66+
`test-command` will use pytest to run your tests. You can also set the build
67+
verbosity (`-v` in pip) if you want to.
6868

6969
## Making an SDist
7070

docs/pages/guides/packaging_classic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ called `package`:
376376

377377
```ini
378378
[options.extras_require]
379-
test =
379+
tests =
380380
pytest >=6.0
381381
mpl =
382382
matplotlib >=2.0

docs/pages/guides/tasks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def tests(session: nox.Session) -> None:
105105
"""
106106
Run the unit and regular tests.
107107
"""
108-
session.install(".[test]")
108+
session.install(".[tests]")
109109
session.run("pytest", *session.posargs)
110110
```
111111

@@ -212,7 +212,7 @@ def tests(session: nox.Session) -> None:
212212
"""
213213
Run the unit and regular tests.
214214
"""
215-
session.install(".[test]")
215+
session.install(".[tests]")
216216
session.run("pytest", *session.posargs)
217217
```
218218
<!-- prettier-ignore-end -->

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def tests(session: nox.Session, backend: str, vcs: bool) -> None:
224224
session.chdir(cookie)
225225

226226
name = f"cookie-{backend}"
227-
session.install(".[test]")
227+
session.install(".[tests]")
228228
session.run("python", "-m", "pytest", "-ra")
229229
version = session.run(
230230
"python",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ dependencies = [
3939
cli = [
4040
"repo-review[cli]",
4141
]
42-
test = [
42+
tests = [
4343
"pytest >=7",
4444
"repo-review >=0.10.6",
4545
]

src/sp_repo_review/checks/general.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,23 @@ class PY004(General):
6464

6565
@staticmethod
6666
def check(package: Traversable) -> bool:
67-
"Projects must have documentation in a folder called docs (disable if not applicable)"
67+
"Projects must have documentation in a folder called doc or docs (disable if not applicable)"
6868
return len([p for p in package.iterdir() if "doc" in p.name]) > 0
6969

7070

71+
class PY004b(General):
72+
"Documentation folder should be `docs` not `doc`"
73+
74+
requires = {"PY004"}
75+
76+
url = mk_url("packaging-simple")
77+
78+
@staticmethod
79+
def check(package: Traversable) -> bool:
80+
"Projects must have documentation in a folder called `docs` not `doc`"
81+
return any(p.name == "docs" for p in package.iterdir())
82+
83+
7184
class PY005(General):
7285
"Has tests folder"
7386

0 commit comments

Comments
 (0)