Skip to content

Commit 06519fa

Browse files
authored
fix: links for repo-review were sometimes off (#166)
* fix: links for repo-review were sometimes off Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: more corrections Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: updates to the README Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: RtD link on readme Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * fix: webapp Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent a777e54 commit 06519fa

15 files changed

Lines changed: 97 additions & 52 deletions

File tree

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ repos:
6767
- id: prettier
6868
types_or: [yaml, markdown, html, css, scss, javascript, json]
6969
args: [--prose-wrap=always]
70-
exclude: ^docs/_includes/rr.html$
7170

7271
- repo: https://github.com/codespell-project/codespell
7372
rev: "v2.2.4"

.readthedocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,6 @@ build:
1414
- asdf global ruby 3.1.2
1515
- gem install bundler
1616
- bundle install
17-
- bundle exec jekyll build --destination _readthedocs/html --baseurl $(echo -n "$READTHEDOCS_CANONICAL_URL" | cut -d '/' -f 4-)
17+
- >
18+
bundle exec jekyll build --destination _readthedocs/html --baseurl $(echo
19+
-n "$READTHEDOCS_CANONICAL_URL" | cut -d '/' -f 4-)

README.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@
22

33
[![Actions Status][actions-badge]][actions-link]
44
[![GitHub Discussion][github-discussions-badge]][github-discussions-link]
5+
[![Live ReadTheDocs][rtd-badge]][rtd-link]
56

67
A cookiecutter template for new Python projects based on the Scientific Python
78
Developer Guide. What makes this different from other cookie cutter templates
89
for Python packages?
910

10-
- Designed from the [Scientific Python Developer Guide][]: Every decision is
11+
- Lives with the [Scientific Python Development Guide][]: Every decision is
1112
clearly documented and every tool described.
12-
- Template generation tested in GitHub Actions using nox.
1313
- Twelve different backends to choose from for building packages.
14+
- Template generation tested in GitHub Actions using nox.
1415
- Includes several compiled backends using pybind11, with wheels produced for
1516
all platforms using cibuildwheel.
16-
- Follows PyPA best practices.
17+
- Follows PyPA best practices and regularly updated.
18+
- Provides `sp-repo-review` to evaluate existing repos against the guidelines,
19+
with a WebAssembly version integrated with the guide. All checks cross-linked.
1720

18-
Be sure you have read the [Scientific Python Developer Guide][] first, and
21+
Be sure you have read the [Scientific Python Development Guide][] first, and
1922
possibly used them on a project or two. This is _not_ a minimal example or
2023
tutorial. It is a collection of useful tooling for starting a new project using
2124
cookiecutter, or for copying in individual files for an existing project (by
@@ -44,7 +47,7 @@ During generation you can select from the following backends for your package:
4447
the right files included, little dynamic metadata support.
4548
9. [pdm][]: A modern, less opinionated all-in-one solution to pure Python
4649
projects supporting standards. Replaces setuptools, venv/pipenv, pip, wheel,
47-
and twine. Supports [PEP 621][], and also the unaccepted [PEP 582][].
50+
and twine. Supports [PEP 621][].
4851
10. [trampolim][]: A modern [PEP 621][] builder with support for tasks, allowing
4952
arbitrary Python to run during the build process if needed.
5053
11. [whey][]: A modern [PEP 621][] builder with some automation options for
@@ -62,7 +65,7 @@ otherwise with `pipx install cookiecutter` (or prepend `pipx run` to the command
6265
below, and skip installation). Then run:
6366

6467
```bash
65-
cookiecutter gh:scikit-hep/cookie
68+
cookiecutter gh:scientific-python/cookie
6669
```
6770

6871
You can also use `pipx run cookiecutter` without installing.
@@ -143,15 +146,21 @@ projects. It currently dumps all development dependencies into a shared
143146
environment, causing long solve times and high chance of conflicts. It also does
144147
not use pre-commit properly. It also has quite a bit of custom code.
145148

149+
#### History
150+
151+
A lot of the guide, cookiecutter, and repo-review started out as part of
152+
Scikit-HEP. These projects were merged, generalized, and combined with the
153+
NSLS-II guide during the 2023 Scientific-Python Developers Summit.
154+
146155
<!-- prettier-ignore-start -->
147156

148157
[actions-badge]: https://github.com/scikit-hep/cookie/workflows/CI/badge.svg
149158
[actions-link]: https://github.com/scikit-hep/cookie/actions
150-
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/cookie
151-
[conda-link]: https://github.com/conda-forge/cookie-feedstock
152159
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
153160
[github-discussions-link]: https://github.com/scikit-hep/cookie/discussions
154-
[scikit-hep developer guidelines]: https://scikit-hep.org/developer
161+
[rtd-badge]: https://readthedocs.org/projects/scientific-python-cookie/badge/?version=latest
162+
[rtd-link]: https://scientific-python-cookie.readthedocs.io/en/latest/?badge=latest
163+
[scientific-python development guide]: https://learn.scientific-python.org/development
155164
[cibuildwheel]: https://cibuildwheel.readthedocs.io/en/stable/
156165
[scikit-build]: https://scikit-build.readthedocs.io/en/latest/
157166
[flit]: https://flit.readthedocs.io/en/latest/
@@ -167,7 +176,6 @@ not use pre-commit properly. It also has quite a bit of custom code.
167176
[hypermodern]: https://github.com/cjolowicz/cookiecutter-hypermodern-python
168177
[hatch]: https://github.com/ofek/hatch
169178
[meson-python]: https://meson-python.readthedocs.io
170-
[pep 582]: https://www.python.org/dev/peps/pep-0582
171179
[pep 621]: https://www.python.org/dev/peps/pep-0621
172180

173181
<!-- prettier-ignore-end -->

docs/_includes/rr.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
<span class="rr-btn" id="{{ include.id }}">{{ include.id }}</span>
1+
<!-- prettier-ignore -->
2+
<span class="rr-btn" id="{{ include.id }}">{{ include.id }}</span>

docs/assets/js/webapp.js

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ function Heading(props) {
1414
component="div"
1515
sx={{ flexGrow: 1 }}
1616
>
17-
Scikit-HEP-Repo-Review
17+
SP-Repo-Review
1818
</MaterialUI.Typography>
1919
<MaterialUI.Button
20-
href="https://scientific-python-cookie.readthedocs.io"
20+
href="https://learn.scientific-python.org/development"
2121
color="inherit"
2222
>
2323
Developer Guidelines
2424
</MaterialUI.Button>
2525
<MaterialUI.Button
26-
href="https://github.com/scikit-hep/repo-review"
26+
href="https://github.com/scientific-python/repo-review"
2727
color="inherit"
2828
>
2929
Source
@@ -34,6 +34,34 @@ function Heading(props) {
3434
);
3535
}
3636

37+
function IfUrlLink({ name, url, color }) {
38+
if (url) {
39+
return (
40+
<MaterialUI.Typography
41+
sx={{ display: "inline" }}
42+
component="span"
43+
variant="body2"
44+
color={color}
45+
component="a"
46+
href={url}
47+
target="_blank"
48+
>
49+
{name}
50+
</MaterialUI.Typography>
51+
);
52+
}
53+
return (
54+
<MaterialUI.Typography
55+
sx={{ display: "inline" }}
56+
component="span"
57+
variant="body2"
58+
color={color}
59+
>
60+
{name}
61+
</MaterialUI.Typography>
62+
);
63+
}
64+
3765
function Results(props) {
3866
const output = [];
3967
for (const key in props.results) {
@@ -77,14 +105,8 @@ function Results(props) {
77105
);
78106
const msg = (
79107
<React.Fragment>
80-
<MaterialUI.Typography
81-
sx={{ display: "inline" }}
82-
component="span"
83-
variant="body2"
84-
color={text_color}
85-
>
86-
{result.name + ": "}
87-
</MaterialUI.Typography>
108+
<IfUrlLink name={result.name} url={result.url} color={text_color} />
109+
<IfUrlLink name={": "} url={""} color={text_color} />
88110
<React.Fragment>
89111
<MaterialUI.Typography
90112
sx={{ display: "inline" }}
@@ -100,7 +122,11 @@ function Results(props) {
100122
return (
101123
<MaterialUI.ListItem disablePadding key={result.name}>
102124
<MaterialUI.ListItemIcon>{icon}</MaterialUI.ListItemIcon>
103-
<MaterialUI.ListItemText primary={msg} secondary={details} />
125+
<MaterialUI.ListItemText
126+
primary={msg}
127+
secondary={details}
128+
href={result.url}
129+
/>
104130
</MaterialUI.ListItem>
105131
);
106132
});
@@ -132,7 +158,7 @@ async function prepare_pyodide() {
132158
await pyodide.loadPackage("micropip");
133159
await pyodide.runPythonAsync(`
134160
import micropip
135-
await micropip.install(["scikit_hep_repo_review==0.6.1"])
161+
await micropip.install(["sp_repo_review==2023.06.01", "repo-review==0.7.0b4"])
136162
`);
137163
return pyodide;
138164
}
@@ -171,6 +197,7 @@ class App extends React.Component {
171197
msg: DEFAULT_MSG,
172198
progress: false,
173199
err_msg: "",
200+
url: "",
174201
};
175202
}
176203

@@ -199,8 +226,8 @@ class App extends React.Component {
199226
try {
200227
families_checks = pyodide.runPython(`
201228
from pyodide.http import open_url
202-
from scikit_hep_repo_review.processor import process
203-
from scikit_hep_repo_review.ghpath import GHPath
229+
from repo_review.processor import process
230+
from repo_review.ghpath import GHPath
204231
205232
GHPath.open_url = staticmethod(open_url)
206233
@@ -239,6 +266,7 @@ class App extends React.Component {
239266
description: val.description.toString(),
240267
state: val.result,
241268
err_msg: val.err_markdown().toString(),
269+
url: val.url.toString(),
242270
});
243271
}
244272

@@ -248,6 +276,7 @@ class App extends React.Component {
248276
msg: `Results for ${state.repo}@${state.branch}`,
249277
progress: false,
250278
err_msg: "",
279+
url: "",
251280
});
252281

253282
results_list.destroy();

docs/pages/guides/gha_basic.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
33
title: "GHA: GitHub Actions intro"
4-
permalink: /guides/gha_basic/
4+
permalink: /guides/gha-basic/
55
nav_order: 11
66
parent: Topical Guides
77
custom_title: GitHub Actions introduction

docs/pages/guides/gha_pure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
33
title: "GHA: Pure Python wheels"
4-
permalink: /guides/gha_pure/
4+
permalink: /guides/gha-pure/
55
nav_order: 12
66
parent: Topical Guides
77
custom_title: GitHub Actions for pure Python wheels

docs/pages/guides/gha_wheels.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: page
33
title: "GHA: Binary wheels"
4-
permalink: /guides/gha_wheels/
4+
permalink: /guides/gha-wheels/
55
nav_order: 13
66
parent: Topical Guides
77
custom_title: GitHub Actions for Binary Wheels
@@ -39,10 +39,9 @@ click a button in the GUI to trigger a build, which is perfect for testing
3939
wheels before making a release; you can download them from "artifacts". You can
4040
even define variables that you can set in the GUI and access in the CI!
4141

42-
[workflow_dispatch]:
43-
https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
44-
4542
<!-- prettier-ignore-start -->
43+
[workflow_dispatch]: https://github.blog/changelog/2020-07-06-github-actions-manual-triggers-with-workflow_dispatch/
44+
4645
### Useful suggestion:
4746
{: .no_toc }
4847
<!-- prettier-ignore-end -->

docs/pages/guides/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: page
33
title: Topical Guides
44
permalink: /guides/
5-
nav_order: 3
5+
nav_order: 2
66
has_children: true
77
---
88

File renamed without changes.

0 commit comments

Comments
 (0)