Skip to main content

short package description

Project description

Note: write your logic code in exampleapp directory then write your tests file in tests directory. Note: you have to choose suitable package_name because of test.pypi won't accept any repeated package_name. Note: replace exist links in project_urls in setup.py with your own links. Note: fill requirements.txt with dependencies that your package need.

Local Install

Before uploading our package to PyPI we can confirm that our package can be installed via pip install by navigating to our package directory and entering:

pip install .

or

pip install -e .

if you want make it editable.

This should then install our package like any other package install via pip:

Build

Once we’ve written our code files, setup configuration, and tested the install — we’re ready to build our package distribution.

The build process creates a new directory dist which will contain a .tar.gz and .whl file — this is what we need to publish our package to PyPI.

To build our dist files, we use a tool creatively named build. First, we type:

pip install build

then, while in our package directory — type:

python -m build

Once this is complete, we should find a new /dist directory inside our package directory.

Publish to TestPyPI

Finally, we are ready to publish our new Python package! Again, we make use of another package called twine. We install this with:

pip install twine

Once installed, we upload to TestPyPI — a ‘test’ version of PyPI so that we can double-check that we have set everything up correctly. We do this by typing:

python -m twine upload --repository testpypi dist/*

At this point, we’ll need to login to TestPyPI — if you don’t have an account, sign up for one here. If everything is set up correctly, our package will be uploaded:

Now, we can test that our new package works through another pip install — but this time from TestPyPI:

pip install -i https://test.pypi.org/simple/ exampleapp

(If you find that the package is already installed — just pip uninstall exampleapp).

PyPI

Once we’ve confirmed that the package works — we take our final step, publishing to PyPI. Again, you’ll need to register here.

Next, we upload our package to PyPI with:

python -m twine upload --repository pypi dist/*

And we’re done!

That’s our first Python package deployment — it’s surprisingly straightforward. We can go ahead and pip install exampleapp to use the package.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exampleapp2-0.0.12.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

exampleapp2-0.0.12-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file exampleapp2-0.0.12.tar.gz.

File metadata

  • Download URL: exampleapp2-0.0.12.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for exampleapp2-0.0.12.tar.gz
Algorithm Hash digest
SHA256 074c9e4c8e5a47e514915afdce40d1d613e9b6cbb9d0d4f268c2dc3495487c5f
MD5 1efa87bdc2293500e0a1c80b9d13e096
BLAKE2b-256 bca18870ec86145f0620c783acd1957f30be46ba75e72dd985a143c0db1aeabd

See more details on using hashes here.

File details

Details for the file exampleapp2-0.0.12-py3-none-any.whl.

File metadata

  • Download URL: exampleapp2-0.0.12-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.7.16

File hashes

Hashes for exampleapp2-0.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 49334a4720637c831ebebc38f2d771d7d43d9e4b35384b07120d22dd0a744c30
MD5 a6329a4145cb446eab8d1548fed01037
BLAKE2b-256 baee60ad8f1be8265a2674dfd9c4900173877348fee2722f17d7b0388a10835e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page