Skip to content

Instantly share code, notes, and snippets.

@jinhangjiang
Last active May 26, 2022 21:39
Show Gist options
  • Save jinhangjiang/c32d69db931e229ef2d0830070c5c7a6 to your computer and use it in GitHub Desktop.
Save jinhangjiang/c32d69db931e229ef2d0830070c5c7a6 to your computer and use it in GitHub Desktop.
Instructions to publish python lib
from ._Class1 import Function1
from ._Class1 import Function2
from ._Class2 import Function1
...
pip install relative_path_to_yourpackage.tar.gz
twine check dist/*
twine upload --repository-url https://test.pypi.org/legacy/ dist/* #pay attention there is an extra space before dist.
twine upload dist/*
from Lib1._Class1 import Function1
from Lib1._Class1 import Function2
from Lib1._Class2 import Function1
...
from YourPackage.Class1 import Function1
from .._ClassFromThePreviousFolder import Function1
__all__ = [ 'Function1',
'Function2',
...,
'FunctionN'
]
pip install setuptools
pip install twine # not needed for internally share
pip install wheel
pip install pytest # optional
# First, change root disk
C:\User\Yourname> d:
# Second, navigate to the folder
D:\> cd D:\my_works\Your-First-Python-Package-on-PyPI
C:\User\Yourname> jupyter notebook --notebook-dir D:/my_works/Your-First-Python-Package-on-PyPI
python setup.py sdist bdist_wheel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment