Skip to content

Commit 64f78db

Browse files
Removing TRAVIS_TAG dependency from Python code, and hardcoding version in place using sed on Travis script.
1 parent 189cbca commit 64f78db

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ install:
2323
script:
2424
- flake8 connect
2525
- pytest --cov-report=xml --cov=./connect
26+
- sed -i "s/version='0.0.0'/version='${TRAVIS_TAG}'/g" setup.py
2627

2728
after_success:
2829
- bash <(curl -s https://codecov.io/bash)

setup.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
"""
88

99
from os.path import abspath, dirname, exists, join
10-
from os import environ
1110
from setuptools import find_packages, setup
12-
from warnings import warn
1311

1412
try: # for pip >= 10
1513
# noinspection PyProtectedMember,PyPackageRequirements
@@ -26,26 +24,6 @@
2624
'sdk.txt',
2725
), session='None')
2826

29-
# Get path to version file
30-
version_path = join(
31-
dirname(abspath(__file__)),
32-
'VERSION'
33-
)
34-
35-
# Try to write version file from Travis tag
36-
travis_tag = environ.get('TRAVIS_TAG')
37-
if travis_tag and travis_tag.strip():
38-
with open(version_path, 'w') as version_file:
39-
version_file.write(travis_tag.strip())
40-
41-
# Try to read version from file
42-
try:
43-
with open(version_path, 'r') as version_file:
44-
VERSION = version_file.read().strip()
45-
except IOError:
46-
warn('`{}` file could not be read.'.format(version_path), RuntimeWarning)
47-
VERSION = ''
48-
4927
PACKAGES = find_packages(exclude=['tests*'])
5028

5129
DOC = ''
@@ -55,7 +33,7 @@
5533
setup(
5634
name='connect-sdk',
5735
author='Ingram Micro',
58-
version=VERSION,
36+
version='0.0.0',
5937
keywords='sdk connect connect automation',
6038
packages=PACKAGES,
6139
description='Connect Python SDK',

0 commit comments

Comments
 (0)