Skip to main content

Pip packaging tutorial package

Project description

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

pip_packaging-0.1-py2-none-any.whl (2.3 kB view hashes)

Uploaded Python 2

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