File tree Expand file tree Collapse file tree 2 files changed +41
-6
lines changed Expand file tree Collapse file tree 2 files changed +41
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Upload Python Package to PyPI when a Release is Created
2
+
3
+ on :
4
+ release :
5
+ types : [created]
6
+
7
+ jobs :
8
+ pypi-publish :
9
+ name : Publish release to PyPI
10
+ runs-on : ubuntu-latest
11
+ environment :
12
+ name : pypi
13
+ url : https://pypi.org/p/iksemel
14
+ permissions :
15
+ id-token : write
16
+ steps :
17
+ - uses : actions/checkout@v4
18
+ - name : Set up Python
19
+ uses : actions/setup-python@v4
20
+ with :
21
+ python-version : " 3.x"
22
+ - name : Install dependencies
23
+ run : |
24
+ python -m pip install --upgrade pip
25
+ pip install setuptools wheel
26
+ - name : Build package
27
+ run : |
28
+ python setup.py sdist bdist_wheel # Could also be python -m build
29
+ - name : Publish package distributions to PyPI
30
+ uses : pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change 14
14
import glob
15
15
import shutil
16
16
import subprocess
17
- from distutils .core import setup , Extension
18
- from distutils .command .install import install
17
+ from setuptools import setup , Extension
18
+ from setuptools .command .install import install
19
+ import unittest
19
20
20
21
version = '1.6.2'
21
22
40
41
"""
41
42
42
43
if 'test' in sys .argv :
43
- import unittest
44
44
test_loader = unittest .TestLoader ()
45
45
test_suite = test_loader .discover ('python/test/' , pattern = '*.py' )
46
- if test_suite :
47
- print ("all tests passed :)" )
46
+ test_result = unittest .TextTestRunner ().run (test_suite )
47
+ if test_result .wasSuccessful ():
48
+ print ("All tests passed :)" )
48
49
sys .exit (0 )
49
- sys .exit (1 )
50
+ else :
51
+ print ("Some tests failed :(" )
52
+ sys .exit (1 )
50
53
51
54
52
55
class Install (install ):
53
56
def finalize_options (self ):
57
+ # Uncomment and modify if specific install locations are needed
54
58
# if os.path.exists("/etc/sulin-release"):
55
59
# self.install_platlib = '$base/lib/sulin'
56
60
# self.install_purelib = '$base/lib/sulin'
@@ -83,3 +87,4 @@ def run(self):
83
87
'install' : Install
84
88
}
85
89
)
90
+
You can’t perform that action at this time.
0 commit comments