Skip to main content

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

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)

Table of built distributions (wheels) for pip-packaging 0.1
File Interpreter ABI Platform
pip_packaging-0.1-py2-none-any.whl Python 2 none any Details

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

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page