Skip to content

Instantly share code, notes, and snippets.

@richardcornish
Last active July 17, 2017 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardcornish/ec833827a0612f1c311a02ec4b299612 to your computer and use it in GitHub Desktop.
Save richardcornish/ec833827a0612f1c311a02ec4b299612 to your computer and use it in GitHub Desktop.
Create new Python package for PyPi
# Create environment
mkvirtualenv -p python3 mydjangopackage
pip install django sphinx sphinx-autobuild sphinx-rtd-theme
# Create demo environment
mkvirtualenv -p python3 mydjangopackagedemo
pip install django gunicorn psycopg2 whitenoise dj-database-url
# Create docs
mkdir docs
cd docs/
sphinx-quickstart
# Update docs
(cd docs/ && make html)
sphinx-autobuild docs/ docs/_build_html
# Create package
python setup.py --long-description | rst2html.py > output.html
rm -rf build/
python setup.py sdist bdist_wheel
python setup.py upload (deprecated?)
twine upload dist/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment