Skip to content

Commit

Permalink
Ensure Python 3 is used in PyPI deployment CI step
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelLipski committed Jan 28, 2021
1 parent 9f456f8 commit 852ec67
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
33 changes: 20 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ os: linux
# We need Bionic aka Ubuntu 18.04 LTS since we're using destructive mode of building snaps
# and hence apparently we have to use same distro as used for core18 (https://github.com/snapcore/core18) Snap base.
dist: bionic
# Build is fully Dockerized, we don't need to run Python directly on the VM.
# Python is needed for PyPI deployment, but `node_js` is still sufficient for this purpose.
# We need node_js for link checking.
# Build is almost fully Dockerized.
# We don't need to run Python directly on the VM,
# other than for PyPI deployment - but `node_js` Travis language is still sufficient for this purpose.
# We need npm for link-checking tools.
language: node_js
node_js: [14]

Expand Down Expand Up @@ -59,20 +60,14 @@ jobs:
- echo q | git machete traverse --fetch
- sudo snap remove git-machete

- stage: 'Build rpm & deploy to GitHub Releases'
if: branch = master
install: sudo snap install --classic hub
script: bash ci/rpm/travis-script.sh
deploy:
provider: script
skip_cleanup: true # to retain the rpm built by travis-script.sh
script: bash ci/github-releases/travis-deploy.sh
on: { branch: master }

- stage: 'Deploy to PyPI'
if: branch = master
install: skip
script: skip
# Bionic VM with language != `python` has Python 2.7 by default :/
# This wasn't a problem until our release 2.16.0 (early 2021), when it caused a failure in `pip`
# (Python 2.7 could not handle f"..."-style string interpolation).
before_deploy: sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1 # 1 means "top priority"
deploy:
provider: pypi
username: __token__
Expand Down Expand Up @@ -108,6 +103,18 @@ jobs:
script: bash ci/nixpkgs-pr/travis-deploy.sh
on: { branch: master }

# Let's do this at the very end to avoid opening a GH release (and notifying the watchers)
# in case anything goes wrong in the previous steps.
- stage: 'Build rpm & deploy to GitHub Releases'
if: branch = master
install: sudo snap install --classic hub
script: bash ci/rpm/travis-script.sh
deploy:
provider: script
skip_cleanup: true # to retain the rpm built by travis-script.sh
script: bash ci/github-releases/travis-deploy.sh
on: { branch: master }


notifications:
email:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

[![Join the chat at https://gitter.im/VirtusLab/git-machete](https://badges.gitter.im/VirtusLab/git-machete.svg)](https://gitter.im/VirtusLab/git-machete)
[![TravisCI build status](https://api.travis-ci.com/VirtusLab/git-machete.svg?branch=master)](https://travis-ci.com/github/VirtusLab/git-machete/builds)
[![PyPI package](https://badge.fury.io/py/git-machete.svg)](https://pypi.org/project/git-machete)
[![PyPI package](https://img.shields.io/pypi/v/git-machete.svg)](https://pypi.org/project/git-machete)
[![PyPI package monthly downloads](https://img.shields.io/pypi/dm/git-machete.svg)](https://pypi.org/project/git-machete)
[![Snap](https://snapcraft.io/git-machete/badge.svg)](https://snapcraft.io/git-machete)

<img src="https://raw.githubusercontent.com/VirtusLab/git-machete/master/docs/logo.svg"
Expand Down
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release notes

## New in git-machete 2.16.1

- fixed: PyPI deployment (ensure Travis uses Python 3.x)

## New in git-machete 2.16.0

- added: `squash` command
Expand Down
2 changes: 1 addition & 1 deletion git_machete/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.16.0'
__version__ = '2.16.1'

0 comments on commit 852ec67

Please sign in to comment.