Skip to content

Commit

Permalink
created tox shorthand for building and uploading packages to pypi (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
leifwalsh authored and thejunglejane committed Jun 3, 2018
1 parent 7e5c310 commit d24cc48
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 2 additions & 6 deletions docs/maintaining.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,9 @@ Uploading to PyPI
Once you've tagged the latest version of marbles, pull from GitHub to
make sure your clone is up to date and clean, build both ``sdist`` and
``wheel`` packages for all three packages, and upload them with
`twine`_::
`twine`_. We have a `tox`_ rule to automate building and uploading::

$ rm -rf dist marbles/{core,mixins}/dist
$ (cd marbles/core; python setup.py sdist bdist_wheel)
$ (cd marbles/mixins; python setup.py sdist bdist_wheel)
$ python setup.py sdist bdist_wheel
$ twine upload dist/* marbles/{core,mixins}/dist/*
$ tox -e pypi

.. _pipenv: https://docs.pipenv.org
.. _flake8: http://flake8.pycqa.org
Expand Down
14 changes: 13 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,16 @@ commands=
basepython = python3.6
commands=
pipenv install --dev
pipenv run python setup.py build_sphinx -Ea
pipenv run python setup.py build_sphinx -Ea

[testenv:pypi]
basepython = python3.6
whitelist_externals=
bash
commands=
pipenv install --dev
rm -rf dist marbles/core/dist marbles/mixins/dist
pipenv run bash -c "cd marbles/core; python setup.py sdist bdist_wheel"
pipenv run bash -c "cd marbles/mixins; python setup.py sdist bdist_wheel"
pipenv run python setup.py sdist bdist_wheel
twine upload --repository-url=https://upload.pypi.org/legacy/ dist/* marbles/core/dist/* marbles/mixins/dist/*

0 comments on commit d24cc48

Please sign in to comment.