Skip to content

Commit

Permalink
Upload to PyPI
Browse files Browse the repository at this point in the history
This patch introduces some Makefile targets and documentation to make the
upload of packages to PyPI more consistent.

Closes #194
  • Loading branch information
shaardie committed Jun 26, 2020
1 parent 989b2e7 commit a94a78e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,17 @@ lint:
test:
@npm run build
@coverage run --source=pyca --omit='*.html' -m unittest discover -s tests

build:
@npm ci
@npm run build

pypi: clean build
@python setup.py sdist
@printf "\nUpload to PyPI with \"twine upload dist/$$(python setup.py --fullname).tar.gz\"\n"

clean:
@python setup.py clean --all
@rm -rf node_modules pyca/ui/static

PHONY: all lint test build pypi clean
20 changes: 20 additions & 0 deletions docs/pypi.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Upload to PyPI_
===============

The ``Makefile`` includes a ``pypi`` target which builds a clean PyCA package.

So you can simply call

.. code-block:: bash
make pypi
to build a clean package.

The built package should be found under ``dist`` and can be uploaded to PyPI_, e.g. with Twine_.

For a more detailed explanation about the whole process, take e.g. a look at `Packaging Python Projects`_

.. _PyPI: https://pypi.org
.. _Twine: https://pypi.org/project/twine/
.. _Packaging Python Projects: https://packaging.python.org/tutorials/packaging-projects/
5 changes: 5 additions & 0 deletions docs/readme.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,8 @@ API
---

- `API Documentation <apidocs.rst>`_

Developer Information
---------------------

- `Upload to PyPI <pypi.rst>`_

0 comments on commit a94a78e

Please sign in to comment.