Packaging Python Modules
I. Protocol for setting up pip install
Please see: Tutorial for Packing Python Projects
Prerequisites:
pip install --user --upgrade setuptools wheel
pip install --user --upgrade twine
-
Register an account on https://pypi.org or https://test.pypi.org if you would like to do testing first.
-
Create a
setup.py
- main commands/controls for the project to be built. -
python setup.py sdist bdist_wheel
NOTE: The command that is used to build the distribution archives (Thetar.gz
file is a source archive whereas the.whl
file is a built distribution) -
Lastly, run the following command to upload to your pypi account:
twine upload dist/*
II. Protocol for setting up conda install
Please see: Tutorial for Uploading Conda Packages
Prerequisites:
conda install anaconda-client conda-build
-
Register an account on https://anaconda.org/.
-
Create a
meta.yaml
- main commands/controls for the project to be built. -
Run
conda build
in the directory ofmeta.yml
-
Lastly, login to your anaconda account and upload the package
anaconda login
anaconda upload /path/to/conda-package.tar.bz2