Skip to content

Commit bc0c844

Browse files
author
Erik Nielsen
committed
Merge branch 'beta'. To become version 0.9.1.1
Adds germ selection hot fix, report optimization, verbosity tweaking, and other minor updates.
2 parents 6717dc8 + 85ed2d8 commit bc0c844

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+755
-530
lines changed

.travis.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,6 @@ after_script:
5555
echo "Build failed - not deploying!!!!!!"
5656
fi
5757
58-
deploy:
59-
- provider: pypi
60-
user: enielse
61-
password:
62-
secure: CefzPGiJxOMN6jJPBj1/ORir+qWQsVdF6pVS/kzyT+XzCGAfOyRwq93Nxw+zXuFTZ49ycDEq3QFSpicVswVoZsyX6JUV2tn2ggblwJ/+pPYiYGSjDoEAaxih1FQ265zUTOgKWFjNt9ZN3V359dhOVKP1KdRQPYTJpDZlmKQrdCOiLp4sFuonAdfuKxlYQWt/P4N/THDS71l+muG0e0h7mfb8L9mdrQrgDXUGBqpf0PUdoaH13qsIyeatzPCYXfyzxiw/jPAxloM48BluDLS6xuNvUiuN09ry5Ie5iJ/Sc8Sen6U3MmxYDURUHWtjvr0q2BkJcQ3X2DODjCirdiMBILI3tY+oOolOphN6eiKc+ntOvuB0Vf/w5Z+VEpGOQAWYMOJX772Pv83r07BBBTJoh8q7XU5fOLyFk2hD0s7/3ASmzkNYqUHCGL5tACUT8nMVIaNfCX9gKhxX+oFpDfBhps23dTZnz1hDK3odmXp1t+UNpVOqfpgIfoBIsvfBRbyVfoYGxp3dMaSo6MOXEOzdw506UfjblzAw7+dy/vueOTQdFIBH9Z+UZmUwJ+F6uDkiJf4KBPdx+Ex8jzcmBzh6vsG95FBbOhHmbqOknCHJO2MZvBxY0uI+EaxjoTFVnXgeW99v/pca9vsLmEON5Mg1XgDC4T2F7od2XmUTebGIbhk=
63-
on:
64-
branch: master
65-
66-
6758
notifications:
6859
email:
6960
on_success: change

CI/deploy

Lines changed: 118 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,24 @@
22
from __future__ import print_function
33
import subprocess, sys, os
44

5+
pypirc_contents = \
6+
"""[distutils]
7+
index-servers =
8+
pypi
9+
pypitest
10+
11+
[pypi]
12+
repository=https://pypi.python.org/pypi
13+
username=%s
14+
password=%s
15+
16+
[pypitest]
17+
repository=https://testpypi.python.org/pypi
18+
username=%s
19+
password=%s
20+
""" % (os.environ['PYPI_USER'], os.environ['PYPI_PASS'],
21+
os.environ['PYPI_USER'], os.environ['PYPI_PASS'])
22+
523
print('Travis CI Passed')
624

725
# Prevents merging certain files, i.e. .travis.yml
@@ -23,82 +41,107 @@ for branch in branches:
2341
print('Branches existing on Travis Server: %s' % output)
2442
print('Branchname (or SHA) is %s' % branchname)
2543

