-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.txt
59 lines (32 loc) · 1.2 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
https://medium.com/@joel.barmettler/how-to-upload-your-python-package-to-pypi-65edc5fe9c56
#make you code publis-ready
no print statement, instead you can use logging module
everyting is in the classs. If you want to include the test code. put them in the following if statement
if __name__ =="__main__":
#create a python package
create a package (folder name, __init__.py, module files)
in the __init__.py
from MyLib.file import classA
MyLib
#create necessary files
setup.py
setup.cfg
LICENSE.txt
README.md
your package is called MyLib. MyLib is a folder. Inside the folder
MyLib
__init__.py
File1.py
File1.py
File1.py File2.py are module files.
#create a PyPi account
#upload your package to github.com
release git repo of your pacakge. (operate in github.com)
#create the distribution
python setup.py sdist
#upload the distribution
twine upload dist/*
sometimes, you will find it does not upload successfully. Usually it is because you use the project name which is not allowed in the pypi. For example, I first use pypidemo as package name, it does not allow me upload. After I change it to asfpypidemo, it works.
#check if you upload you package successfully.
pip install asfpypidemo
OK!