Skip to content

Commit b9b721f

Browse files
committed
Merge branch 'main' into 593-remove-docs-from-minimum
2 parents ff5a7e5 + 632f80c commit b9b721f

File tree

12 files changed

+63
-40
lines changed

12 files changed

+63
-40
lines changed

CHANGELOG.md

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## [Unreleased]
44

55
### Added
6+
67
* Keep project_setup.md for all the profiles and remove from the menu [#576](https://github.com/NLeSC/python-template/pull/576)
78
* Make contributing guidelines optional [#465](https://github.com/NLeSC/python-template/pull/465)
89
* Make linting optional [#568](https://github.com/NLeSC/python-template/pull/568)
@@ -16,8 +17,10 @@
1617
* Make citation optional [#471](https://github.com/NLeSC/python-template/pull/471)
1718
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
1819
* Make local documentation optional [#593](https://github.com/NLeSC/python-template/pull/593)
20+
* Make local test optional [#594](https://github.com/NLeSC/python-template/pull/594)
1921

2022
### Changed
23+
2124
* Update the user documentation (README.md) of the template [#575](https://github.com/NLeSC/python-template/pull/623)
2225
* Updated .gitignore [#622](https://github.com/NLeSC/python-template/pull/622)
2326
* add extra info for sub-menus [#628](https://github.com/NLeSC/python-template/pull/628)
@@ -33,6 +36,7 @@
3336
* CHANGELOG.md is now optional ([#462](https://github.com/NLeSC/python-template/issues/462))
3437

3538
### Removed
39+
3640
* Remove the configuration of isort ([#591](https://github.com/NLeSC/python-template/pull/591)), which is no longer used since [#347](https://github.com/NLeSC/python-template/issues/347).
3741

3842
## [0.5.0]
@@ -150,7 +154,6 @@ Released on Apr 22, 2021
150154
* Drop Python 3.5 support
151155
* Removed unit tests doing the linting
152156

153-
154157
## [0.2.0]
155158

156159
Released on July 17, 2019
@@ -176,14 +179,14 @@ Released on July 17, 2019
176179
* Fix example tests that failed to run (#28)
177180
* Remove quotes from project name and project description (#27)
178181
* Update prospector configuration (#26)
179-
- Make prospector less strict
180-
- Have prospector ignore the docs directory
182+
* Make prospector less strict
183+
* Have prospector ignore the docs directory
181184
* Add `install_requires` to `setup.py` (#21)
182185
* Improved .gitignore (#22)
183186
* More detailed documentation about
184-
- Project setup
185-
- Setup instructions
186-
- NOTICE file
187+
* Project setup
188+
* Setup instructions
189+
* NOTICE file
187190

188191
### Removed
189192

@@ -196,20 +199,19 @@ Released on July 12, 2018.
196199
### Added
197200

198201
* First version of the Python project template that follows the Netherlands eScience Center software development guide, containing:
199-
- Tests,
200-
- Documentation,
201-
- Code style checking
202-
- Editorconfig
203-
- Default Travis configuration
204-
- Change log
205-
- Code of Conduct
206-
- Contributing guidelines
207-
- License
208-
- Manifest.in
209-
- README
210-
- Requirements.txt
211-
- Setup configuration
212-
202+
* Tests,
203+
* Documentation,
204+
* Code style checking
205+
* Editorconfig
206+
* Default Travis configuration
207+
* Change log
208+
* Code of Conduct
209+
* Contributing guidelines
210+
* License
211+
* Manifest.in
212+
* README
213+
* Requirements.txt
214+
* Setup configuration
213215

214216
[Unreleased]: https://github.com/NLeSC/python-template//compare/0.5.0...HEAD
215217
[0.5.0]: https://github.com/NLeSC/python-template/releases/tag/0.5.0

copier/questions/features_code_quality.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ SelectCodeQualityFeatures:
77
type: yaml
88
default: |-
99
{% if template_profile == 'recommended' %}
10-
[SelectGitHubActions_flag, AddLinting_flag, AddSonarCloud_flag, AddEditorConfig_flag]
10+
[AddLocalTests_flag, SelectGitHubActions_flag, AddLinting_flag, AddSonarCloud_flag, AddEditorConfig_flag]
1111
{%- else -%}
1212
[]
1313
{%- endif %}
1414
help: Select code quality features
1515
multiselect: true
1616
choices:
17+
Local tests:
18+
value: AddLocalTests_flag
19+
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
1720
GitHub Actions (selection on the next menu):
1821
value: SelectGitHubActions_flag
1922
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
@@ -53,6 +56,10 @@ SelectGitHubActions:
5356

5457

5558
# computed features
59+
AddLocalTests:
60+
type: bool
61+
default: "{{ 'AddLocalTests_flag' in SelectCodeQualityFeatures or 'AddGitHubActionBuild_flag' in SelectGitHubActions or 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}"
62+
when: false
5663
AddGitHubActionBuild:
5764
type: bool
5865
default: "{{ 'AddGitHubActionBuild_flag' in SelectGitHubActions }}"

copier/questions/features_community.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@ SelectCommunityFeatures:
2121
value: AddContributing_flag
2222
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
2323

24+
code_of_conduct_email:
25+
when: "{{ 'AddCodeConduct_flag' in SelectCommunityFeatures }}"
26+
type: str
27+
default: "{{ email }}"
28+
help: What is the email address to report code of conduct violations?
29+
validator: >-
30+
{% if not (code_of_conduct_email | regex_search('([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+')) %}
31+
Please enter a valid email address
32+
{% endif %}
33+
2434
# computed features
2535
AddCodeConduct:
2636
type: bool

copier/questions/package_details.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ email:
3535
{% if not (email | regex_search('([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+')) %}
3636
Please enter a valid email address
3737
{% endif %}
38-
code_of_conduct_email:
39-
type: str
40-
default: "{{ email }}"
41-
help: What is the email address to report code of conduct violations?
42-
validator: >-
43-
{% if not (code_of_conduct_email | regex_search('([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@[A-Za-z0-9-]+(\.[A-Z|a-z]{2,})+')) %}
44-
Please enter a valid email address
45-
{% endif %}
4638
copyright_holder:
4739
type: str
4840
default: "{{ full_name }}"

template/project_setup.md.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ You can distribute your code using PyPI.
3535
[The guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python?id=building-and-packaging-code) can
3636
help you decide which tool to use for packaging.
3737

38+
{% if AddLocalTests -%}
3839
## Testing and code coverage
3940

4041
- Tests should be put in the `tests` folder.
@@ -47,6 +48,7 @@ help you decide which tool to use for packaging.
4748
- The project uses [GitHub action workflows](https://docs.github.com/en/actions) to automatically run tests on GitHub infrastructure against multiple Python versions
4849
- Workflows can be found in [`.github/workflows`](.github/workflows/)
4950
- [Relevant section in the guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python?id=testing)
51+
{%- endif %}
5052

5153
{% if AddLocalDocumentation -%}
5254
## Documentation

template/pyproject.toml.jinja

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,11 @@ version = "{{ version }}"
4545
dev = [
4646
"build", # build is not only used in publishing (below), but also in the template's test suite
4747
"bump-my-version",
48+
{%- if AddLocalTests %}
4849
"coverage [toml]",
4950
"pytest",
5051
"pytest-cov",
52+
{%- endif %}
5153
"ruff",
5254
"sphinx",
5355
"sphinx_rtd_theme",
@@ -78,22 +80,28 @@ Changelog = "{{ repository_url }}/CHANGELOG.md"
7880
{% if AddOnlineDocumentation -%}
7981
ReadTheDocs = "https://{{ package_name }}.readthedocs.io"
8082
{% endif %}
83+
{% if AddLocalTests -%}
8184
[tool.pytest.ini_options]
8285
testpaths = ["tests"]
86+
{% endif %}
8387

88+
{% if AddLocalTests -%}
8489
[tool.coverage.run]
8590
branch = true
8691
source = ["src/{{ package_name }}"]
8792
command_line = "-m pytest"
93+
{%- endif %}
8894

8995
[tool.tox]
9096
legacy_tox_ini = """
9197
[tox]
9298
envlist = py38,py39,py310,py311,py312
9399
skip_missing_interpreters = true
100+
{% if AddLocalTests -%}
94101
[testenv]
95102
commands = pytest
96103
extras = dev
104+
{%- endif %}
97105
"""
98106

99107
[tool.ruff]

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def hello(name: str) -> str:
2424
'Hello Jane Smith!'
2525

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

template/{% if AddContributing %}CONTRIBUTING.md{% endif %}.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@ The sections below outline the steps in each case.
3434
{% if AddDevDoc -%}
3535
1. install dependencies (see the [development documentation](README.dev.md#development_install));
3636
{%- endif %}
37+
{% if AddLocalTests -%}
3738
1. make sure the existing tests still work by running ``pytest``;
3839
1. add your own tests (if necessary);
40+
{%- endif %}
3941
1. update or expand the documentation;
4042
{% if AddChangeLog -%}
4143
1. update the `CHANGELOG.md` file with your change;

template/{% if AddDevDoc %}README.dev.md{% endif %}.jinja

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ activated virtual environment with the development tools installed.
7070

7171
```shell
7272
# linter
73-
ruff .
73+
ruff check .
7474

7575
# linter with automatic fixing
76-
ruff . --fix
76+
ruff check . --fix
7777
```
7878

7979
To fix readability of your code style you can use [yapf](https://github.com/google/yapf).

template/tests/__init__.py renamed to template/{% if AddLocalTests %}tests{% endif %}/__init__.py

File renamed without changes.

0 commit comments

Comments
 (0)