26-
# Relevant:
27-
# (Explains the usage of merge-base and merge-tree commands to view if merge is valid
28-
# http://stackoverflow.com/questions/501407/is-there-a-git-merge-dry-run-option
29-
30-
# Attempt to auto-merge develop into pre-beta if travis tests pass
31-
32-
33-
print('Resetting remote/origin')
34-
subprocess.call(['git', 'remote', 'remove', 'origin'])
35-
print('Done.')
36-
print('Re-adding origin..')
37-
subprocess.call(['git', 'remote', 'add', 'origin', 'https://github.com/pyGSTio/pyGSTi.git'])
38-
print('Done.')
39-
print('Updating remote')
40-
subprocess.call(['git', 'remote', 'update'])
41-
subprocess.call(['git', 'fetch'])
42-
43-
print('Setting up user credentials')
44-
45-
EMAIL = os.environ['EMAIL']
46-
USER = os.environ['USER']
47-
subprocess.call(['git', 'config', '--global', 'user.email', EMAIL])
48-
subprocess.call(['git', 'config', '--global', 'user.name', USER])
49-
print('Done')
50-
51-
print('Getting the latest version of beta')
52-
print('Deleting local version, if it exists')
53-
subprocess.call(['git', 'branch', '-D', 'beta']) # So that we can verify beta doesn't exist locally
54-
print('Fetching from origin')
55-
subprocess.call(['git', 'fetch', 'origin']) # Then grab it..
56-
print('Recreating local branch')
57-
subprocess.call(['git', 'checkout', '-b', 'beta', 'origin/beta']) # And switch to it
58-
print('Done.')
59-
print('Getting SHA of merge-base (To view merge tree between %s and beta' % branchname)
60-
SHAOut = subprocess.check_output(['git',
61-
'merge-base',
62-
branchname, # OUR version of develop
63-
'beta'] )
64-
SHA = SHAOut.decode('utf-8').replace('\n', '')
65-
print('Done. SHA was %s' % SHA)
66-
print('Creating merge-tree')
67-
output = subprocess.check_output(['git',
68-
'merge-tree',
69-
SHA,
70-
'beta',
71-
branchname]) # View merge tree between beta and (our) develop
72-
output = output.decode('utf-8', 'ignore')
73-
print('Done:')
74-
# print(output)
44+
HOME = os.environ['HOME']
45+
TRAVIS_BRANCH = os.environ['TRAVIS_BRANCH']
46+
TRAVIS_PULL_REQUEST = os.environ['TRAVIS_PULL_REQUEST']
47+
print("TRAVIS_BRANCH = ",TRAVIS_BRANCH)
48+
print("TRAVIS_PULL_REQUEST = ",TRAVIS_PULL_REQUEST)
7549

76-
canMerge = ('<' * 5) not in output # '<' * 5 avoids git finding the expanded string in this file and thinking it is a merge conflict
7750

