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
Metadata
Release files for hello-pip-first-time 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 | Reset |
|---|---|---|---|---|
| hello_pip_first_time-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / hello_pip_first_time-0.1-py3-none-any.whl
| Download URL | hello_pip_first_time-0.1-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d727668a8b1395a8380fe0186196043bc185bfe469c14d738396b0466b8e82e9
|
|
BLAKE2b-256 checksum How to use checksums |
30515ae6aafc06ea20feb81e8e6807c5174869dfa5de134464f54f2fe3976b6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|