-
Notifications
You must be signed in to change notification settings - Fork 62
Add: conda-forge publication tutorials #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
0d65afb
3ca9010
948729c
9e7d1f6
5e8060c
48f45bc
08f35e4
e2508d7
5a3a2ac
a1f4812
b86354e
9aeefbd
150a5b5
7c742e8
368f9c0
a6274c5
b46abde
a5122e9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "Anyone can publish to conda-forge" is probably not the best formulation. Only the CI of conda-forge can publish packages, but every package can be packaged in principle, provided it goes through review in staged-recipes. |
lwasser marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,24 @@ | ||
# Learn about Building a Python Package | ||
|
||
:::{figure-md} build_workflow | ||
<img src="../images/python-package-development-process.png" alt="Graphic showing the high level packaging workflow. On the left you see a graphic with code, metadata and tests in it. those items all go into your package. Documentation and data are below that box because they aren't normally published in your packaging wheel distribution. an arrow to the right takes you to a build distribution files box. that box leads you to either publishing to testpypi or the real pypi. from pypi you can then connect to conda forge for an automated build that sends distributions from pypi to conda-forge. " width="700px"> | ||
|
||
:::{figure-md} pypi-conda-channels | ||
|
||
<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"> | ||
|
||
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. | ||
lwasser marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the default, but not required (obviously this is the case for all non-Python packages in conda-forge). A git tag on a public repo is enough. PS. spelling consistency "Conda forge" -> "conda-forge" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fixing this throughout now! thank you! |
||
::: | ||
|
||
You need to build your Python package in order to publish it to PyPI (or Conda). 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. | ||
lwasser marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's some duplication between the addition above and the existing "NOTE:" here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank you! |
||
::: | ||
|
||
(build-package)= | ||
## What is building a Python package? | ||
|
||
To [publish your Python package](build_workflow) and make it easy for anyone to install, you first need to build it. | ||
To [publish your Python package](publish-python-package-pypi-conda) and make it easy for anyone to install, you first need to build it. | ||
|
||
But, what does it mean to build a Python package? | ||
|
||
[As shown in the figure above](build_workflow), when you build your Python package, you convert the source files into something called a distribution package. A distribution package contains your source code and metadata about the package, in the format required by the Python Package Index, so that it can be installed by tools like pip. | ||
[As shown in the figure above](#pypi-conda-channels), when you build your Python package, you convert the source files into something called a distribution package. A distribution package contains your source code and metadata about the package, in the format required by the Python Package Index, so that it can be installed by tools like pip. | ||
|
||
:::{note} | ||
The term package used to mean many different things in Python and other languages. On this page, we adapt the convention of the [Python Packaging Authority](https://www.pypa.io/en/latest/) and refer to the product of the | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kierisi this graphic now that i'm looking at it has really nice hierarchy and typography and flow. whereas the one in canva was totally different. did i look at the wrong graphic in canva? this graphic is just missing a bit of color pop but it's really clean and easy to digest.