@@ -28,14 +28,16 @@ class pypi {
2828 mkdir ( this . tempPyDir + '/tests/' ) ; // just empty folder
2929 // copy python folder to temp dir
3030 const pypiPackageName = this . exchangeConfigs [ exchange ] . __PYTHON_PACKAGE_NAME__ ;
31- const pypiPackageNameSanitized = this . sanitizeFolderName ( pypiPackageName ) ;
31+ const pypiPackageNameSanitized = this . sanitizeFolderName ( pypiPackageName ) ;
3232 const pkgDir = this . tempPyDir + '/src/' + pypiPackageNameSanitized ;
3333 mkdir ( pkgDir ) ;
34- cp ( this . rootDir + `/${ this . exchange } ` , pkgDir ) ;
34+ cp ( this . rootDir + `/${ this . exchange } ` , pkgDir ) ;
3535 // copy readme
36- cp ( this . rootDir + `/README.md` , this . tempPyDir + '/README.md' ) ;
36+ cp ( this . rootDir + `/README.md` , this . tempPyDir + '/README.md' ) ;
3737 // write pyproject.toml
3838 fs . writeFileSync ( this . tempPyDir + '/pyproject.toml' , this . pyprojectTolmContent ( pypiPackageNameSanitized ) ) ;
39+ this . pythonPackageBuild ( ) ;
40+ this . twinePublish ( ) ;
3941 }
4042
4143 sanitizeFolderName ( name :string ) {
@@ -75,17 +77,19 @@ class pypi {
7577 }
7678
7779
78- pythonBuild ( ) {
79- const output1 = execSync ( `cd ${ this . tempPyDir } && python -m build` ) ;
80- console . log ( output1 . toString ( ) ) ;
81-
82- const output2 = execSync ( `cd ${ this . tempPyDir } && twine upload dist/*` , {
80+ pythonPackageBuild ( ) {
81+ const res = execSync ( `cd ${ this . tempPyDir } && python -m build` ) ;
82+ console . log ( res . toString ( ) ) ;
83+ }
84+
85+ twinePublish ( ) {
86+ const res = execSync ( `cd ${ this . tempPyDir } && twine upload dist/*` , {
8387 env : {
8488 TWINE_USERNAME : '__token__' ,
8589 TWINE_PASSWORD : this . pypiApiSecret
8690 }
8791 } ) ;
88- console . log ( output2 . toString ( ) ) ;
92+ console . log ( res . toString ( ) ) ;
8993 }
9094}
9195
0 commit comments