Skip to main content

Minimal PyPI Package Example

Project description

# min-pypi-hello

A minimalist example of PyPI packaging.
(
[view on pypi](https://pypi.python.org/pypi/minpypihello/);
[view on GitHub](https://github.com/hupili/min-pypi-hello)
)

* A package called `minpypihello`,
which contains a module called `modhello`.
You can import using `from minpypihello import modhello`.
* A script that can be executed directly to print a helloworld message.

## 1. Check the Project and Study Files

Run `./myhello` and see if it works as expected.
Navigate under this repo and see those files for an example layout.

min-pypi-hello/
├── MANIFEST.in
├── README.md
├── README.txt
├── minpypihello
│   ├── __init__.py
│   └── modhello.py
├── myhello
└── setup.py

## 2. Package

Build source archive: `python setup.py sdist`.

Test:

* Find your package in `dist/minpypihello-x.tar.gz`,
where `x` is the version number.
* Uncompress the archive and go to its root.
* Install `python setup.py install`.
You can add `--user` to install under your home.
* Try `myhello` (not `./myhello`).
If you `$PATH` is set properly and the install is successful,
you should see the printed hello message.
* Try to import `minpypihello.modhello` from a Python script
(see code of `myhello` for an example).

## 3. Distribute to PyPI

Register: Use `python setup.py register` and go through the procedure as prompt.

Upload: `python setup.py upload`.

[more info.](http://docs.python.org/2/distutils/packageindex.html)

## Reference

* distutils:
<http://docs.python.org/2/distutils/>
* A list of package metadata:
<http://docs.python.org/2/distutils/setupscript.html#additional-meta-data>

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

minpypihello-1.4.tar.gz (1.7 kB view details)

Uploaded Source

File details

Details for the file minpypihello-1.4.tar.gz.

File metadata

  • Download URL: minpypihello-1.4.tar.gz
  • Upload date:
  • Size: 1.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for minpypihello-1.4.tar.gz
Algorithm Hash digest
SHA256 2b039e9948d43597dabdc52cbadb9c8e591a22c9130d63d656198e96a5914d44
MD5 da2e88ff4ef9df5e877545f9e0efbb10
BLAKE2b-256 4b3c3ebcffa613c8605902c977908af773a2ac8e131ae48bc5edf1d35900adc2

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