Skip to content

Commit 89606af

Browse files
committed
read setup.py version from context
1 parent 27393c5 commit 89606af

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/tests_build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ jobs:
1818
- name: Install dependencies
1919
run: |
2020
python -m pip install --upgrade pip
21-
python setup.py sdist
22-
pip install --upgrade dist/*.tar.gz coveralls mock
21+
pip install --upgrade coveralls mock
2322
2423
- name: Run unit tests
2524
run: coverage run --omit=pythesint/tests/* --source=pythesint setup.py test
@@ -29,6 +28,12 @@ jobs:
2928
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3029
run: coveralls --service=github
3130

31+
- name: Build Python package
32+
if: github.event_name == 'release'
33+
run: >
34+
PYTHESINT_RELEASE="${GITHUB_REF#refs/tags/}"
35+
python setup.py sdist
36+
3237
- name: Publish Python package
3338
if: github.event_name == 'release'
3439
uses: pypa/gh-action-pypi-publish@release/v1

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
# Copyright:(c) NERSC
1010
# License: GPLv3
1111
#-------------------------------------------------------------------------------
12+
import os
1213
from setuptools import setup, find_packages
1314
from setuptools.command.install_scripts import install_scripts
1415
from os import path
@@ -35,7 +36,7 @@ def run(self):
3536
setup(
3637
name=NAME,
3738

38-
version='1.5.1',
39+
version=os.getenv('PYTHESINT_RELEASE', '0.0.0dev').lstrip('v'),
3940

4041
description='A Python interface to various metadata vocabularies',
4142
long_description=long_description,

0 commit comments

Comments
 (0)