Skip to main content

Example Project Structure for a Python / PyPI Project

Project description

Documentation

Example Project Structure for a Python / PyPI Project

Installation

Note that this supports Python 3 ONLY

Basic Usage

Warning eggs are deprecated in favor of wheels, and not supported by pip.

This project is a sample template used to aggregate the process of:

  • Laying out a python project

  • Using setuptools build system to

    • to facilitate packaging Python projects

    • Python package and module definitions

    • Distribution package metadata

    • Project installation

Outline the process to

  • Create Python Eggs - a single-file importable distribution format

  • Automatically include all packages in your source tree, without listing them individually in setup.py

  • Automatically generate wrapper scripts or Windows (console and GUI) .exe files for any number of “main” functions in your project. (Note: this is not a py2exe replacement; the .exe files rely on the local Python installation.)

Command Reference

https://setuptools.readthedocs.io/en/latest/setuptools.html#command-reference

For example, to produce a source distribution, simply invoke:

>>>
python setup.py sdist

Detailed instructions to distribute a setuptools project can be found at Packaging project tutorials. https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives

Before you begin, make sure you have the latest versions of setuptools and wheel:

>>>
python -m pip install --user --upgrade setuptools wheel

To build a setuptools project, run this command from the same directory where setup.py is located:

>>>
python setup.py sdist bdist_wheel

This will generate distribution archives in the dist directory.

Uploading to test.pypi.org

test.pypi.org

Before you upload the generated archives make sure you’re registered on https://test.pypi.org/account/register/.

You will also need to verify your email to be able to upload any packages. You should install twine to be able to upload packages:

>>>
python -m pip install --user --upgrade twine

Now, to upload these archives, run:

>>>
python -m twine upload --repository-url https://test.pypi.org/legacy/ dist/*

To install your newly uploaded package example_pkg, you can use pip:

>>>
python -m pip install --index-url https://test.pypi.org/simple/ example_pkg

If you have issues at any point, please refer to Packaging project tutorials for clarification.

Credits

Patrick Shiel: github.com/patrickshiel

License

MIT License

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

pyprojecttemplate-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

pyprojecttemplate-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file pyprojecttemplate-0.1.0.tar.gz.

File metadata

  • Download URL: pyprojecttemplate-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

File hashes

Hashes for pyprojecttemplate-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6ed3845b27ae772a585822389dbd17002e7e4fddac1d48eb2dbc334708b2783d
MD5 834bc9df3c4d176e5c7e3050729e1243
BLAKE2b-256 78f1aca1e8c2690854c91969e811214eab34d502a68eac613bda2940f3eda82b

See more details on using hashes here.

File details

Details for the file pyprojecttemplate-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyprojecttemplate-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

File hashes

Hashes for pyprojecttemplate-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 15f47bf3857a5efefb583e122d161bb3246ebfa15712db3cd723390a9c931767
MD5 d97333022a80450bcc240807ae8d2676
BLAKE2b-256 aac05b9a9e0fbd2483a5c1ea1265459d4d69ac4ce7cad4d46d55d8777df12f10

See more details on using hashes here.

Supported by

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