From 83a64137c06e0eb1bbc1933c10136fffd57ccd9f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 14 Oct 2017 11:44:06 +0300 Subject: Refactor: move ick2version/version.py into ick2 --- copyright-exceptions | 2 +- ick2/__init__.py | 1 + ick2/controllerapi.py | 3 +-- ick2/controllerapi_tests.py | 3 +-- ick2/version.py | 2 ++ ick2version/__init__.py | 17 ----------------- ick2version/version.py | 2 -- setup.py | 9 ++++----- worker_manager | 4 ++-- 9 files changed, 12 insertions(+), 31 deletions(-) create mode 100644 ick2/version.py delete mode 100644 ick2version/__init__.py delete mode 100644 ick2version/version.py diff --git a/copyright-exceptions b/copyright-exceptions index 74c7d98..fc157b8 100644 --- a/copyright-exceptions +++ b/copyright-exceptions @@ -7,6 +7,6 @@ debian/copyright debian/ick2.dirs debian/ick2.install debian/source/format -ick2version/version.py +ick2/version.py pylint.conf without-tests diff --git a/ick2/__init__.py b/ick2/__init__.py index 244ca88..e24092e 100644 --- a/ick2/__init__.py +++ b/ick2/__init__.py @@ -13,6 +13,7 @@ # along with this program. If not, see . +from .version import __version__, __version_info__ from .logging import setup_logging, log from .state import ControllerState, NotFound from .controllerapi import ControllerAPI diff --git a/ick2/controllerapi.py b/ick2/controllerapi.py index ef93f54..7d43fda 100644 --- a/ick2/controllerapi.py +++ b/ick2/controllerapi.py @@ -17,7 +17,6 @@ import apifw import ick2 -import ick2version class ControllerAPI: @@ -72,7 +71,7 @@ class ControllerAPI: return apifw.Response({ 'status': apifw.HTTP_OK, 'body': { - 'version': ick2version.__version__, + 'version': ick2.__version__, }, 'headers': { 'Content-Type': 'application/json', diff --git a/ick2/controllerapi_tests.py b/ick2/controllerapi_tests.py index 8a914a3..f8f6941 100644 --- a/ick2/controllerapi_tests.py +++ b/ick2/controllerapi_tests.py @@ -20,7 +20,6 @@ import unittest import ick2 -import ick2version class ControllerAPITests(unittest.TestCase): @@ -54,7 +53,7 @@ class ControllerAPITests(unittest.TestCase): self.assertEqual( response['body'], { - 'version': ick2version.__version__, + 'version': ick2.__version__, } ) diff --git a/ick2/version.py b/ick2/version.py new file mode 100644 index 0000000..ed54455 --- /dev/null +++ b/ick2/version.py @@ -0,0 +1,2 @@ +__version__ = "0.6+git" +__version_info__ = (0, 6, '+git') diff --git a/ick2version/__init__.py b/ick2version/__init__.py deleted file mode 100644 index 7a73a9e..0000000 --- a/ick2version/__init__.py +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright (C) 2017 Lars Wirzenius -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . - - -from .version import __version__, __version_info__ diff --git a/ick2version/version.py b/ick2version/version.py deleted file mode 100644 index ed54455..0000000 --- a/ick2version/version.py +++ /dev/null @@ -1,2 +0,0 @@ -__version__ = "0.6+git" -__version_info__ = (0, 6, '+git') diff --git a/setup.py b/setup.py index ac5ec63..ab01f90 100644 --- a/setup.py +++ b/setup.py @@ -14,20 +14,19 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . -from distutils.core import setup, Extension -import glob +from distutils.core import setup -import ick2version +import ick2 setup( name='ick2', - version=ick2version.__version__, + version=ick2.__version__, description='CI server', author='Lars Wirzenius', author_email='liw@liw.fi', url='http://liw.fi/ick/', py_modules=['ick_controller'], - packages=['ick2', 'ick2version'], + packages=['ick2'], scripts=['create-token', 'start_ick'], data_files=[], ) diff --git a/worker_manager b/worker_manager index 6204392..bddc7a6 100755 --- a/worker_manager +++ b/worker_manager @@ -22,7 +22,7 @@ import time import cliapp import requests -import ick2version +import ick2 class WorkerManager(cliapp.Application): @@ -133,4 +133,4 @@ class WorkerManager(cliapp.Application): r.status_code, r.text)) -WorkerManager(version=ick2version.__version__).run() +WorkerManager(version=ick2.__version__).run() -- cgit v1.2.1