- Notifications
You must be signed in to change notification settings - Fork83
Netherlands eScience Center Python Template
License
NLeSC/python-template
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Spend less time setting up and configuring your new Python packages by using this template. ThisCopier template includes best practices for research software so your new package will include these practices from the start.
You can choose from various user profiles, each offering a range of features to suit your needs.
The template profiles for a Python package offer varying levels of customization to cater to different user needs. Below are the profiles the template offers.
This profile offers the essential features to begin developing a Python package, making it ideal for first-time research software developers. Additional features can be added as needed.
This option provides a pre-selected set of features for research software, which users can fully customize.
This fully customizable profile enables you to selectively include or exclude features in your Python package.
- Boilerplate unit tests and documentation,
- Python static setup configuration,
- Open source software license,
- Continuous integration withGitHub action workflows for building, testing, link checking and linting,
- Code style checking withruff,
- Editorconfig,
- Usage and contribution documents:
- README.md for package users,
- README.dev.md for package developer,
- project_setup.md with extensive documentation about project setup,
- Changelog,
- Code of Conduct,
- Contributing guidelines,
- Continuous code quality and code coverage reporting usingSonarcloud,
- Automatic creation ofissues with instructions how to pass all GitHub action workflows and integrate with services like Zenodo and Read the Docs,
- Instructions how to make packagecitable
- FAIR software recommendation badge,
- Optionalpre commit hook to catch lint errors early
There are multiple scenarios to use this template:
- Scenario 1: Generating a new package using template
- Scenario 2: Applying the template to some pre-existing code
- Scenario 3: Updating a package made with the template
In all three scenarios, you will need to install Copier first, which werecommend doing withpipx:
python3 -m pip install --user pipxpython3 -m pipx ensurepathpipx install copier
Note
Note that it is also possible to install Copier with regularpip, but thatCopier will then be installed in your common environment and may causeconflicts with its dependencies, whilepipx will install Copier in aseparate and dedicated environment.
Runcopier copy with the template:
copier copy https://github.com/nlesc/python-template.git path/to/destination
Note
- Make sure that
path/to/destinationis an empty directory - Based on the profile and selected features, the package will be generated in the specified destination directory
For an explanation of what's there, read on in theproject_setup.md file.
To apply the template to pre-existing code, you can use the samecopier copycommand as when creating a new package, except that you point to the foldercontaining your existing code rather than a new one:
copier copy https://github.com/nlesc/python-template.git path/to/existing/code
This works because ifpath/to/destination already exists, Copier willupdate what is already there by either adding new files or updatingexisting files. Copier will ask to overwrite any files that resulted inconflicts. Especially if your files are already under version control, it isrecommended to answer 'yes' for all files, you will still be able to reviewthe changes suggested by the template.
Copier provides the functionality for re-applying the template to a previouslycreated project using thecopier update command. This has two effects:
- Your project will be updated according to the latest version of the template
- You can change any of your previous answers to apply these changesthroughout your entire project.
Caution
Do not manually update answers in.copier-answers.yml,as it will result in unexpected behavior.
cd path/to/projectcopier updateIf you don't want to change any of your answers, but only want to update yourproject according to the latest template updates, you can provide the--skip-answered option. This tells Copier to reuse all of your previousanswers, and simply bring in all updates from the template intoyour current project, such as updating which Python versions are supported.You will still be asked to answer any new questions that have been added tothe template since you last applied it.
copier update --skip-answered
Many developers have gone before you in using this template to get started quickly. Check out their projects in thelist below:
- Cerise:https://github.com/MD-Studio/cerise
- cerulean:https://github.com/MD-Studio/cerulean
- cffconvert:https://github.com/citation-file-format/cff-converter-python
- fairtally:https://github.com/fair-software/fairtally
- howfairis:https://github.com/fair-software/howfairis
- matchms:https://github.com/matchms/matchms
- MUSCLE 3:https://github.com/multiscale/muscle3
- pycff:https://github.com/citation-file-format/pycff
- spec2vec:https://github.com/iomega/spec2vec
- yatiml:https://github.com/yatiml/yatiml
- ... And many more (seethis discussion). Make a PR to add your project here, or simply ping us in an issue!
Suggestions/improvements/edits are most welcome. Please read thecontribution guidelines before creating an issue or a pull request.
About
Netherlands eScience Center Python Template
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
