File tree Expand file tree Collapse file tree 3 files changed +17
-1
lines changed
Expand file tree Collapse file tree 3 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 1515 uses : actions/setup-python@v2
1616 with :
1717 python-version : ' 3.x'
18+ - name : Determine version from git tag
19+ id : version
20+ run : echo ::set-output name=tag::${GITHUB_REF#refs/*/}
21+
22+ - name : set version
23+ run : |
24+ rm ./version.py
25+ echo version_number = \"${{ steps.version.outputs.tag }}\" > ./version.py
1826 - name : Install dependencies
1927 run : |
2028 python -m pip install --upgrade pip
Original file line number Diff line number Diff line change 33
44import os
55import codecs
6+ import re
7+ from pathlib import Path
8+
69from setuptools import setup
710
811
912def read (fname ):
1013 file_path = os .path .join (os .path .dirname (__file__ ), fname )
1114 return codecs .open (file_path , encoding = 'utf-8' ).read ()
1215
16+ HERE = Path (__file__ ).parent
17+ _version_file_contents = (HERE / "version.py" ).read_text ()
18+ matched = re .search (r'"(.*)"' , _version_file_contents )
19+ VERSION = matched .group (1 ) if matched is not None else "UNKNOWN VERSION"
1320
1421setup (
1522 name = 'pytest-approvaltests' ,
16- version = '0.2.3' ,
23+ version = VERSION ,
1724 author = 'Emily Bache' ,
1825 author_email = 'emily@bacheconsulting.com' ,
1926 maintainer = 'Emily Bache' ,
Original file line number Diff line number Diff line change 1+ version_number = "v5.0.1"
You can’t perform that action at this time.
0 commit comments