Skip to content

Commit

Permalink
Fix PyPI deploy + PyPI badge in README + verify Debian package instal…
Browse files Browse the repository at this point in the history
…lation on fresh image
  • Loading branch information
PawelLipski committed Dec 17, 2019
1 parent aa674b1 commit 2d5c625
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 19 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ script:
before_deploy: # Wrapped in an `if` to make sure it's run only once before the first deploy and not before every single deploy
if [[ -z "$DEB_BUILT" ]]; then
export DEB_BUILT=true &&
docker build -f ci/Dockerfile-stdeb -t git-machete:stdeb . &&
id=$(docker create git-machete:stdeb) &&
docker cp $id:/git-machete/deb_dist . &&
docker rm -v $id;
docker build -f ci/Dockerfile-deb-build -t git-machete:deb-build . &&
id=$(docker create git-machete:deb-build) &&
docker cp $id:/git-machete/deb_dist/ . &&
docker rm -v $id &&
docker build -f ci/Dockerfile-deb-test-python deb_dist/ &&
docker build -f ci/Dockerfile-deb-test-python3 deb_dist/ ;
fi

deploy:
Expand All @@ -33,7 +35,6 @@ deploy:
password:
secure: U6JJcByjLv2PutUpnpqDT7cNIUYu9Ap9t4G90KULEn6Syxa49aX14BT6k2jBakWbQgrPCxLLNSWeCoC4xPl/Z2/9HLEFxZLVovtVbiaJ8HrTcoWmEZijnGob9Ofh94TFP8VtifjqHXeIrPi78XyZEks/ed0Sj3jSH4BL74PDHvqbD1RnsezFm4QGI2ESOWY+laJ2ralcpHRJh0hJb0QHxOpbKPVM+QefiFs+VFkFP25hQcn/G3qdduzW5NQ8OHBYCbevy6/1yt/M67ZzAeA0n4UrkZ/3vBsMJJ3wynWWZ3xO+lGs6eqZ31E8vicogYbw5hXs119JRkKUrcU5uqVL1mogf8N6y76w2xNV6Aul/XtpBiuPQsHm0tChwTI6yyGzAZBRPMB1KzRclDKGQThIBhpX+wfqHSpvdj1CZV5AMm3+6nHA0LSGWiuJ1BW7pTrAp9YFPbrQfH59JWMhy8ng5lexcQQj7spSO/DPw0VMIfUiw644BfSfyZwls5du4yYfWOkd8RoELEa2IGqCp1sTqjWvSuX3nzKCbJhxAwrVU5mK9fiMPcL1jURIwlFvooI+qKAp3CdGZ1IM+HFmpzXym2kvZvmrNXduVSZcqG3DrCFxt77FYsN5SNB/uly1vLq/6Y0BaCw9ao6YWfW3fvU2cCcyejjzPyfGzZ2jA5uOpZ8=
on:
condition: $TOXENV = py36
python: 3.6
tags: true

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![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.org/VirtusLab/git-machete.svg?branch=master)](https://travis-ci.org/VirtusLab/git-machete)
[![PyPI package](https://badge.fury.io/py/git-machete.svg)](https://badge.fury.io/py/git-machete.svg)
[![PyPI package](https://badge.fury.io/py/git-machete.svg)](https://pypi.org/project/git-machete)


![](logo.png)
Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release notes

## New in git-machete 2.12.5

- improved: validation of generated Debian packages
- fixed: deployment to PyPI
- fixed: removed dependency on `distutils.spawn`

## New in git-machete 2.12.4

- fixed: remove stray ANSI escape characters in ASCII-only mode
Expand Down
7 changes: 2 additions & 5 deletions ci/Dockerfile-stdeb → ci/Dockerfile-deb-build
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,19 @@ FROM ubuntu:18.04
# or: setup.py cmd --help
# error: option --install-layout not recognized

RUN apt-get update && apt-get install -y python-all python-pip python3-pip python3-stdeb dh-python git lintian
RUN apt-get -qq update && apt-get install -y -qq python-all python-pip python3-pip python3-stdeb dh-python git lintian

COPY . git-machete/
WORKDIR git-machete/
RUN pip install pbr
RUN pip3 install pbr
# Hacks necessary to enforce a reasonable description in the generated Debian package (instead of one autogenerated from the existing summary and README.md)
RUN sed -i 's/summary =.*/summary = Git repository organizer \& rebase workflow automation tool/' setup.cfg
RUN cp ci/README-stdeb.md README.md
RUN cp ci/README-deb.md README.md
RUN python3 setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True --with-python3=True --copyright-file=LICENSE bdist_deb

WORKDIR deb_dist/
RUN ls -l
RUN dpkg-deb --info python3-git-machete_*.deb
RUN dpkg-deb --contents python3-git-machete_*.deb
RUN lintian python3-git-machete_*.deb
RUN dpkg --install python3-git-machete_*.deb
RUN which git-machete
RUN git machete --version
9 changes: 9 additions & 0 deletions ci/Dockerfile-deb-test-python
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:18.04

COPY . .
RUN apt-get -qq update && apt-get install -y -qq git python-all
RUN dpkg --install python-git-machete_*.deb
RUN which git-machete
RUN git machete --version
RUN dpkg --remove python-git-machete
RUN ! command -v git-machete
9 changes: 9 additions & 0 deletions ci/Dockerfile-deb-test-python3
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM ubuntu:18.04

COPY . .
RUN apt-get -qq update && apt-get install -y -qq git python3-all
RUN dpkg --install python3-git-machete_*.deb
RUN which git-machete
RUN git machete --version
RUN dpkg --remove python3-git-machete
RUN ! command -v git-machete
File renamed without changes.
2 changes: 1 addition & 1 deletion git_machete/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.12.4'
__version__ = '2.12.5'
34 changes: 30 additions & 4 deletions git_machete/cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
# -*- coding: utf-8 -*-

from git_machete import __version__
import distutils.spawn
import getopt
import io
import itertools
Expand Down Expand Up @@ -415,13 +414,40 @@ def is_executable(path):
return os.access(path, os.X_OK)


# Copied from distutils.spawn to avoid dependency on distutils
def find_executable(executable, path=None):
"""Tries to find 'executable' in the directories listed in 'path'.
A string listing directories separated by 'os.pathsep'; defaults to
os.environ['PATH']. Returns the complete filename or None if not found.
"""
if path is None:
path = os.environ.get('PATH', os.defpath)

paths = path.split(os.pathsep)
base, ext = os.path.splitext(executable)

if (sys.platform == 'win32' or os.name == 'os2') and (ext != '.exe'):
executable = executable + '.exe'

if not os.path.isfile(executable):
for p in paths:
f = os.path.join(p, executable)
if os.path.isfile(f):
# the file exists, we have a shot at spawn working
return f
return None
else:
return executable


def edit():
editor = os.environ.get("EDITOR")
if editor and distutils.spawn.find_executable(editor):
if editor and find_executable(editor):
return run_cmd(editor, definition_file)
elif distutils.spawn.find_executable("vim"):
elif find_executable("vim"):
return run_cmd("vim", definition_file)
elif distutils.spawn.find_executable("nano"):
elif find_executable("nano"):
return run_cmd("nano", definition_file)
else:
raise MacheteException("Cannot determine editor. Set EDITOR environment variable or edit %s directly." % definition_file)
Expand Down
3 changes: 0 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ universal = 1
[pbr]
warnerrors = True
[easy_install]
allow_hosts = *.python.org,*.pythonhosted.org,pypi.org

0 comments on commit 2d5c625

Please sign in to comment.