File tree 4 files changed +42
-4
lines changed
4 files changed +42
-4
lines changed Original file line number Diff line number Diff line change
1
+ import re
2
+
3
+ import setuptools_scm
4
+
5
+
6
+ def main ():
7
+ version = setuptools_scm .get_version ()
8
+ expected_version_regex = r'(\d+\.\d+\.\d+)a(\d+).+$'
9
+ match = re .match (expected_version_regex , version )
10
+ if not match :
11
+ raise ValueError (f'Version { version } does not match the expected format' )
12
+ base_version = match .group (1 )
13
+ alpha_version = match .group (2 )
14
+ print (f'{ base_version } a{ alpha_version } ' )
15
+
16
+
17
+ if __name__ == '__main__' :
18
+ main ()
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ set -e
4
+
5
+ export SETUPTOOLS_SCM_PRETEND_VERSION=` python -m setuptools_scm | sed " s/.* //" `
6
+ if [ " ${CIRCLE_BRANCH-: } " = " master" ]; then
7
+ export SETUPTOOLS_SCM_PRETEND_VERSION=` echo $SETUPTOOLS_SCM_PRETEND_VERSION | sed " s/\+.*$//" `
8
+ elif [ " ${CIRCLE_BRANCH-: } " = " girder-5" ]; then
9
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
10
+ pip install setuptools-scm
11
+ export SETUPTOOLS_SCM_PRETEND_VERSION=$( python " $SCRIPT_DIR /get_version.py" )
12
+ fi
13
+
14
+ python -m build
15
+ twine check dist/*
16
+ twine upload --skip-existing dist/*
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ def prerelease_local_scheme(version):
17
17
"""
18
18
from setuptools_scm .version import get_local_node_and_date
19
19
20
- if os .getenv ('CIRCLE_BRANCH' ) in ('master' , ):
20
+ if os .getenv ('CIRCLE_BRANCH' ) in ('master' , 'girder-5' ):
21
21
return ''
22
22
else :
23
23
return get_local_node_and_date (version )
Original file line number Diff line number Diff line change @@ -90,18 +90,22 @@ commands =
90
90
npm run format
91
91
92
92
[testenv:release]
93
+ allowlist_externals =
94
+ {toxinidir}/.circleci/publish_pypi.sh
95
+ skip_install = true
96
+ skipsdist = true
93
97
passenv =
94
98
TWINE_USERNAME
95
99
TWINE_PASSWORD
96
100
TWINE_REPOSITORY_URL
97
101
CIRCLE_BRANCH
98
102
deps =
99
103
build
104
+ setuptools-git
105
+ setuptools-scm
100
106
twine
101
107
commands =
102
- python -m build
103
- twine check dist/*
104
- twine upload --skip-existing dist/*
108
+ {toxinidir}/.circleci/publish_pypi.sh
105
109
106
110
[flake8]
107
111
max-line-length = 100
You can’t perform that action at this time.
0 commit comments