- The official guide for building Python packages from scratch:
- The Python project manager, Hatch, for building and publishing packages:
- Create
README.md
in the directory root - Create
LICENSE
in the directory root - Create
setup.py
in the directory root - Put Python modules in a subdirectory,
src
or whatever - Put Python tests in a subdirectory,
tests
or whatever - Create
__init__.py
in the subdirectory to make it discoverable - Initialise the package with Hatch:
hatch new --init
- This creates
pyproject.toml
- This creates
- Build the package with Hatch:
hatch build
- Before running this
hatch version x.y.z
to set the version number - This creates
dist/
- Before running this
- Upload the package to PyPI with Hatch:
hatch publish -u __token__ -a TOKEN
- the username is
__token__
and the authentication token is created on PyPI
- the username is
- The official guide for building conda packages that are independent of PyPI:
- Description of the
meta.yaml
file which is the core of a conda package:
conda install conda-build
conda install anaconda-client
- Create
meta.yaml
in a folder namedconda-recipe
or whatever - Build the package by
conda build .
- Upload the package to Anaconda Cloud by
anaconda upload /g/kreshuk/yu/miniconda3/envs/ENV_NAME/conda-bld/noarch/PACKAGE_NAME-pypy_1.tar.bz2