Skip to content

Commit 873ffdb

Browse files
Merge branch 'main' into index-structure
2 parents e0f3fdb + 6a58271 commit 873ffdb

20 files changed

+477
-231
lines changed

.all-contributorsrc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,28 @@
450450
"review",
451451
"tutorial"
452452
]
453+
},
454+
{
455+
"login": "xmnlab",
456+
"name": "Ivan Ogasawara",
457+
"avatar_url": "https://avatars.githubusercontent.com/u/5209757?v=4",
458+
"profile": "https://xmnlab.github.io",
459+
"contributions": [
460+
"code",
461+
"review",
462+
"tutorial"
463+
]
464+
},
465+
{
466+
"login": "tomalrussell",
467+
"name": "Tom Russell",
468+
"avatar_url": "https://avatars.githubusercontent.com/u/2762769?v=4",
469+
"profile": "https://github.com/tomalrussell",
470+
"contributions": [
471+
"code",
472+
"review",
473+
"tutorial"
474+
]
453475
}
454476
],
455477
"contributorsPerLine": 7,

.zenodo.json

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,6 @@
109109
"affiliation": "",
110110
"name": "Van der Walt, Stéfan"
111111
},
112-
{
113-
"type": "Other",
114-
"affiliation": "",
115-
"name": "Schwartz, Eli"
116-
},
117112
{
118113
"type": "Other",
119114
"affiliation": "Quansight",
@@ -201,6 +196,36 @@
201196
"affiliation": "",
202197
"name": "Knorps, Maria"
203198
},
199+
{
200+
"type": "Other",
201+
"affiliation": "",
202+
"name": "Schwartz, Eli"
203+
},
204+
{
205+
"type": "Other",
206+
"affiliation": "",
207+
"name": "Burns, Jackson"
208+
},
209+
{
210+
"type": "Other",
211+
"affiliation": "",
212+
"name": "Jaimergp"
213+
},
214+
{
215+
"type": "Other",
216+
"affiliation": "",
217+
"name": "h-vetinari"
218+
},
219+
{
220+
"type": "Other",
221+
"affiliation": "",
222+
"name": "Ogasawara, Ivan"
223+
},
224+
{
225+
"type": "Other",
226+
"affiliation": "",
227+
"name": "Russell, Tom"
228+
},
204229
{
205230
"type": "Other",
206231
"affiliation": "",

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <img src="https://www.pyopensci.org/images/logo.png" width=100 /> pyOpenSci scientific Python Packaging Guide
22
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3-
[![All Contributors](https://img.shields.io/badge/all_contributors-43-orange.svg?style=flat-square)](#contributors-)
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-45-orange.svg?style=flat-square)](#contributors-)
44
<!-- ALL-CONTRIBUTORS-BADGE:END -->
55

66
![GitHub release (latest by date)](https://img.shields.io/github/v/release/pyopensci/python-package-guide?color=purple&display_name=tag&style=plastic)
@@ -130,6 +130,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
130130
</tr>
131131
<tr>
132132
<td align="center" valign="top" width="14.28%"><a href="https://github.com/h-vetinari"><img src="https://avatars.githubusercontent.com/u/33685575?v=4?s=100" width="100px;" alt="h-vetinari"/><br /><sub><b>h-vetinari</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=h-vetinari" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Ah-vetinari" title="Reviewed Pull Requests">👀</a> <a href="#tutorial-h-vetinari" title="Tutorials">✅</a></td>
133+
<td align="center" valign="top" width="14.28%"><a href="https://xmnlab.github.io"><img src="https://avatars.githubusercontent.com/u/5209757?v=4?s=100" width="100px;" alt="Ivan Ogasawara"/><br /><sub><b>Ivan Ogasawara</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=xmnlab" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Axmnlab" title="Reviewed Pull Requests">👀</a> <a href="#tutorial-xmnlab" title="Tutorials">✅</a></td>
134+
<td align="center" valign="top" width="14.28%"><a href="https://github.com/tomalrussell"><img src="https://avatars.githubusercontent.com/u/2762769?v=4?s=100" width="100px;" alt="Tom Russell"/><br /><sub><b>Tom Russell</b></sub></a><br /><a href="https://github.com/pyOpenSci/python-package-guide/commits?author=tomalrussell" title="Code">💻</a> <a href="https://github.com/pyOpenSci/python-package-guide/pulls?q=is%3Apr+reviewed-by%3Atomalrussell" title="Reviewed Pull Requests">👀</a> <a href="#tutorial-tomalrussell" title="Tutorials">✅</a></td>
133135
</tr>
134136
</tbody>
135137
</table>

conf.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
organization_name = "pyOpenSci"
2121

2222

23-
2423
# -- Project information -----------------------------------------------------
2524

2625
project = "pyOpenSci Python Package Guide"
@@ -29,7 +28,9 @@
2928

3029
# Get the latest Git tag - there might be a prettier way to do this but...
3130
try:
32-
release_value = subprocess.check_output(["git", "describe", "--tags"]).decode("utf-8").strip()
31+
release_value = (
32+
subprocess.check_output(["git", "describe", "--tags"]).decode("utf-8").strip()
33+
)
3334
release_value = release_value[:4]
3435
except subprocess.CalledProcessError:
3536
release_value = "0.1" # Default value in case there's no tag
@@ -57,6 +58,7 @@
5758
myst_enable_extensions = [
5859
"colon_fence",
5960
"deflist",
61+
"attrs_block",
6062
]
6163
myst_heading_anchors = 3
6264

@@ -69,7 +71,7 @@
6971
# Link to our repo for easy PR/ editing
7072
html_theme_options = {
7173
"announcement": "<p><a href='https://www.pyopensci.org/about-peer-review/index.html'>We run peer review of scientific Python software. Learn more.</a></p>",
72-
#"navbar_center": ["nav"], this can be a way to override the default navigation structure
74+
# "navbar_center": ["nav"], this can be a way to override the default navigation structure
7375
"external_links": [
7476
{
7577
"url": "https://www.pyopensci.org",
@@ -92,7 +94,7 @@
9294
},
9395
],
9496
"logo": {
95-
#"text": "Python Packaging",
97+
# "text": "Python Packaging",
9698
"image_dark": "logo-dark-mode.png",
9799
"image_light": "logo-light-mode.png",
98100
"alt_text": "pyOpenSci Python Package Guide. The pyOpenSci logo is a purple flower with pyOpenSci under it. The o in open sci is the center of the flower",

documentation/repository-files/license-files.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ To select your license, we suggest that you use GitHub's
4747
[Choose a License tool ](https://choosealicense.com/).
4848

4949
If you choose your license when creating a new GitHub repository, you can also
50-
automatically get a text copy of the license file to add to your repo. However
50+
automatically get a text copy of the license file to add to your repository. However
5151
in some cases the license that you want is not available through that online
5252
process.
5353

@@ -78,9 +78,9 @@ with the license that you selected for your package.
7878
:::{admonition} An example of how a license determine how code can be reused
7979
:class: note
8080

81-
Let's use stackOverflow as an example that highlights how a license determines how code can or can not be used.
81+
Let's use StackOverflow as an example that highlights how a license determines how code can or can not be used.
8282

83-
[Stack overflow uses a Creative Commons Share Alike license.](https://stackoverflow.com/help/licensing). The sharealike license requires you to use the same sharealike license when you reuse any code from stackoverflow.
83+
[Stack overflow uses a Creative Commons Share Alike license.](https://stackoverflow.com/help/licensing). The sharealike license requires you to use the same sharealike license when you reuse any code from StackOverflow.
8484

8585
This means that technically, if you copy code from the Stack Overflow website, and use it in your package. And your packages uses a different license such as a MIT license, you are violating Stack Overflow's license requirements!
8686

@@ -92,7 +92,7 @@ This means that technically, if you copy code from the Stack Overflow website, a
9292

9393
While many permissive licenses do not require citation we STRONG encourage that you cite all software that you use in papers, blogs and other publications. You tell your users how to cite your package by using a [citation.cff file](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-citation-files). We will cover this topic when we talk about creating DOI's for your package using zenodo.
9494

95-
<!-- TODO: add link when lesson is created - but also we don't yet know how citation.cff files work with zenodo (do they work??) will the citation info update with a new zenodo link
95+
<!-- TODO: add link when lesson is created - but also we don't yet know how citation.cff files work with Zenodo (do they work??) will the citation info update with a new Zenodo link
9696
9797
These files - we need to understand if that date releases auto populates or forces zenodo to modify it's citation. if it's not dynamic it could be problematic
9898
538 KB
Loading

index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ by the community now! Join our community review process or watch development of
7171
:class-card: left-aligned
7272

7373
* [What is a Python package?](/tutorials/intro)
74-
* [Make your code installable](/tutorials/1-installable-code)
74+
* [Make your code installable](/tutorials/installable-code)
7575
* [Publish your package to (test) PyPi](/tutorials/publish-pypi)
7676
* [Publish your package to conda-forge](/tutorials/publish-conda-forge)
7777

package-structure-code/publish-python-package-pypi-conda.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Below you will learn more specifics about the differences between PyPI and conda
1919
:::
2020

2121

22-
:::{figure-md} pypi-conda-channels
22+
:::{figure-md} upload-conda-forge
2323

2424
<img src="../images/publish-python-package-pypi-conda.png" alt="Image showing the progression of creating a Python package, building it and then publishing to PyPI and conda-forge. You take your code and turn it into distribution files (sdist and wheel) that PyPI accepts. then there is an arrow towards the PyPI repository where ou publish both distributions. From PyPI if you create a conda-forge recipe you can then publish to conda-forge. " width="700px">
2525

@@ -48,13 +48,13 @@ Click here for a tutorial on publishing your package to PyPI.
4848
:::
4949

5050

51-
```{tip}
51+
:::{tip}
5252
On the package build page, we discussed the [two package distribution
5353
types that you will create when making a Python package](python-package-distribution-files-sdist-wheel): SDist (packaged as a .tar.gz or .zip) and
5454
Wheel (.whl) which is really a zip file. Both of those file "bundles" will
5555
be published on PyPI when you use [a standard build tool](python-package-build-tools) to build
5656
your package.
57-
```
57+
:::
5858

5959
(about-conda)=
6060
## What is Anaconda Cloud and conda?
@@ -69,8 +69,6 @@ packages. These repositories are known as channels (discussed below).
6969
:::{admonition} A brief history of conda's evolution
7070
:class: note
7171

72-
The conda ecosystem evolved years ago to provide support for and
73-
simplify the process of managing software dependencies in scientific
7472
The conda ecosystem evolved years ago to provide support for, and
7573
simplify the process of, managing software dependencies in scientific
7674
Python projects.
@@ -156,11 +154,11 @@ to use conda to manage their local environments (which many do), you should
156154
consider publishing to both PyPI and the conda-forge channel (_more
157155
on that below_).
158156

159-
```{admonition} Additional resources
160-
* [learn more about why conda-forge was created, here](https://conda-forge.org/docs/user/introduction.html#why-conda-forge)
157+
:::{admonition} Additional resources
158+
* [learn more about why conda-forge was created, here](https://conda-forge.org/docs/user/introduction.html)
161159

162160
* [To learn more about conda terminology, check out their glossary.](https://docs.conda.io/projects/conda/en/latest/glossary.html )
163-
```
161+
:::
164162

165163
<!-- One of our packages on conda-forge https://anaconda.org/conda-forge/pandera -->
166164

@@ -171,7 +169,7 @@ we encourage you to consider doing so!
171169

172170
Once your package is on PyPI, the process to add your package to conda-forge
173171
is straight forward to do. [You can follow the detailed steps provided
174-
by the conda-forge maintainer team.](https://conda-forge.org/docs/maintainer/adding_pkgs.html#generating-the-recipe).
172+
by the conda-forge maintainer team.](https://conda-forge.org/docs/maintainer/adding_pkgs.html).
175173

176174

177175
:::{button-link} ../tutorials/publish-conda-forge.html
@@ -186,9 +184,9 @@ If you want a step by step tutorial, click here.
186184

187185
Once your package is added, you will have a feedstock repository on GitHub with your packages name
188186

189-
```{tip}
187+
:::{tip}
190188
[Here is an example conda-forge feedstock for the pyOpenSci approved package - movingpandas](https://github.com/conda-forge/movingpandas-feedstock)
191-
```
189+
:::
192190

193191
### Maintaining your conda-forge package repository
194192

package-structure-code/python-package-build-tools.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ Build your sdist and wheel distributions|✅|Poetry will build your sdist and wh
403403

404404
<!-- TODO: responses here on poetry's future dev work: https://github.com/python-poetry/poetry/discussions/7525 -->
405405

406+
(challenges-with-poetry)=
406407
### Challenges with Poetry
407408

408409
Some challenges of Poetry include:

package-structure-code/python-package-distribution-files-sdist-wheel.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Learn about Building a Python Package
22

33

4-
:::{figure-md} pypi-conda-channels
4+
:::{figure-md} pypi-conda-overview
55

66
<img src="../images/publish-python-package-pypi-conda.png" alt="Image showing the progression of creating a Python package, building it and then publishing to PyPI and conda-forge. You take your code and turn it into distribution files (sdist and wheel) that PyPI accepts. then there is an arrow towards the PyPI repository where ou publish both distributions. From PyPI if you create a conda-forge recipe you can then publish to conda-forge. " width="700px">
77

88
Once you have published both package distributions (the source distribution and the wheel) to PyPI, you can then publish to conda-forge. conda-forge requires an source distribution on PyPI in order to build your package on conda-forge. You do not need to rebuild your package to publish to conda-forge.
99
:::
1010

1111
You need to build your Python package in order to publish it to PyPI (or a conda channel). The build process organizes your code and metadata into a distribution format that can be uploaded to PyPI and subsequently downloaded and installed by users. NOTE: you need to publish a sdist to PyPI in order for conda-forge to properly build your package automatically.
12-
:::
1312

1413
(build-package)=
1514
## What is building a Python package?

0 commit comments

Comments
 (0)