diff --git a/.travis.yml b/.travis.yml index 8c013b441..17a48a043 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: @@ -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 diff --git a/README.md b/README.md index b697ef23c..0c400a231 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index fd33831b1..e05918dad 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -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 diff --git a/ci/Dockerfile-stdeb b/ci/Dockerfile-deb-build similarity index 82% rename from ci/Dockerfile-stdeb rename to ci/Dockerfile-deb-build index 9365fb12e..c260465e9 100644 --- a/ci/Dockerfile-stdeb +++ b/ci/Dockerfile-deb-build @@ -9,7 +9,7 @@ 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/ @@ -17,7 +17,7 @@ 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/ @@ -25,6 +25,3 @@ 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 diff --git a/ci/Dockerfile-deb-test-python b/ci/Dockerfile-deb-test-python new file mode 100644 index 000000000..a475d5701 --- /dev/null +++ b/ci/Dockerfile-deb-test-python @@ -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 diff --git a/ci/Dockerfile-deb-test-python3 b/ci/Dockerfile-deb-test-python3 new file mode 100644 index 000000000..00d965f40 --- /dev/null +++ b/ci/Dockerfile-deb-test-python3 @@ -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 diff --git a/ci/README-stdeb.md b/ci/README-deb.md similarity index 100% rename from ci/README-stdeb.md rename to ci/README-deb.md diff --git a/git_machete/__init__.py b/git_machete/__init__.py index 95515d62f..3fdb2c0e1 100644 --- a/git_machete/__init__.py +++ b/git_machete/__init__.py @@ -1 +1 @@ -__version__ = '2.12.4' +__version__ = '2.12.5' diff --git a/git_machete/cmd.py b/git_machete/cmd.py index d876808c3..52929c3b6 100644 --- a/git_machete/cmd.py +++ b/git_machete/cmd.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- from git_machete import __version__ -import distutils.spawn import getopt import io import itertools @@ -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) diff --git a/setup.cfg b/setup.cfg index 7c1d91051..72dbd07af 100644 --- a/setup.cfg +++ b/setup.cfg @@ -33,6 +33,3 @@ universal = 1 [pbr] warnerrors = True - -[easy_install] -allow_hosts = *.python.org,*.pythonhosted.org,pypi.org