1- from eggdriver .resources import installFromRequests , sysCommand , py
1+ from eggdriver .resources import installFromRequests , sysCommand , py , white
22
33defaultVersion = '0.0.'
44
5- """
5+ def build (autoVersion = True , baseVersion = defaultVersion ):
6+ """Build and upload a PyPI package release
7+
68FUNCTION build()
7- Build and upload a pypi package release
89
910In Windows is equal to type in the console the following lines:
1011py -m build --sdist
1112py -m build --wheel
1213py -m twine check dist/*
13- py -m twine upload dist/*
14+ py -m twine upload -u {user} -p {password} dist/*
1415"""
15- def build (autoVersion = True , baseVersion = defaultVersion ):
16- """Build and upload a pypi package release"""
1716 installFromRequests (["setuptools" , "twine" , "build" ], False )
1817 if autoVersion :
1918 setup = py .getLines ("setup" )
@@ -27,10 +26,31 @@ def build(autoVersion = True, baseVersion = defaultVersion):
2726 sysCommand ("-m build --sdist" )
2827 sysCommand ("-m build --wheel" )
2928 sysCommand ("-m twine check dist/*" )
30- sysCommand ("-m twine upload dist/*" )
29+ try :
30+ from eggconfig import pypi as info
31+ user = info ["user" ]
32+ password = info ["password" ]
33+ sysCommand (f"-m twine upload -u { user } -p { password } dist/*" )
34+ except ImportError :
35+ print (white + """Please create a eggconfig.py file in your current directory and write the following lines
36+
37+ pypi = {
38+ "user" : "{your PyPI user or "__token__"}",
39+ "password" : "{your PyPI password or token}"
40+ }
41+ """ )
3142
3243def buildEggdriver (autoVersion = True , baseVersion = defaultVersion ):
33- """Build and upload a eggdriver release"""
44+ """Build and upload a eggdriver release to PyPI
45+
46+ FUNCTION buildEggdriver()
47+
48+ In Windows is equal to type in the console the following lines
49+ py -m build --sdist
50+ py -m build --wheel
51+ py -m twine check dist/*
52+ py -m twine upload -u {user} -p {password} dist/{version}dist/eggdriver-{version}.tar.gz
53+ """
3454 installFromRequests (["setuptools" , "twine" , "build" ], False )
3555 if autoVersion :
3656 setup = py .getLines ("setup" )
@@ -47,4 +67,16 @@ def buildEggdriver(autoVersion = True, baseVersion = defaultVersion):
4767 sysCommand ("-m build --sdist" )
4868 sysCommand ("-m build --wheel" )
4969 sysCommand ("-m twine check dist/*" )
50- sysCommand ("-m twine upload dist/*" )
70+ try :
71+ from eggconfig import pypi as info
72+ user = info ["user" ]
73+ password = info ["password" ]
74+ sysCommand (f"-m twine upload -u { user } -p { password } dist/eggdriver-{ v } .tar.gz" )
75+ except ImportError :
76+ print (white + """Please create a eggconfig.py file in your current directory and write the following lines
77+
78+ pypi = {
79+ "user" : "{your PyPI user or "__token__"}",
80+ "password" : "{your PyPI password or token}"
81+ }
82+ """ )
0 commit comments