Skip to content

Commit e24ffd3

Browse files
committed
Merge branch 'main' into 430_minimal_profile
2 parents 2cecd60 + d45829b commit e24ffd3

File tree

7 files changed

+49
-48
lines changed

7 files changed

+49
-48
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: ".github/workflows"
5+
schedule:
6+
interval: "daily"

.github/workflows/markdown-link-check.yml

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,27 @@ on:
77
pull_request:
88
branches:
99
- main
10+
schedule:
11+
- cron: '0 0 * * 0' # every Sunday at 00:00
1012

1113
jobs:
12-
13-
markdown-link-check:
14-
name: Check markdown links
14+
linkChecker:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v4
18-
- uses: gaurav-nelson/github-action-markdown-link-check@v1
19-
with:
20-
use-quiet-mode: 'yes'
21-
config-file: '.mlc-config.json'
17+
- uses: actions/checkout@v4
18+
19+
- name: Link Checker
20+
id: lychee
21+
uses: lycheeverse/lychee-action@v1
22+
with:
23+
# fail action if there are broken links
24+
fail: true
25+
26+
- name: Create Issue From File
27+
# create issues only when triggered by schedule
28+
if: github.event_name == 'schedule' && env.lychee_exit_code != 0
29+
uses: peter-evans/create-issue-from-file@v5
30+
with:
31+
title: Link Checker Report
32+
content-filepath: ./lychee/out.md
33+
labels: report, automated issue

.mlc-config.json

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

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ Spend less time setting up and configuring your new Python packages and comply w
55
Use this [Copier](https://copier.readthedocs.io) template to generate an empty Python package. Features include:
66

77
- Boilerplate unit tests and documentation,
8-
- [Python static setup configuration](template/pyproject.toml),
8+
- [Python static setup configuration](template/pyproject.toml.jinja),
99
- Open source software license,
1010
- Continuous integration with [GitHub action workflows](template/.github/workflows) for building, testing, link checking and linting,
1111
- Code style checking with [ruff](https://beta.ruff.rs/),
1212
- [Editorconfig](template/.editorconfig),
1313
- Usage and contribution documents:
14-
- [README.md](template/README.md) for package users,
15-
- [README.dev.md](template/README.dev.md) for package developer,
16-
- [project_setup.md](template/project_setup.md) with extensive documentation about project setup,
14+
- [README.md](template/README.md.jinja) for package users,
15+
- [README.dev.md](template/README.dev.md.jinja) for package developer,
16+
- [project_setup.md](template/project_setup.md.jinja) with extensive documentation about project setup,
1717
- [Change log](template/CHANGELOG.md),
18-
- [Code of Conduct](template/CODE_OF_CONDUCT.md),
19-
- [Contributing guidelines](template/CONTRIBUTING.md),
18+
- [Code of Conduct](template/CODE_OF_CONDUCT.md.jinja),
19+
- [Contributing guidelines](template/CONTRIBUTING.md.jinja),
2020
- Continuous code quality and code coverage reporting using [Sonarcloud](https://sonarcloud.io/),
2121
- Automatic creation of [issues](template/.github/next_steps) with instructions how to pass all GitHub action workflows and integrate with services like Zenodo and Read the Docs,
22-
- Instructions how to make package [citable](template/.github/next_steps/02_citation.md)
22+
- Instructions how to make package [citable](template/.github/next_steps/02_citation.md.jinja)
2323
- FAIR software recommendation badge,
24-
- Optional [pre commit hook](template/README.dev.md#running-linters-locally) to catch lint errors early
24+
- Optional [pre commit hook](template/README.dev.md.jinja#running-linters-locally) to catch lint errors early
2525

2626
## Badges
2727

@@ -92,7 +92,7 @@ copier copy https://github.com/nlesc/python-template.git path/to/destination
9292
| code_of_conduct_email | [email protected] | Email address of the person who should be contacted in case of violations of the Code of Conduct. |
9393

9494
Once the project files have been generated, follow the steps outlined in
95-
[next_steps.md](template/next_steps.md).
95+
[next_steps.md](template/next_steps.md.jinja).
9696

9797
#### Step 2/2: Read about what was just generated
9898

@@ -152,7 +152,7 @@ Good job! You have now generated the skeleton for your package:
152152
└── .zenodo.json
153153
```
154154

155-
For an explanation of what's there, read on in the [project_setup.md](template/project_setup.md) file.
155+
For an explanation of what's there, read on in the [project_setup.md](template/project_setup.md.jinja) file.
156156

157157
### Scenario 2: Apply to pre-existing code
158158

template/pyproject.toml.jinja

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ extras = dev
102102
[tool.ruff]
103103
line-length = 120
104104
output-format = "concise"
105+
extend-exclude = ["docs"]
105106

106107
[tool.ruff.lint]
107108
# Allow unused variables when underscore-prefixed.
@@ -126,7 +127,15 @@ ignore = [
126127
]
127128
pydocstyle.convention = "google"
128129

129-
[tool.ruff.isort]
130+
[tool.ruff.lint.per-file-ignores]
131+
# Tests can ignore a few extra rules
132+
"tests/**.py" = [
133+
"ANN201", # Missing return type annotation for public function
134+
"PT011", # Missing `match` parameter in `pytest.raises()`
135+
"S101", # Use of assert is detected
136+
]
137+
138+
[tool.ruff.lint.isort]
130139
known-first-party = ["{{ package_name }}"]
131140
force-single-line = true
132141
no-lines-before = ["future","standard-library","third-party","first-party","local-folder"]

template/src/{{package_name}}/my_module.py.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ def hello(name: str) -> str:
2525

2626
"""
2727
if name == 'nobody':
28-
raise ValueError('Can not say hello to nobody')
28+
msg = 'Can not say hello to nobody'
29+
raise ValueError(msg)
2930
return f'Hello {name}!'

template/tests/test_my_module.py.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ def some_name():
2121
return 'Jane Smith'
2222

2323

24-
def test_hello_with_fixture(some_name):
24+
def test_hello_with_fixture(some_name: str):
2525
"""Example using a fixture."""
2626
assert hello(some_name) == 'Hello Jane Smith!'

0 commit comments

Comments
 (0)