|
1 | 1 | # Intent of this template
|
2 | 2 |
|
3 |
| -The intent of this repo is to help you get started with creating Pydra tasks. |
4 |
| -All tasks will be inserted into pydra.tasks.<yourtaskpackagename> namespace. |
| 3 | +The intent of this repository is to help you get started with creating Pydra tasks. |
| 4 | +All tasks will be inserted into the `pydra.tasks.<yourtaskpackagename>` namespace. |
5 | 5 |
|
6 |
| -# To use this template: |
| 6 | +# To use this template |
7 | 7 |
|
8 | 8 | 1. Click on new repo.
|
9 |
| -2. Select this template from the repository template drop down list. |
10 |
| -3. Give your repo a name. |
11 |
| -4. Once the repo is created and cloned, search for TODO (`grep -rn TODO . `) and |
12 |
| - replace with appropriate name. |
13 |
| -5. One of the folders is called TODO. This should also be renamed to your package |
| 9 | +1. Select this template from the repository template drop down list. |
| 10 | +1. Give your repo a name. |
| 11 | +1. Once the repo is created and cloned, search for TODO (`grep -rn TODO . `) and |
| 12 | + replace with appropriate name. |
| 13 | +1. One of the folders is called TODO. This should also be renamed to your package |
14 | 14 | name.
|
15 |
| -6. Add tasks to the pydra/tasks/<yourpackagename> folder. |
16 |
| -7. You may want to initialize a sphinx docs directory. |
| 15 | +1. Add tasks to the `pydra/tasks/<yourpackagename>` folder. |
| 16 | +1. You may want to initialize a [Sphinx] docs directory. |
| 17 | +1. **Update this README after creating the new repository.** |
17 | 18 |
|
18 |
| -# TODO: Change this README after creating your new repo. |
| 19 | +[Sphinx]: https://www.sphinx-doc.org/en/master/usage/quickstart.html |
19 | 20 |
|
| 21 | +# Features of this template |
| 22 | + |
| 23 | +## Versioneer |
| 24 | + |
| 25 | +The [versioneer](https://github.com/warner/python-versioneer) tool allows for versioning based |
| 26 | +on the most recent git tag. The release process can thus be: |
| 27 | + |
| 28 | +```Shell |
| 29 | +git tag -a 1.0.0 |
| 30 | +python setup.py sdist bdist_wheel |
| 31 | +twine upload dist/* |
| 32 | +``` |
| 33 | + |
| 34 | +Note that we assume tags will be version numbers and not be prefixed with `v` or some other |
| 35 | +string. See Versioneer documentation for alternative configurations. |
| 36 | + |
| 37 | +## Namespace packages |
| 38 | + |
| 39 | +[Namespace packages] allow multiple packages to be installed in such a way that they can be |
| 40 | +imported from a common namespace. In this case, the base namespace is `pydra.tasks`, and each |
| 41 | +task package installs a new module, such as `pydra.tasks.afni`. |
| 42 | + |
| 43 | +To do correctly, task packages **must not** interfere with files higher in the hierarchy. |
| 44 | +This includes adding `__init__.py` files in either `pydra` or `pydra/tasks`. |
| 45 | + |
| 46 | +[Namespace packages]: https://www.python.org/dev/peps/pep-0420/ |
| 47 | + |
| 48 | +## Tests |
| 49 | + |
| 50 | +This package comes with a default set of test modules, and we encourage users to use pytest. |
| 51 | +Tests can be discovered and run using: |
| 52 | + |
| 53 | +``` |
| 54 | +pytest --doctest-modules pydra/tasks/* |
| 55 | +``` |
| 56 | + |
| 57 | +## Continuous integration |
| 58 | + |
| 59 | +This template uses [GitHub Actions](https://docs.github.com/en/actions/) to run tests. To simulate |
| 60 | +several plausible development or installation environments, we test over all Python versions |
| 61 | +supported by Pydra, and install Pydra and the current package in both standard and |
| 62 | +[editable](https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs) modes. |
| 63 | + |
| 64 | +The combination of standard/editable is in particular designed to ensure that namespace packaging |
| 65 | +does not break. We strongly recommend keeping these tests in place for this reason, as one |
| 66 | +non-compliant package can potentially affect Pydra or other task packages. |
| 67 | + |
| 68 | +In addition to verifying installations do not break or conflict, pytest is run on the package, |
| 69 | +including all tests found in `test/` directories and [doctests]. |
| 70 | + |
| 71 | +[doctests]: https://docs.python.org/3/library/doctest.html |
| 72 | + |
| 73 | +# Contributing to this template |
| 74 | + |
| 75 | +This template repository is periodically updated as we establish and best practices for task |
| 76 | +packages. We welcome contributions from the community to help set a solid baseline for all |
| 77 | +task packages. |
| 78 | + |
| 79 | +# Sample post-setup README contents |
20 | 80 |
|
21 | 81 | ## For developers
|
22 | 82 |
|
|
0 commit comments