Pip packaging process
1 - verify environnent
python -V
Python 2.7.17
python -m pip --version
pip 19.3.1 from /home/jeec6230/.local/lib/python2.7/site-packages/pip (python 2.7)
2 - Install the required packages
sudo python -m pip install --upgrade pip setuptools wheel
sudo python -m pip install tqdm
sudo python -m pip install --user --upgrade twine
3 - Create an executable file without extension named as your project name
touch pip_packaging
chmod +x pip_packaging
4 - Edit this file and type in :
#!/usr/bin/env python
echo "hey there, this is my first pip package"
5 - Create a setup file setup.py
It will contain all your package metadata information.
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='pip_packaging',
version='0.1',
scripts=['pip_packaging'] ,
author="Firstname Lastname",
author_email="firstname.lastname@somwhere.org",
description="Pip packaging tutorial package",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/fnlastname/pip_packaging",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
)
6 - Compile your package
While in your repository execute the following command :
python setup.py bdist_wheel
Metadata
Release files for pip-packaging 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pip_packaging-0.1-py2-none-any.whl | Python 2 | none | any | Details for pip_packaging-0.1-py2-none-any.whl |
Release files / pip_packaging-0.1-py2-none-any.whl
| Download URL | pip_packaging-0.1-py2-none-any.whl |
|---|---|
| Size | 2.3 kB |
| Tags | Python 2 |
|
SHA-256 checksum How to use checksums |
10a6492b57fd932f5be85c6707400a83977247dd2725370d25212a0964412469
|
|
BLAKE2b-256 checksum How to use checksums |
58dbfb9579e9c04ab6f4a7dab49f7ece5f8fe6a1ee705f1b783d6a2208000edc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.15.0 pkginfo/1.8.2 requests/2.22.0 setuptools/44.1.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/2.7.17
|
Security for pip-packaging 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.