Skip to main content

A simple importable Python package

Project description

image image image image image

This repository demonstrates steps needed to publish an importable Python package first to TestPyPI, and second to PyPI. If this demonstration deviates from best practice in any way, please submit an issue on GitHub.

Inside import-ready is a package called huntsville_havoc that divulges a couple of bona fide secrets that most diehard SPHL Huntsville Havoc fans don't know.

Publish to TestPyPI

Follow these general suggestions to publish your Python package to TestPyPI:

  1. Prepare your environment before installing Python packages.
  2. Update version in setup.py per semantic versioning guidance. Match this version in the tests/requirements_test_*.txt files used below.
  3. Git commit, tag, & push all desired edits for release.
  4. Create a new release in GitHub to mirror your new version.
  5. Generate distribution archives for your package.
  6. Upload your package to TestPyPI.

Test import-ready

Test import-ready from two different perspectives:

  1. Unit tests: Development time, pre-publish test. Run as follows from the top level directory in a clean venv:
    python -m pip install -r requirements_travis_ci.txt
    python -m pytest -s tests
  2. Package tests: Post-publish test, importing import-ready itself back from TestPyPI. Run as follows from inside the tests directory in a clean venv:
    python -m pip install -r requirements_test_TestPyPI.txt
    python -m pytest -s

Publish to PyPI

After completing the above steps, upload your package to PyPI.

Test the real deal

Post-publish test, importing import-ready itself back from PyPI. Run as follows from inside the tests directory in a clean venv:

python -m pip install -r requirements_test_PyPI.txt
python -m pytest -s

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

import-ready-0.9.8.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

import_ready-0.9.8-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

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