Skip to main content

A sample Python project

Project description

Requirements

python3 -m pip install --upgrade build
python3 -m pip install --upgrade twine
python3 -m pip install --upgrade setuptools wheel

Download repository:

git clone https://github.com/johanneskruse/pypi_template.git

Upload:

In pyproject.toml you can set the name of the pacakage

Run the following to upload:

Packaging Python Projects

Generating distribution archives

Stand inside the project, i.e.

cd pypi_template

Next build the package:

python3 -m build

This command should output a lot of text and once completed should generate two files in the dist directory:

dist/
├── sampleproject-0.0.1-py3-none-any.whl
└── sampleproject-0.0.1.tar.gz

Uploading the distribution archives

twine upload dist/*

The user name and the password is the following:

[pypi]
  username = __token__
  password = .....

Where you'll need to generate the API Token as password.

Go to https://pypi.org/ to see the package!

Inspiration

setup.py vs setup.cfg in Python

sample git repo project

Packaging Python Projects

TODO:

  • Setup with pyproject.toml file
  • Note that if you want to install packages in editable mode (i.e. by running pip install -e .) you must have a valid setup.py file apart from setup.cfg and pyproject.toml. TRY TO RUN INSTEAD: pip install -e . -f .

Acronym Generator (help generate the name)

https://acronymify.com/

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

rats-0.0.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

rats-0.0.1-py3-none-any.whl (2.5 kB view details)

Uploaded Python 3

File details

Details for the file rats-0.0.1.tar.gz.

File metadata

  • Download URL: rats-0.0.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for rats-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d0057b469cf3e66c2d2786aeb5a6ce47353fd3028b2b5c908010cd4cc95a3080
MD5 fcad7092e98c1ecc64dee6ddf64b472c
BLAKE2b-256 0ed282e6d8644f204a3e240066e68228cb4500f0a07acc6d0fe057a8252ab5d0

See more details on using hashes here.

File details

Details for the file rats-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: rats-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for rats-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d1104f468b1919d78e6da3748c113b6d7bcfd4e2320117705ab353f3a480f6ac
MD5 5fbe4e605eba50417a2b41f9bae7863e
BLAKE2b-256 01056c6f53c9e95e9e713a36963d087991da2c2a49b5998c4aa2d3f3d9a708e3

See more details on using hashes here.

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