From 7dd3bca83a8e9bbcb739b8928b2cf71e82fa758f Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 12 Nov 2018 13:56:48 +0000 Subject: [PATCH] Allow paunch to be called as a python module Includes a test that we can succesfully call it as a module in order to avoid regressions. This is essential fix related to python3 work as the only way to enforce a specific python interpreter to be used. Change-Id: If5c4bda5ddc708bfb3701800cea46e89a026fb6e Story: https://tree.taiga.io/project/tripleo-ci-board/task/361 --- paunch/{main.py => __main__.py} | 0 setup.cfg | 7 +++++-- tox.ini | 14 ++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) rename paunch/{main.py => __main__.py} (100%) diff --git a/paunch/main.py b/paunch/__main__.py similarity index 100% rename from paunch/main.py rename to paunch/__main__.py diff --git a/setup.cfg b/setup.cfg index 46725d9..d9e24bb 100644 --- a/setup.cfg +++ b/setup.cfg @@ -24,9 +24,9 @@ packages = [entry_points] console_scripts = - paunch = paunch.main:main + paunch = paunch.__main__:main -paunch = +paunch = apply = paunch.cmd:Apply cleanup = paunch.cmd:Cleanup delete = paunch.cmd:Delete @@ -59,3 +59,6 @@ output_file = paunch/locale/paunch.pot all_files = 1 build-dir = releasenotes/build source-dir = releasenotes/source + +[wheel] +universal = 1 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 62bd42e..efb68d5 100644 --- a/tox.ini +++ b/tox.ini @@ -1,14 +1,20 @@ [tox] minversion = 2.0 envlist = py35,py27,pep8 -skipsdist = True - +skipsdist = False + [testenv] setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi' - testr run {posargs} +install_command = pip install -U {opts} {packages} +whitelist_externals = + bash +commands = + python -m paunch --version + paunch --version + bash -c 'if [ ! -d ./.testrepository ] ; then testr init ; fi' + testr run {posargs} [testenv:pep8] basepython = python3