Skip to content

Commit 34b0701

Browse files
authored
FEAT: new section on publishing w conda/pypi and code linting
Add: package versionioning, pypi / conda publishing & code format pre-commit pages (Reviews Welcome!)
2 parents 664143c + ef475bf commit 34b0701

9 files changed

+967
-1
lines changed
94.6 KB
Loading

images/precommit-hook-python-code.png

107 KB
Loading
109 KB
Loading

images/python-flying-xkcd.png

88.7 KB
Loading

index.md

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,29 @@ https://github.com/pyOpenSci/python-package-guide/community -->
2929
## Welcome, Python open source enthusiast!
3030

3131
Here you will find guidelines for what we look for in your scientific
32-
Python package when reviewing. You will also find best practice recommendations and curated lists of community resources surrounding packaging and documentation. Our goal is to help the
32+
Python package when reviewing. You will also find best practice recommendations and curated lists of community resources surrounding packaging and package documentation.
33+
34+
### pyOpenSci's packaging goals
35+
36+
Our goal is to help the
3337
community make decisions around how to create scientific Python packages. We are working towards a shared vision of packaging that helps users better understand where to start.
3438

39+
### How this guide is created
40+
41+
This guide is created by pyOpenSci through an extensive review process. Each page in the guide has been reviewed by experts in the broader Python packaging landscape including people from :
42+
43+
- conda & conda-forge
44+
- the python packaging authority
45+
- core Python developers
46+
- core scientific Python developers
47+
- and others with expertise in packaging, package documentation, usability and other related knowledge areas
48+
49+
[View all of the people who have contributed to this guide here.
50+
](https://github.com/pyOpenSci/python-package-guide#contributors-)
51+
52+
We use this guide as a foundation for our open peer review process of
53+
scientific software.
54+
3555
::::{grid} 2
3656
:reverse:
3757

@@ -109,6 +129,13 @@ We assume that you are here because you are:
109129

110130
Well, friend, you've come to the right place!
111131

132+
:::{figure-md} fig-target
133+
134+
<img src="/images/python-flying-xkcd.png" alt="xkcd comic showing a stick figure on the ground and one in the air. The one on the ground is saying. `You're flying! how?` The person in the air replies `Python!` Below is a 3 rectangle comic with the following text in each box. box 1 - I learned it last night. Everything is so simple. Hello world is just print hello world. box 2 - the person on the ground says - come join us programming is fun again. it's a whole new world. But how are you flying? box 3 - the person flying says - i just typed import antigravity. I also sampled everything in the medicine cabinet. But i think this is the python. the person on the ground is saying - that's it?" width="400px">
135+
136+
Many love to use Python because it is a clean language to learn. It also is incredibly flexible allowing it to be used across numerous domains. Source: xkcd comics.
137+
:::
138+
112139
## What you will find in this guidebook
113140

114141
This guidebook contains:
@@ -125,3 +152,63 @@ Good meets the requirements. Going beyond the minimum can make package maintenan
125152

126153
This guide is now a work in progress. If you have ideas of things you'd like
127154
to see here, [we invite you to open an issue on GitHub that details any changes or additions that you'd like to see.](https://github.com/pyOpenSci/python-package-guide/issues).
155+
156+
```{toctree}
157+
:hidden:
158+
:caption: Documentation
159+
160+
Documentation Overview <documentation/index>
161+
Write User Documentation <documentation/write-user-documentation/intro>
162+
Core GitHub Repository Files <documentation/repository-files/intro>
163+
Documentation Tools & Hosting <documentation/hosting-tools/intro>
164+
```
165+
166+
```{toctree}
167+
:hidden:
168+
:caption: Package structure & code style
169+
170+
Manage Package Versions <package-structure-code/python-package-versions>
171+
Publish Package PyPI Conda <package-structure-code/publish-python-package-pypi-conda>
172+
Code Style & Format <package-structure-code/code-style-linting-format>
173+
Intro <python-packaging/intro>
174+
175+
```
176+
177+
```{toctree}
178+
:hidden:
179+
:caption: CI and Testing
180+
181+
Intro <ci-and-testing/intro>
182+
```
183+
184+
<!--
185+
COMMENTED OUT TEXT TO BE MOVED
186+
187+
188+
# TODO LINK TO CI BUILDS FOR Documentation>
189+
Maybe we can curate a list of CI builds that people can use??? or is that moving too close to a cookie cutter situation
190+
191+
The text below is being moved to the packaging infrastructure section which
192+
doesn't exist YET... but will soon .
193+
pyOpenSci packages must:
194+
195+
- Contain full documentation for any user-facing functions.
196+
- Have a test suite that covers the major functionality of the package.
197+
- Use continuous integration.
198+
- Use an OSI approved software license.
199+
200+
201+
## Other recommendations
202+
### Python version support
203+
You should always be explicit about which versions of Python your package supports.
204+
Keeping compatibility with old Python versions can be difficult as functionality changes.
205+
A good rule of thumb is that the package should support, at least,
206+
the latest three Python versions (e.g., 3.8, 3.7, 3.6).
207+
208+
### Code Style
209+
pyOpenSci encourages authors to consult [PEP 8](https://www.python.org/dev/peps/pep-0008/) for information on how to style your code.
210+
211+
### Linting
212+
An automatic linter (e.g. flake8) can help ensure your code is clean and free of syntax errors. These can be integrated with your CI.
213+
214+
-->

0 commit comments

Comments
 (0)