- The official guide for building Python packages from scratch:
- The Python project manager, Hatch, for building and publishing packages:
- Create
README.mdin the directory root - Create
LICENSEin the directory root - Create
setup.pyin the directory root - Put Python modules in a subdirectory,
srcor whatever - Put Python tests in a subdirectory,
testsor whatever - Create
__init__.pyin 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.zto 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.yamlfile which is the core of a conda package:
conda install conda-buildconda install anaconda-client- Create
meta.yamlin a folder namedconda-recipeor 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