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 15
15
uses : actions/setup-python@v2
16
16
with :
17
17
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
18
26
- name : Install dependencies
19
27
run : |
20
28
python -m pip install --upgrade pip
Original file line number Diff line number Diff line change 3
3
4
4
import os
5
5
import codecs
6
+ import re
7
+ from pathlib import Path
8
+
6
9
from setuptools import setup
7
10
8
11
9
12
def read (fname ):
10
13
file_path = os .path .join (os .path .dirname (__file__ ), fname )
11
14
return codecs .open (file_path , encoding = 'utf-8' ).read ()
12
15
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"
13
20
14
21
setup (
15
22
name = 'pytest-approvaltests' ,
16
- version = '0.2.3' ,
23
+ version = VERSION ,
17
24
author = 'Emily Bache' ,
18
25
author_email = 'emily@bacheconsulting.com' ,
19
26
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