Skip to content

Commit 7ddfa2f

Browse files
Remove travis and update release code. (#131)
* Remove travis and update release code. * Support old syntax in generate_version.py.
1 parent bf9cf20 commit 7ddfa2f

File tree

5 files changed

+22
-40
lines changed

5 files changed

+22
-40
lines changed

.github/workflows/pypi-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ jobs:
3737
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
3838
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
3939
run: |
40+
python generate_version.py
4041
python setup.py bdist_wheel
4142
twine upload dist/*

.travis.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include VERSION

generate_version.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import os
2+
3+
# Automatically determine the version to push to pypi
4+
github_ref = os.environ.get('GITHUB_REF', '')
5+
prefix = 'refs/tags/v'
6+
if github_ref.startswith(prefix):
7+
version = github_ref[len(prefix):]
8+
with open('VERSION', 'w') as fp:
9+
fp.write(version)
10+
print('Wrote version %s to VERSION file.' % version)
11+
else:
12+
raise ValueError('Could not identify version in %s.' % github_ref)

setup.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,17 @@
1616
with open('README.rst') as fp:
1717
long_description = fp.read()
1818

19+
# Load the version number
20+
try:
21+
with open('VERSION') as fp:
22+
version = fp.read().strip()
23+
except FileNotFoundError:
24+
version = 'dev'
25+
1926
setuptools.setup(
2027
name='testcontainers',
2128
packages=setuptools.find_packages(exclude=['tests']),
22-
version='3.2.0',
29+
version=version,
2330
description='Library provides lightweight, throwaway instances of common databases, Selenium '
2431
'web browsers, or anything else that can run in a Docker container',
2532
author='Sergey Pirogov',

0 commit comments

Comments
 (0)