Skip to content

Commit 749e5e3

Browse files
author
Marco Gario
authored
Upload to PypPi (Test) (pysmt#571)
Upload pypi package to test pypi repository
1 parent 6d792db commit 749e5e3

File tree

2 files changed

+34
-7
lines changed

2 files changed

+34
-7
lines changed

azure-pipelines.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848

4949

5050
- job: 'Ubuntu16All'
51-
condition: or(eq(variables['Build.SourceBranchName'], 'master'), eq(variables['Build.Reason'], 'PullRequest'))
51+
condition: or(eq(variables['build.sourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest'))
5252
pool:
5353
vmImage: 'Ubuntu-16.04'
5454
strategy:
@@ -98,7 +98,7 @@ jobs:
9898

9999

100100
- job: 'Ubuntu16Py27'
101-
condition: or(eq(variables['Build.SourceBranchName'], 'master'), eq(variables['Build.Reason'], 'PullRequest'))
101+
condition: or(eq(variables['build.sourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest'))
102102
pool:
103103
vmImage: 'Ubuntu-16.04'
104104
strategy:
@@ -146,7 +146,7 @@ jobs:
146146

147147

148148
- job: 'Ubuntu16PyPy2'
149-
condition: or(eq(variables['Build.SourceBranchName'], 'master'), eq(variables['Build.Reason'], 'PullRequest'))
149+
condition: or(eq(variables['build.sourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest'))
150150
pool:
151151
vmImage: 'Ubuntu-16.04'
152152
strategy:
@@ -191,7 +191,7 @@ jobs:
191191

192192

193193
- job: 'Ubuntu16PyPy3'
194-
condition: or(eq(variables['Build.SourceBranchName'], 'master'), eq(variables['Build.Reason'], 'PullRequest'))
194+
condition: or(eq(variables['build.sourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest'))
195195
pool:
196196
vmImage: 'Ubuntu-16.04'
197197
strategy:
@@ -236,7 +236,7 @@ jobs:
236236

237237

238238
- job: 'OSX10_13'
239-
condition: or(eq(variables['Build.SourceBranchName'], 'master'), eq(variables['Build.Reason'], 'PullRequest'))
239+
condition: or(eq(variables['build.sourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest'))
240240
pool:
241241
vmImage: 'macOS-10.13'
242242
strategy:
@@ -278,7 +278,7 @@ jobs:
278278

279279

280280
- job: 'Win2016'
281-
condition: or(eq(variables['Build.SourceBranchName'], 'master'), eq(variables['Build.Reason'], 'PullRequest'))
281+
condition: or(eq(variables['build.sourceBranch'], 'refs/heads/master'), eq(variables['Build.Reason'], 'PullRequest'))
282282
pool:
283283
vmImage: 'vs2017-win2016'
284284
strategy:
@@ -311,3 +311,24 @@ jobs:
311311
- bash: ci/run_win.sh
312312
displayName: 'Testing'
313313

314+
- job: PyPi
315+
dependsOn:
316+
- 'Ubuntu16Py37'
317+
- 'Ubuntu16All'
318+
- 'Ubuntu16Py27'
319+
- 'Ubuntu16PyPy2'
320+
- 'Ubuntu16PyPy3'
321+
- 'OSX10_13'
322+
- 'Win2016'
323+
condition: and(succeeded(), eq(variables['build.sourceBranch'], 'refs/heads/master'))
324+
steps:
325+
- bash: pip install twine wheel
326+
displayName: 'Install Twine and Wheel'
327+
- script: './make_distrib.sh'
328+
displayName: 'Make Distrib'
329+
- script: 'cd dist; zip PySMT*.whl six.py'
330+
- task: TwineAuthenticate@0
331+
inputs:
332+
externalFeeds: PyPITest
333+
- script: 'python -m twine upload -r pySMT --config-file $(PYPIRC_PATH) dist/*.whl'
334+
displayName: 'Uploading to PyPI-Test'

pysmt/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
__version__ = "%d.%d.%d%s%d" % VERSION if len(VERSION) == 5 else \
2323
"%d.%d.%d" % VERSION
2424

25-
2625
def git_version():
2726
"""Human-readable version of latest commit.
2827
@@ -43,3 +42,10 @@ def git_version():
4342
return __version__ # pragma: no cover
4443
except OSError:
4544
return __version__ # pragma: no cover
45+
46+
# Override version number in dev branch to include the number of
47+
# commits since the release
48+
if len(VERSION) == 5:
49+
commits_from_tag = git_version().split("-")[1]
50+
VERSION = VERSION[:4] + (commits_from_tag,)
51+
__version__ = "%d.%d.%d%s%s" % VERSION

0 commit comments

Comments
 (0)