File tree 2 files changed +28
-2
lines changed
2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change
1
+ name : Build & Deploy to PyPI on Release
2
+
3
+ on :
4
+ release :
5
+ types : [released]
6
+
7
+ jobs :
8
+ deploy :
9
+ name : PyPI Deploy
10
+ runs-on : ubuntu-latest
11
+ steps :
12
+ - uses : actions/checkout@v2
13
+ - uses : actions/setup-python@v2
14
+ - id : dist
15
+ uses : casperdcl/deploy-pypi@v2
16
+ with :
17
+ requirements : twine setuptools wheel
18
+ build : true
19
+ password : ${{ secrets.PYPI_TOKEN }}
20
+ upload : true
Original file line number Diff line number Diff line change 1
1
import setuptools
2
- from statsapi import version
2
+ from distutils .util import convert_path
3
+
4
+ # https://stackoverflow.com/questions/2058802/how-can-i-get-the-version-defined-in-setup-py-setuptools-in-my-package
5
+ main_ns = {}
6
+ ver_path = convert_path ("statsapi/version.py" )
7
+ with open (ver_path ) as ver_file :
8
+ exec (ver_file .read (), main_ns )
3
9
4
10
with open ("README.md" , "r" ) as fh :
5
11
long_description = fh .read ()
6
12
7
13
setuptools .setup (
8
14
name = "MLB-StatsAPI" ,
9
- version = version . VERSION ,
15
+ version = main_ns [ " VERSION" ] ,
10
16
author = "Todd Roberts" ,
11
17
author_email = "todd@toddrob.com" ,
12
18
description = "MLB Stats API Wrapper for Python" ,
You can’t perform that action at this time.
0 commit comments