Skip to content

Commit ad06d33

Browse files
committed
Merge branch 'main' into 514_linting
2 parents 9868aee + 8b05160 commit ad06d33

File tree

6 files changed

+112
-107
lines changed

6 files changed

+112
-107
lines changed
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
## Checklist before submitting a bug report
11+
12+
- [ ] I have checked the [existing issues](https://github.com/NLeSC/python-template/issues) and couldn't find an issue about this bug.
13+
14+
## Bug details
15+
16+
**Describe the bug**
17+
18+
A clear and concise description of what the bug is.
19+
20+
**To Reproduce**
21+
22+
Steps to reproduce the behavior:
23+
1. install copier using '...'
24+
2. run `copier copy ...`
25+
3. Select Pre-commit feature
26+
4. ...
27+
28+
**Error Message**
29+
30+
If applicable, add the error message.
31+
32+
**Expected behavior**
33+
34+
A clear and concise description of what you expected to happen.
35+
36+
**Screenshots**
37+
38+
If applicable, add screenshots to help explain your problem.
39+
40+
**Desktop (please complete the following information):**
41+
42+
- OS:
43+
<!-- run this command: uname -a -->
44+
- version:
45+
<!-- run this command: python -c "import kunefe; print(kunefe.__version__)" -->
46+
47+
**Additional context**
48+
49+
Add any other context about the problem here.

.github/PULL_REQUEST_TEMPLATE.md

+50-16
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,69 @@
1-
**Description**
2-
1+
## Checklist before requesting a review
2+
<!-- partly taken from https://axolo.co/blog/p/part-3-github-pull-request-template -->
33
- [ ] I have read the [contribution guidelines](https://github.com/NLeSC/python-template/blob/main/CONTRIBUTING.md)
4-
- [ ] This update is in line with what is recommended in the [Python chapter of the Guide](https://guide.esciencecenter.nl/#/best_practices/language_guides/python)
4+
- [ ] My code follows the style guidelines of this project
5+
- [ ] I have performed a self-review of my code
6+
- [ ] I have commented my code, particularly in hard-to-understand areas
7+
- [ ] I have made corresponding changes to the documentation
8+
- [ ] My changes generate no new warnings
9+
- [ ] I have added tests that prove my fix is effective or that my feature works
10+
- [ ] New and existing unit tests pass locally with my changes
511
- [ ] All user facing changes have been added to CHANGELOG.md
12+
<!-- - [ ] Any dependent changes have been merged and published in downstream modules -->
13+
14+
## Type of change
15+
16+
Please delete options that are not relevant.
17+
18+
- [ ] Bug fix (non-breaking change which fixes an issue)
19+
- [ ] New feature (non-breaking change which adds functionality)
20+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
21+
- [ ] This change requires a documentation update
22+
23+
## List of related issues or pull requests**
624

7-
<!-- Description of PR -->
25+
<!-- add all related issues to the list below -->
26+
Refs:
27+
- #ISSUE_NUMBER_1
28+
- #ISSUE_NUMBER_2
829

9-
<!--
10-
**Related issues**:
11-
- ...
12-
-->
30+
## Describe the changes made in this pull request
31+
32+
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
1333

1434
**Instructions to review the pull request**
1535

16-
<!-- remove what doesn't apply or add more if needed -->
17-
Create a `python-template-test` repo on GitHub (will be overwritten if existing)
36+
<!-- remove/update what doesn't apply or add more if needed -->
37+
38+
Install the requirements
39+
1840
```
19-
# Create a temporary directory by running the following command. Keep the XXXXXX in the directory name.
2041
cd $(mktemp -d --tmpdir py-tmpl-XXXXXX)
21-
# Use --vcs-ref <pr-branch> to point to the branch you want to test
22-
copier copy --vcs-ref <pr-branch> https://github.com/<pr-user>/python-template .
23-
# Fill with python-template-test info
24-
# Create a local git repo to push to GitHub to trigger CI actions
42+
pip install pipx
43+
pipx install copier
44+
```
45+
46+
Create a new package using the template
47+
48+
```
49+
copier copy --vcs-ref <YOUR_BRANCH> https://github.com/nlesc/python-template test_package
50+
```
51+
52+
Create a local git repo to push to GitHub to trigger CI actions
53+
```
2554
git init
2655
git add --all
2756
git commit -m "First commit"
28-
git remote add origin git@github.com:<you>/python-template-test.git
57+
git remote add origin git@github.com:<YOU>/python-template-test.git
2958
git push -u origin main -f
59+
```
60+
61+
```
3062
# Create a local environment to test your generated package locally
3163
python -m venv env
3264
source env/bin/activate
3365
python -m pip install --upgrade pip setuptools
3466
python -m pip install '.[dev,publishing]'
3567
```
68+
69+
<!-- Other steps -->

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Added
66
* Make linting optional [#568](https://github.com/NLeSC/python-template/pull/568)
7+
* Make editorconfig optional [#571](https://github.com/NLeSC/python-template/pull/571)
78
* Make contributing guidelines optional [#465]()
89
* Make developer documentation optional [#467](https://github.com/NLeSC/python-template/pull/541)
910
* Make Code of Conduct optional [#464](https://github.com/NLeSC/python-template/pull/530)
@@ -14,6 +15,7 @@
1415
* Make online documentation optional [#476](https://github.com/NLeSC/python-template/pull/476)
1516

1617
### Changed
18+
* Updated the user documentation (README.md) of the template [#569](https://github.com/NLeSC/python-template/pull/569)
1719
* Droped Python 3.8 and 3.9 support [#551](https://github.com/NLeSC/python-template/pull/551)
1820
* Fix broken link checker [#546](https://github.com/NLeSC/python-template/pull/546)
1921
* pre-commit script is optional ([#457](https://github.com/NLeSC/python-template/issues/457))

README.md

+5-83
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Netherlands eScience Center Python Template
22

3-
Spend less time setting up and configuring your new Python packages and comply with the [Netherlands eScience Center Software Development Guide](https://guide.esciencecenter.nl/) from the start.
3+
Spend less time setting up and configuring your new Python packages which includes research software good practices from the start.
44

55
Use this [Copier](https://copier.readthedocs.io) template to generate an empty Python package. Features include:
66

@@ -64,95 +64,17 @@ pipx install copier
6464
6565
### Scenario 1: Create a new package
6666

67-
68-
#### Step 1/2: Create the files and directory structure
69-
7067
Run `copier copy` with the template:
7168

7269
```shell
73-
# Notes:
74-
# 1. Make sure that `path/to/destination` is an empty directory
75-
# 2. See table below for explanation of each question
76-
# 3. The files will be generated in the specified destination directory
7770
copier copy https://github.com/nlesc/python-template.git path/to/destination
7871
```
7972

80-
| Name | Default value | Explanation |
81-
| ------------------------- | ------------- | ----------- |
82-
| package_name | my_python_package | Name of the package. Avoid using spaces, dashes, or uppercase letters for the best experience across operating systems. This also will be used as the github repository name.|
83-
| package_short_description | Short description of package | The information that you enter here will end up in the README, documentation, license, and pyproject.toml, so it may be a good idea to prepare something in advance. |
84-
| keyword1 | keyword1 | A term that describes your package. |
85-
| keyword2 | keyword2 | Another term that describes your package. |
86-
| version | 0.1.0 | &nbsp; |
87-
| github_organization | &lt;my-github-organization&gt; | GitHub organization that will contain this project's repository. This can also be your GitHub user name. |
88-
| license | Apache Software License 2.0 | The software license under which the code is made available. |
89-
| full_name | Jane Smith | Your full name, e.g. _Jane Smith_. |
90-
| email | yourname@esciencecenter.nl | Your (work) email address. |
91-
| copyright_holder | Netherlands eScience Center | Name(s) of the organization(s) or person(s) who hold the copyright of the software. |
92-
| code_of_conduct_email | yourname@esciencecenter.nl | Email address of the person who should be contacted in case of violations of the Code of Conduct. |
93-
94-
Once the project files have been generated, follow the steps outlined in
95-
[next_steps.md](template/next_steps.md.jinja).
96-
97-
#### Step 2/2: Read about what was just generated
98-
99-
Good job! You have now generated the skeleton for your package:
100-
101-
```text
102-
.
103-
├── CHANGELOG.md
104-
├── CITATION.cff
105-
├── CODE_OF_CONDUCT.md
106-
├── CONTRIBUTING.md
107-
├── .copier-answers.yml
108-
├── docs
109-
│   ├── conf.py
110-
│   ├── index.rst
111-
│   ├── make.bat
112-
│   ├── Makefile
113-
│   └── _templates
114-
│   └── .gitignore
115-
├── .editorconfig
116-
├── .githooks
117-
│   └── pre-commit
118-
├── .github
119-
│   ├── next_steps
120-
│   │   ├── 01_sonarcloud_integration.md
121-
│   │   ├── 02_citation.md
122-
│   │   ├── 03_readthedocs.md
123-
│   │   ├── 04_zenodo_integration.md
124-
│   │   └── 05_linting.md
125-
│   └── workflows
126-
│   ├── build.yml
127-
│   ├── cffconvert.yml
128-
│   ├── documentation.yml
129-
│   ├── markdown-link-check.yml
130-
│   ├── next_steps.yml
131-
│   └── sonarcloud.yml
132-
├── .gitignore
133-
├── MANIFEST.in
134-
├── .mlc-config.json
135-
├── next_steps.md
136-
├── NOTICE
137-
├── project_setup.md
138-
├── pyproject.toml
139-
├── README.dev.md
140-
├── README.md
141-
├── .readthedocs.yaml
142-
├── sonar-project.properties
143-
├── src
144-
│   └── my_python_package
145-
│   ├── __init__.py
146-
│   └── my_module.py
147-
├── tests
148-
│   ├── __init__.py
149-
│   ├── test_my_module.py
150-
│   ├── test_project.py
151-
│   └── test_values.py
152-
└── .zenodo.json
153-
```
73+
> [!NOTE]
74+
> 1. Make sure that `path/to/destination` is an empty directory
75+
> 1. Based on the profile and selected features, the package will be generated in the specified destination directory
15476
155-
For an explanation of what's there, read on in the [project_setup.md](template/project_setup.md.jinja) file.
77+
For an explanation of what's there, read on in the `project_setup.md` file.
15678

15779
### Scenario 2: Apply to pre-existing code
15880

copier/questions/features_code_quality.yml

+6-8
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ SelectCodeQualityFeatures:
77
type: yaml
88
default: |-
99
{% if template_profile == 'recommended' %}
10-
[SelectGitHubActions_flag, AddLinting_flag, AddSonarCloud_flag, not_implemented_editor_config]
10+
[SelectGitHubActions_flag, AddLinting_flag, AddSonarCloud_flag, AddEditorConfig_flag]
1111
{%- else -%}
1212
[]
1313
{%- endif %}
@@ -26,8 +26,8 @@ SelectCodeQualityFeatures:
2626
Code analysis (using SonarCloud):
2727
value: AddSonarCloud_flag
2828
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
29-
Editorconfig (NOT_IMPLEMENTED):
30-
value: not_implemented_editor_config
29+
Editorconfig:
30+
value: AddEditorConfig_flag
3131
# validator: "{% if something != 'AnotherThing' %}BlaBla{% endif %}"
3232

3333

@@ -60,28 +60,26 @@ AddGitHubActionBuild:
6060
type: bool
6161
default: "{{ 'AddGitHubActionBuild_flag' in SelectGitHubActions }}"
6262
when: false
63-
6463
AddGitHubActionDocumentation:
6564
type: bool
6665
default: "{{ 'AddGitHubActionDocumentation_flag' in SelectGitHubActions }}"
6766
when: false
68-
6967
AddLinkCheck:
7068
type: bool
7169
default: "{{ 'AddLinkCheck_flag' in SelectGitHubActions }}"
7270
when: false
73-
7471
AddPreCommit:
7572
type: bool
7673
default: "{{ 'AddPreCommit_flag' in SelectCodeQualityFeatures }}"
7774
when: false
78-
7975
AddSonarCloud:
8076
type: bool
8177
default: "{{ 'AddSonarCloud_flag' in SelectCodeQualityFeatures }}"
8278
when: false
83-
8479
AddLinting:
8580
type: bool
8681
default: "{{ 'AddLinting_flag' in SelectCodeQualityFeatures }}"
82+
AddEditorConfig:
83+
type: bool
84+
default: "{{ 'AddEditorConfig_flag' in SelectCodeQualityFeatures }}"
8785
when: false

0 commit comments

Comments
 (0)