diff --git a/.travis.yml b/.travis.yml index a5c9acd..2751fa4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,15 +8,16 @@ before_install: # https://github.com/travis-ci/travis-ci/issues/2124#issuecomment-38992012 - sudo apt-get update -qq # speed the run up - - python -c + - python2 -c 'from sys import exit, version_info as v; exit(v[:2] in ((2, 7), (3, 2)))' || sudo apt-get install -qq python-lxml python-distribute install: - cd __root__ - - python setup.py -q saveopts -f setup.cfg pkg_prepare - --ra-metadata-dir="$(pwd)/cluster" - --ccs-flatten="$(dirname $(pwd))/ccs_flatten" - --editor="sed -i 's|\(force-block=\"\)false|\1true|;w /dev/stdout'" + - python2 setup.py -q + saveopts -f setup.cfg pkg_prepare + --ra-metadata-dir="$(pwd)/cluster" + --ccs-flatten="$(dirname $(pwd))/ccs_flatten" + --editor="sed -i 's|\(force-block=\"\)false|\1true|;w /dev/stdout'" #- cat setup.cfg # make following robust enough to deal with pip pre-6.0(?) - true;{ diff --git a/__main__.py b/__main__.py index 05f2781..0afbd84 100644 --- a/__main__.py +++ b/__main__.py @@ -1,15 +1,16 @@ # -*- coding: UTF-8 -*- -# Copyright 2014 Red Hat, Inc. +# Copyright 2015 Red Hat, Inc. # Part of clufter project # Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt) -"""Machinery entry point -- to be run via python -m """ +"""Machinery entry point -- to be run via python{,2} -m """ __author__ = "Jan Pokorný " from os.path import basename -from sys import argv, exit +from sys import argv, executable, exit from .main import run if basename(argv[0]) == '__main__.py': - argv[0] = 'python -m ' + __package__ + # for help screens only, hence spaces allowed + argv[0] = "{0} -m {1}".format(executable, __package__) exit(run(argv)) diff --git a/__root__/doc/HACKING b/__root__/doc/HACKING index cb13c61..77882e6 100644 --- a/__root__/doc/HACKING +++ b/__root__/doc/HACKING @@ -2,7 +2,7 @@ Directly consuming the repo --------------------------- After fetching local repo copy: -$ python setup.py build +$ python setup.py build # or python2 if it matters $ ln -fs __root__/build/ccs_flatten . $ # or ./run-check that should take care on its own and you should be ready to go with: diff --git a/__root__/run-check b/__root__/run-check index c6a5f92..7d0517d 100755 --- a/__root__/run-check +++ b/__root__/run-check @@ -20,7 +20,7 @@ PATH="${PATH:+${PATH}:}$( )" unset s -PYTHONEXEC="python -Es" +PYTHONEXEC="python2 -Es" echo "Current path: ${PATH}" which ccs_flatten 2>/dev/null || ( diff --git a/__root__/run-dev b/__root__/run-dev index 607ea75..347bb31 100755 --- a/__root__/run-dev +++ b/__root__/run-dev @@ -1,6 +1,6 @@ -#!/usr/bin/env python +#!/usr/bin/env python2 # -*- coding: UTF-8 -*- -# Copyright 2014 Red Hat, Inc. +# Copyright 2015 Red Hat, Inc. # Part of clufter project # Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt) """Machinery entry point -- to be run from in-repo location""" diff --git a/__root__/run-sdist b/__root__/run-sdist index dd75d18..bce9572 100755 --- a/__root__/run-sdist +++ b/__root__/run-sdist @@ -5,6 +5,6 @@ pushd "$(git rev-parse --show-toplevel)" git archive --format=tar HEAD | ( cd $(mktemp -d '/var/tmp/pkg-XXXXX') \ && tar xf - \ - && python setup.py sdist -d "${OLDPWD}/__root__/dist") + && python2 setup.py sdist -d "${OLDPWD}/__root__/dist") echo "New source tarball created: $(ls -1t __root__/dist | head -n1)" popd diff --git a/misc/clufter.spec b/misc/clufter.spec index 974f7eb..31a0f64 100644 --- a/misc/clufter.spec +++ b/misc/clufter.spec @@ -1,10 +1,10 @@ # distill-spec-prefix: clufter %{!?clufter_version: %global clufter_version %{?!infer:0.10.4}%{?infer:%( - python ../setup.py --version)}} + python2 ../setup.py --version)}} %{!?clufter_name: %global clufter_name %{?!infer:clufter}%{?infer:%( - python ../setup.py --name)}} + python2 ../setup.py --name)}} %{!?clufter_license: %global clufter_license %{?!infer:GPLv2+}%{?infer:%( - python ../setup.py --license)}} + python2 ../setup.py --license)}} %{!?clufter_check: %global clufter_check 1} # special vars wrt. versioning diff --git a/misc/run-sdist-per-commit b/misc/run-sdist-per-commit index 5484f7f..16c6f05 100755 --- a/misc/run-sdist-per-commit +++ b/misc/run-sdist-per-commit @@ -14,6 +14,6 @@ pushd "$(LC=C \ -e 's|.*filename=\([^-]\+-[^-]\+-\)\(v[^g]\+\)\?g\([0-9a-z]\+\)\.tar\.gz|\1\3|' \ | tr -d '\r\n' )/__root__" -python setup.py sdist -d "${OLDPWD}" +python2 setup.py sdist -d "${OLDPWD}" popd echo "New source tarball created: $(ls -1t | head -n1)"