def push_pyup_requirements_commit(): """Because pyup updates each package individually, it can create a requirements.txt with an incompatible set of versions. Depending on the changes, pyup might also have introduced whitespace errors. If we've recompiled requirements.txt in Travis and made changes, and this is a PR where pyup is running, push a consistent set of versions as a new commit to the PR. """ if is_pyup_branch(): print('Pushing new requirements, as this is a pyup pull request') print('Decrypting secrets') tools.decrypt_secrets() tools.configure_git() print('Creating commit') tools.git('add', '--update', 'requirements') tools.git( 'commit', '-m', 'Bump requirements for pyup pull request' ) print('Pushing to GitHub') subprocess.check_call([ 'ssh-agent', 'sh', '-c', 'ssh-add %s && ' % (shlex.quote(tools.DEPLOY_KEY),) + 'git push ssh-origin HEAD:%s' % ( os.environ['TRAVIS_PULL_REQUEST_BRANCH'], ) ])
def push_pyup_requirements_commit(): """Because pyup updates each package individually, it can create a requirements.txt with an incompatible set of versions. Depending on the changes, pyup might also have introduced whitespace errors. If we've recompiled requirements.txt in Travis and made changes, and this is a PR where pyup is running, push a consistent set of versions as a new commit to the PR. """ if is_pyup_branch(): print("Pushing new requirements, as this is a pyup pull request") print("Decrypting secrets") tools.decrypt_secrets() tools.configure_git() print("Creating commit") tools.git("add", "--update", "requirements") tools.git("commit", "-m", "Bump requirements for pyup pull request") print("Pushing to GitHub") subprocess.check_call([ "ssh-agent", "sh", "-c", "ssh-add %s && " % (shlex.quote(tools.DEPLOY_KEY), ) + "git push ssh-origin HEAD:%s" % (os.environ["TRAVIS_PULL_REQUEST_BRANCH"], ), ])
def push_pyup_requirements_commit(): """Because pyup updates each package individually, it can create a requirements.txt with an incompatible set of versions. Depending on the changes, pyup might also have introduced whitespace errors. If we've recompiled requirements.txt in Travis and made changes, and this is a PR where pyup is running, push a consistent set of versions as a new commit to the PR. """ if is_pyup_branch(): print("Pushing new requirements, as this is a pyup pull request") print("Decrypting secrets") tools.decrypt_secrets() tools.configure_git() print("Creating commit") tools.git("add", "--update", "requirements") tools.git("commit", "-m", "Bump requirements for pyup pull request") print("Pushing to GitHub") subprocess.check_call( [ "ssh-agent", "sh", "-c", "ssh-add %s && " % (shlex.quote(tools.DEPLOY_KEY),) + "git push ssh-origin HEAD:%s" % (os.environ["TRAVIS_PULL_REQUEST_BRANCH"],), ] )
def deploy(): print("Current head: ", HEAD) print("Current master:", MASTER) if not tools.is_ancestor(HEAD, MASTER): print("Not deploying due to not being on master") sys.exit(0) if "TWINE_PASSWORD" not in os.environ: print("Running without access to secure variables, so no deployment") sys.exit(0) tools.configure_git() for project in tools.all_projects(): do_release(project) sys.exit(0)
def deploy(): print("Current head: ", HEAD) print("Current master:", MASTER) if not tools.is_ancestor(HEAD, MASTER): print("Not deploying due to not being on master") sys.exit(0) if not tools.has_travis_secrets(): print("Running without access to secure variables, so no deployment") sys.exit(0) print("Decrypting secrets") tools.decrypt_secrets() tools.configure_git() for project in tools.all_projects(): do_release(project) sys.exit(0)
def deploy(): print('Current head: ', HEAD) print('Current master:', MASTER) if not tools.is_ancestor(HEAD, MASTER): print('Not deploying due to not being on master') sys.exit(0) if not tools.has_travis_secrets(): print('Running without access to secure variables, so no deployment') sys.exit(0) print('Decrypting secrets') tools.decrypt_secrets() tools.configure_git() for project in tools.all_projects(): do_release(project) sys.exit(0)
def push_pyup_requirements_commit(): """Because pyup updates each package individually, it can create a requirements.txt with an incompatible set of versions. Depending on the changes, pyup might also have introduced whitespace errors. If we've recompiled requirements.txt in Travis and made changes, and this is a PR where pyup is running, push a consistent set of versions as a new commit to the PR. """ if is_pyup_branch(): print("Pushing new requirements, as this is a pyup pull request") print("Creating commit") tools.configure_git() tools.git("add", "--update", "requirements") tools.git("commit", "-m", "Bump requirements for pyup pull request") print("Pushing to GitHub") tools.git("push", "origin", f"HEAD:{os.environ['GITHUB_HEAD_REF']}")