Skip to content

Latest commit

 

History

History
73 lines (44 loc) · 1.88 KB

PACKAGE.rst

File metadata and controls

73 lines (44 loc) · 1.88 KB

Python Packaging

Setting up the python package for distribution on PyPI is done using commands through setup.py The following instructions assume you are working from the python directory.

Deployment Process

  1. Commit changes (increment the version in configure.ac file, PyPI will not overwrite a package using the same version)
  2. Update MANIFEST.in to include any additional files then check it to make sure the dist has the right data in it

    $ check-manifest --ignore Makefile,PACKAGE.rst,*.cc,tox.ini,tests*,examples*,src*
  3. Lint the code:

    $ pylint -f colorized vowpalwabbit
  4. Make sure code passes all tests under supported environments

    # install virtualenv if necessary
    $ pip install virtualenv
    $ python setup.py test
  5. Create dist folder for package

    $ python setup.py sdist
  6. Upload package to PyPI

    You should have twine installed and configured and your PyPI / test PyPI user should have access to the package <VERSION> corresponds to the new version in the configure.ac file

    1. Test package
    $ twine upload -r test dist/*
    $ cd /tmp
    $ virtualenv test_vw_package
    $ source test_vw_package/bin/activate
    $ pip install -i https://testpypi.python.org/simple/ vowpalwabbit
    $ python -c 'from vowpalwabbit import pyvw'
    $ deactivate
    $ rm -rf test_vw_package
    1. Upload package
    $ twine upload dist dist/vowpalwabbit-<VERSION>.tar.gz
  7. Cleanup build and packaging artifacts / directories

    $ python setup.py clean

References

https://packaging.python.org/en/latest/distributing/

http://setuptools.readthedocs.io/en/latest/setuptools.html