You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ contributions.
43
43
-[General guidelines](#general-guidelines)
44
44
-[Fork the repository](#fork-the-repository)
45
45
-[Clone the repository](#clone-the-repository)
46
-
-[Setting up Nox](#setting-up-nox)
46
+
-[Setting up nox](#setting-up-nox)
47
47
-[Setting up your environment](#setting-up-your-environment)
48
48
-[Make a branch](#make-a-branch)
49
49
-[Make your changes](#make-your-changes)
@@ -173,7 +173,7 @@ You can install nox with `pip install nox`.
173
173
174
174
### Setting up your environment
175
175
176
-
Run the following `make`command to create a new environment and install the package dependencies. If you don't have / want to install make, just copy the commands from the Makefile file and run them in the terminal.
176
+
Run the following `make`commands to create a new environment and install the package dependencies. If you don't have / want to install make, just copy the commands from the Makefile file and run them in the terminal.
177
177
178
178
```
179
179
make create
@@ -387,7 +387,6 @@ Follow all the above instructions for formatting. Push your changes to a new or
387
387
388
388
Open a new issue, selecting the `Release-Checklist` template, and follow the direction there.
389
389
390
-
391
390
### PyPI (pip)
392
391
PyPI release are made automatically via GitHub actions whenever a pull request is merged.
Copy file name to clipboardExpand all lines: README.md
+9-7Lines changed: 9 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ The below steps will create a complete Python package with testing, a documentat
14
14
15
15
Steps:
16
16
1) Initiate your repository:
17
-
-On this [template's page](https://github.com/mdtanker/python_package_template), click the `Use this template` button to `Create a new repository`.
17
+
-on this [template's page](https://github.com/mdtanker/python_package_template), click the `Use this template` button to `Create a new repository`.
18
18
- choose a project name
19
19
- for simplicity, this name will be used for all of the follow: the folder name that holds this repository as well as the code folder under `src/`, the name of the python package on both PyPI and Conda-Forge, and the repository name on GitHub. Because of these constraints, the best choice is a lowercase word with no spaces or punctuation. While capitalization and punctuation may help readability, they greatly increase the hassle during various stages of the packaging. Ensure your chosen name is available on both [PyPI](https://pypi.org/) and [Conda-Forge](https://conda-forge.org/packages/).
20
20
- choose if you want the repository in your personal account or in one of your organization's accounts.
@@ -35,7 +35,7 @@ Steps:
35
35
- replace all instances of `yourname` with your name
36
36
- your name can be "Maintainers of <samplepackagename>" if there are multiple people.
37
37
- replace all instances of `organizationname` with your GitHub organization (or personal) account name, whichever is going to host the repository.
38
-
- update `pyproject.yml` with a description (1 sentence) and keywords ()
38
+
- update `pyproject.yml` with a description (1 sentence) and keywords.
39
39
- add a description of your project here in the README, in `docs/index.md`, and in `.zenodo.json`.
40
40
- add your info (name, affiliate, ORCID) to `AUTHORS.md` and `.zenodo.json`
41
41
- at this point, it might be good to make your initial commit to your repository with the following git commands:
@@ -87,16 +87,18 @@ Steps:
87
87
- dependencies foryour package should typically only be those that are directly used (imported)in your source code (or are explicitly needed but not import), but not the dependencies of your dependencies. If you use a package in your documentation, but not in the source code, include this as an _optional_ dependency. If you have a portion of your code that some users may not utilize, such as visualization functions, the dependencies you require for that, such as matplotlib, can also be include as _optional_ dependencies to reduces the constraints for users who don't require it.
88
88
- core dependencies are specified in `pyproject.toml` under the `[project]` section with the format `dependencies = ["pandas", "scipy>=1.0"]`.
89
89
- optional dependencies are specified in `pyproject.toml` under the `[dependency-groups]` section with the following format, for example for optional documentation dependencies: `docs = ["sphinx>=7.0",]`.
90
-
- Dependency version's should only be constrained to specific versions if you know there is an issue, and they should almost never be pinned to specific versions, as this will cause many issues foranyone who wants to use your packagein their own environments.
91
-
- this template also includes files and commands to create `conda` environments. These are used both in developing, and in GitHub automations. You need to manually ensure the dependencies listed in`environmental.yml` match those in`pyproject.toml`. Include all optional dependencies in the `environmental.yml`. If a dependency is only available via pip, and not conda, add it at the bottom to be installed via pip.
90
+
- if you know your package has an issue with a specific version of a dependency, you can set a max or min version with "scipy>=1.0".
91
+
- dependencies should almost never be pinned to specific versions, as this will cause many issues for anyone who wants to use your package in their own environments.
92
+
- for standard scientific packages (i.e., `pandas`, `xarray`, and `numpy`), as well as the version of Python, it's recommended to set minimum support versions following the timeline of [SPEC 0 guidelines](https://scientific-python.org/specs/spec-0000/).
93
+
- this template also includes files and commands to create `conda` environments. These are used both in developing, and in GitHub automations. You need to manually ensure the dependencies listed in`environment.yml` match those in`pyproject.toml`. Include all optional dependencies in the `environment.yml`. If a dependency is only available via pip, and not conda, add it at the bottom to be installed via pip.
92
94
6) Create environment, style check, test, and commit your changes.
93
95
- follow the instructions in`CONTRIBUTING.md` starting at section `Setting up nox` and stopping before `Publish a new release`.
94
96
- these steps should result in a merged PR with your code.
95
97
7) Set up automated Zenodo releases (only for Public repositories)
96
98
- if you haven't already, link your organization (or personal) GitHub account to [Zenodo](https://zenodo.org/) using `Linked accounts` under your Zenodo profile.
97
99
- do to the `GitHub` menu on your Zenodo profile.
98
100
- click the Sync button and then turn on the switch for your repository.
99
-
- any future GitHub releases should now result in a new Zenodo release automatically.
101
+
- any future GitHub releases should now result in a new Zenodo release and DOI automatically.
100
102
8) Set up publishing on TestPyPI
101
103
- before publishing to the real PyPI, we will publish to Test-PyPI to ensure everything works .
102
104
- make an account on [TestPyPI](https://test.pypi.org/).
@@ -122,9 +124,9 @@ Steps:
122
124
nox -s test
123
125
```
124
126
10) Make a PyPI (pip) release
125
-
- If the install and test above worked then we can change from TestPyPI to normal PyPI.
127
+
- if the install and test above worked then we can change from TestPyPI to normal PyPI.
126
128
- in`.github/workflows/cd.yml` comment out or delete the last line: `repository-url: https://test.pypi.org/legacy/`. Now any future reruns of this action will release to PyPI.
127
-
- In this case, since the GitHub release has already been made, we need to manually trigger the `CD` workflow in GitHub.
129
+
- in this case, since the GitHub release has already been made, we need to manually trigger the `CD` workflow in GitHub.
128
130
- At [this link](https://github.com/organizationname/samplepackagename/actions/workflows/cd.yml), click the `Run workflow` button.
129
131
- This should build the package and release it to PyPI.
0 commit comments