How to submit a pip package
Project description
Hello pip-first-time
Before you do anything, make sure you create an account oon pypi.org. It's important to constantly share your code and ideas with others as it'll imrpove the quality over time. It's very easy to convince yourself that some piece of code is useful and well written if noone is using it.
Installing the right packages
Before you get started I'll assume you've went ahead and downloaded the Python Anaconda distribution
Then you want to go
conda create -n hello-pip
conda install setuptools wheel twine tqdm
- setuptools: will help us setup our package metadata information
- wheel: is the format for python packages
- twine: is a utility which will help us upload packages to PyPi
- tqdm: taqadom in arabic which means progress is a way to track progress bars
Project Setup
Then setup your directories in the same way as this repo
- README: Is this document, your chance to pitch your product. Most people will skim this before they read the rest of your code so take particular care in writing it
- LICENSE: Pick whatever works for your usecase - check out tldrlegal.com if you're not sure what to pick
- setup.py: Will contain all your package metadata
- hello-pip: is an executable we need to make runnable by typing
chmod +x hello-pip
Compiling Package
Run python setup.py bdist_wheel
which will create 3 new folders in your directory
- Build/
- dist/
- hello_pip.egg.info/
The dist folder contains your package in wheel format so if you'd like to run your package locally you can run
pip install dist/hello_pip-0.1-py3-none-any.whl
You need to specify your own package name, package version and python version. Just use Python 3 at this point if you can.
Upload to PyPi
Create a file called .pyrirc
and put in your home directory. Then run
python -m twine upload dist/*
Next steps
- Build a more complete tutorial, instad of echo, upload a class others can import
- Build a package people use and love
References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file hello_pip_first_time-0.1-py3-none-any.whl
.
File metadata
- Download URL: hello_pip_first_time-0.1-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d727668a8b1395a8380fe0186196043bc185bfe469c14d738396b0466b8e82e9 |
|
MD5 | 46462be7e6a9eb3d9cd742d3be89d754 |
|
BLAKE2b-256 | 30515ae6aafc06ea20feb81e8e6807c5174869dfa5de134464f54f2fe3976b6a |