Skip to content

Commit 55e0fc6

Browse files
author
1138-4EB
committed
fix release scripts
1 parent 16ab081 commit 55e0fc6

4 files changed

Lines changed: 25 additions & 25 deletions

File tree

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ matrix:
7474
if: tag IS present
7575
script:
7676
- git fetch --unshallow --tags
77-
- python tools/new_release.py 'check'
77+
- python tools/new_release.py --check
7878
deploy:
7979
provider: pypi
8080
distributions: sdist
@@ -84,4 +84,4 @@ matrix:
8484
password: $PYPI_PASSWORD
8585
on:
8686
repo: VUnit/vunit
87-
branch: master
87+
all_branches: true

docs/contributing.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,12 +191,15 @@ which is tagged.
191191

192192
In order to tag a commit:
193193

194-
- Set a new version in ``vunit/about.py``.
195-
- Add a corresponding release note in ``docs/release_notes/X.Y.Z.rst``. The
196-
release note files in ``docs/release_notes/`` are used to
194+
- If required, bump version in ``vunit/about.py``.
195+
- Add corresponding release notes in ``docs/release_notes/X.Y.Z.rst``. The
196+
release notes files in ``docs/release_notes/`` are used to
197197
automatically generate the :ref:`release notes <release_notes>`.
198-
- Execute ``python tools/new_release.py``.
198+
- Commit changes.
199+
- Execute ``python tools/new_release.py``. To generate a release candidate, use cli arg ``--rc``.
199200
- Push the new version/tag: ``git push vX.Y.Z``.
201+
- Bump version in ``vunit/about.py``.
202+
- Commit changes.
200203

201204
Travic CI makes a release by uploading a new package to PyPI when a tag
202205
named ``vX.Y.Z`` is found in Git. A new release will not be made if:

tools/new_release.py

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ def tag_release(ver):
5454
check_output([
5555
'git',
5656
'tag',
57-
'"v' + ver + '" -a -m "Generated tag from TravisCI for release ' + ver + '"'
57+
'v%s' % ver,
58+
'-a',
59+
'-m',
60+
'release %s' % ver,
5861
])
5962

6063

@@ -67,31 +70,26 @@ def check_release(ver):
6770
% (ver, ver))
6871
sys.exit(1)
6972

70-
if ver.endswith("rc0"):
71-
print("Not releasing version %s since it ends with rc0" % ver)
72-
sys.exit(1)
73-
7473
with urlopen('https://pypi.python.org/pypi/vunit_hdl/json') as fptr:
7574
info = json.load(fptr)
7675

7776
if ver in info["releases"].keys():
7877
print("Version %s has already been released" % ver)
7978
sys.exit(1)
8079

81-
check_output([
82-
'sed',
83-
'-i',
84-
'"s/PRE_RELEASE = True/PRE_RELEASE = False/"',
85-
'vunit/about.py'
86-
])
87-
88-
print("Releasing new version: %s" % ver)
89-
9080

9181
if __name__ == "__main__":
82+
if '--rc' not in sys.argv:
83+
check_output([
84+
'sed',
85+
'-i',
86+
's/PRE_RELEASE = True/PRE_RELEASE = False/',
87+
'vunit/about.py'
88+
])
89+
9290
VER = get_local_version()
9391

94-
if sys.argv[1] == 'check':
92+
if '--check' in sys.argv:
9593
check_release(VER)
96-
97-
tag_release(VER)
94+
else:
95+
tag_release(VER)

vunit/about.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,4 @@ def version():
7070

7171
VERSION = (4, 1, 0)
7272

73-
# DO NOT TOUCH: Only set to False by PyPI deployment script
74-
PRE_RELEASE = True
73+
PRE_RELEASE = False

0 commit comments

Comments
 (0)