用一套方法論去設計許多方法來解決工程上遇到的問題。 即 "一生萬法、萬法圓通"。

Recent in Recipes

3/Food/post-list

如何製作 發行 Python 套件 .WHL

沒有留言

 How to Publish Your Own Python Package


1. PRE-REQUISITES

python -m pip install -upgrade pip

pip install wheel

pip install twine


STEP 1: CREATE A SEPERATE EMPTY FOLDER TO CONTAIN OUR PACKAGE

STEP2: JUMP INSIDE YOUR FOLDER AND WRITE YOUR PYTHON FILES

__init__.py

and other modules.py

STEP 3: WRITE SOME OFFICIAL FILES

setup.py


README.md


LICENSE.txt

STEP 4: UPLOADING FILES IN GITHUB



STEP 5: COMPILE THE setup.py FILE

python setup.py sdist bdist_wheel
use this command in Container folder.

After compilation, you will see some new folders named like these… build: build package information. dist: Contains your .whl file.

A WHL file is a package saved in the Wheel format,
which is the standard built-package format used for Python distributions.
You can directly install a .whl file using


pip install some_package.whl


STEP 6: CREATE AN ACCOUNT IN pypi.org AND test.pypi.org


STEP 7: CHECK YOUR PACKAGE IN pypi.org or test.pypi.org WHATEVER YOU HAVE USE

STEP 8: INSTALL YOUR PACKAGE ON YOUR PC AND TEST IT.

STEP 9: RELEASE NEW VERSIONS



沒有留言 :

張貼留言