78-
if canMerge:
79-
print('Merge of develop into beta is possible')
80-
# The below code is active, but only for testing
81-
subprocess.call(['git', 'merge', '--no-ff', '--no-commit', 'develop']) #into beta
82-
print('Merge command finished.')
83-
print('Staging files..')
84-
subprocess.call(['git', 'add', '-u'])
85-
print('Committing..')
86-
subprocess.call(['git', 'commit', '--no-verify', '-m',
87-
'Auto-merged develop -> beta (No conflicts, CI passed)'])
88-
print('Commit finished')
51+
if TRAVIS_BRANCH == "develop" and TRAVIS_PULL_REQUEST == "false":
52+
53+
# Relevant:
54+
# (Explains the usage of merge-base and merge-tree commands to view if merge is valid
55+
# http://stackoverflow.com/questions/501407/is-there-a-git-merge-dry-run-option
56+
57+
# Attempt to auto-merge develop into pre-beta if travis tests pass
58+
59+
60+
print('Resetting remote/origin')
61+
subprocess.call(['git', 'remote', 'remove', 'origin'])
62+
print('Done.')
63+
print('Re-adding origin..')
64+
subprocess.call(['git', 'remote', 'add', 'origin', 'https://github.com/pyGSTio/pyGSTi.git'])
65+
print('Done.')
66+
print('Updating remote')
67+
subprocess.call(['git', 'remote', 'update'])
68+
subprocess.call(['git', 'fetch'])
69+
70+
print('Setting up user credentials')
71+
72+
EMAIL = os.environ['EMAIL']
73+
USER = os.environ['USER']
74+
subprocess.call(['git', 'config', '--global', 'user.email', EMAIL])
75+
subprocess.call(['git', 'config', '--global', 'user.name', USER])
76+
print('Done')
77+
78+
print('Getting the latest version of beta')
79+
print('Deleting local version, if it exists')
80+
subprocess.call(['git', 'branch', '-D', 'beta']) # So that we can verify beta doesn't exist locally
81+
print('Fetching from origin')
82+
subprocess.call(['git', 'fetch', 'origin']) # Then grab it..
83+
print('Recreating local branch')
84+
subprocess.call(['git', 'checkout', '-b', 'beta', 'origin/beta']) # And switch to it
85+
print('Done.')
86+
print('Getting SHA of merge-base (To view merge tree between %s and beta' % branchname)
87+
SHAOut = subprocess.check_output(['git',
88+
'merge-base',
89+
branchname, # OUR version of develop
90+
'beta'] )
91+
SHA = SHAOut.decode('utf-8').replace('\n', '')
92+
print('Done. SHA was %s' % SHA)
93+
print('Creating merge-tree')
94+
output = subprocess.check_output(['git',
95+
'merge-tree',
96+
SHA,
97+
'beta',
98+
branchname]) # View merge tree between beta and (our) develop
99+
output = output.decode('utf-8', 'ignore')
100+
print('Done:')
101+
# print(output)
102+
103+
canMerge = ('<' * 5) not in output # '<' * 5 avoids git finding the expanded string in this file and thinking it is a merge conflict
104+
105+
if canMerge:
106+
print('Merge of develop into beta is possible')
107+
# The below code is active, but only for testing
108+
subprocess.call(['git', 'merge', '--no-ff', '--no-commit', 'develop']) #into beta
109+
print('Merge command finished.')
110+
print('Staging files..')
111+
subprocess.call(['git', 'add', '-u'])
112+
print('Committing..')
113+
subprocess.call(['git', 'commit', '--no-verify', '-m',
114+
'Auto-merged develop -> beta (No conflicts, CI passed)'])
115+
print('Commit finished')
116+
117+
PUSHKEY = os.environ['PUSHKEY']
118+
push_uri = 'https://%s:%[email protected]/pyGSTio/pyGSTi.git' % (USER, PUSHKEY) # yikes
119+
try:
120+
print('Pushing to origin/beta. If this fails, there shouldn\'t be any useful output, since it would contain my access token')
121+
with open(os.devnull, 'w') as FNULL:
122+
result = subprocess.call(['git', 'push', '--no-verify', push_uri, 'beta'], stdout=FNULL, stderr=FNULL)
123+
if result != 0:
124+
print('Secure push failed')
125+
else:
126+
print('Secure push worked')
127+
except:
128+
print('Secure push failed')
129+
130+
else:
131+
print('Potential merge conflicts found! Cannot merge beta into develop')
89132

90-
PUSHKEY = os.environ['PUSHKEY']
91-
push_uri = 'https://%s:%[email protected]/pyGSTio/pyGSTi.git' % (USER, PUSHKEY) # yikes
92-
try:
93-
print('Pushing to origin/beta. If this fails, there shouldn\'t be any useful output, since it would contain my access token')
94-
with open(os.devnull, 'w') as FNULL:
95-
result = subprocess.call(['git', 'push', '--no-verify', push_uri, 'beta'], stdout=FNULL, stderr=FNULL)
96-
if result != 0:
97-
print('Secure push failed')
98-
else:
99-
print('Secure push worked')
100-
except:
101-
print('Secure push failed')
133+
#if TRAVIS_BRANCH == "develop" and TRAVIS_PULL_REQUEST == "false":
134+
# print("Attempting to deploy on pypitest")
135+
# f = open(os.path.join(HOME,".pypirc"),"w")
136+
# f.write(pypirc_contents)
137+
# f.close()
138+
# print("Running setup.py...")
139+
# os.system("python setup.py sdist upload -r pypitest")
102140

103-
else:
104-
print('Potential merge conflicts found! Cannot merge beta into develop')
141+
if TRAVIS_BRANCH == "master" and TRAVIS_PULL_REQUEST == "false":
142+
print("Attempting to deploy on pypi")
143+
f = open(os.path.join(HOME,".pypirc"),"w")
144+
f.write(pypirc_contents)
145+
f.close()
146+
print("Running setup.py...")
147+
os.system("python setup.py sdist upload -r pypi")

packages/pygsti/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.9.1"
1+
__version__ = "0.9.1.1"

0 commit comments

Comments
 (0)