From a5b9c2eccfa90d1c35a5c82e43a34cb766e1d651 Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Fri, 14 Nov 2014 13:31:58 -0500 Subject: [PATCH] Move files out of the namespace package Move oslo.log to oslo_log. Since this library has not been released, we do not need to retain the old interface for compatibility. bp/drop-namespace-packages Change-Id: Id8e2312a72af171918fa4d40117ec652018a37bf --- .testr.conf | 2 +- doc/source/usage.rst | 2 +- openstack-common.conf | 2 +- oslo/__init__.py | 13 ------------- {oslo/log => oslo_log}/__init__.py | 0 {oslo/log => oslo_log}/_i18n.py | 2 +- {oslo/log => oslo_log}/_local.py | 0 {oslo/log => oslo_log}/_options.py | 0 {oslo/log => oslo_log}/context.py | 0 {oslo/log => oslo_log}/fixture/__init__.py | 0 {oslo/log => oslo_log}/fixture/logging.py | 0 {oslo/log => oslo_log}/formatters.py | 4 ++-- {oslo/log => oslo_log}/handlers.py | 0 {oslo/log => oslo_log}/helpers.py | 0 {oslo/log => oslo_log}/log.py | 10 +++++----- {oslo/log => oslo_log}/loggers.py | 0 oslo_log/tests/__init__.py | 0 {tests => oslo_log/tests/unit}/__init__.py | 0 .../tests/unit/fixture}/__init__.py | 0 .../tests}/unit/fixture/test_logging.py | 4 ++-- {tests => oslo_log/tests}/unit/test_context.py | 2 +- {tests => oslo_log/tests}/unit/test_helpers.py | 2 +- {tests => oslo_log/tests}/unit/test_local.py | 2 +- {tests => oslo_log/tests}/unit/test_log.py | 12 ++++++------ setup.cfg | 10 ++++------ tests/unit/fixture/__init__.py | 13 ------------- tox.ini | 2 +- 27 files changed, 27 insertions(+), 55 deletions(-) delete mode 100644 oslo/__init__.py rename {oslo/log => oslo_log}/__init__.py (100%) rename {oslo/log => oslo_log}/_i18n.py (95%) rename {oslo/log => oslo_log}/_local.py (100%) rename {oslo/log => oslo_log}/_options.py (100%) rename {oslo/log => oslo_log}/context.py (100%) rename {oslo/log => oslo_log}/fixture/__init__.py (100%) rename {oslo/log => oslo_log}/fixture/logging.py (100%) rename {oslo/log => oslo_log}/formatters.py (99%) rename {oslo/log => oslo_log}/handlers.py (100%) rename {oslo/log => oslo_log}/helpers.py (100%) rename {oslo/log => oslo_log}/log.py (98%) rename {oslo/log => oslo_log}/loggers.py (100%) create mode 100644 oslo_log/tests/__init__.py rename {tests => oslo_log/tests/unit}/__init__.py (100%) rename {tests/unit => oslo_log/tests/unit/fixture}/__init__.py (100%) rename {tests => oslo_log/tests}/unit/fixture/test_logging.py (91%) rename {tests => oslo_log/tests}/unit/test_context.py (98%) rename {tests => oslo_log/tests}/unit/test_helpers.py (98%) rename {tests => oslo_log/tests}/unit/test_local.py (98%) rename {tests => oslo_log/tests}/unit/test_log.py (99%) delete mode 100644 tests/unit/fixture/__init__.py diff --git a/.testr.conf b/.testr.conf index 35d9ba43..0edde418 100644 --- a/.testr.conf +++ b/.testr.conf @@ -2,6 +2,6 @@ test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} -m subunit.run discover -t ./ ./tests $LISTOPT $IDOPTION + ${PYTHON:-python} -m subunit.run discover -t ./ ./oslo_log $LISTOPT $IDOPTION test_id_option=--load-list $IDFILE test_list_option=--list diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 4e915133..b9dc4441 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -4,4 +4,4 @@ To use oslo.log in a project:: - from oslo import log + import oslo_log diff --git a/openstack-common.conf b/openstack-common.conf index 61858cf2..badb0b79 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -6,4 +6,4 @@ modules= script = tools/run_cross_tests.sh # The base module to hold the copy of openstack.common -base=oslo.log \ No newline at end of file +base=oslo_log \ No newline at end of file diff --git a/oslo/__init__.py b/oslo/__init__.py deleted file mode 100644 index dc130d6b..00000000 --- a/oslo/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -__import__('pkg_resources').declare_namespace(__name__) diff --git a/oslo/log/__init__.py b/oslo_log/__init__.py similarity index 100% rename from oslo/log/__init__.py rename to oslo_log/__init__.py diff --git a/oslo/log/_i18n.py b/oslo_log/_i18n.py similarity index 95% rename from oslo/log/_i18n.py rename to oslo_log/_i18n.py index ebd6c454..3d6645db 100644 --- a/oslo/log/_i18n.py +++ b/oslo_log/_i18n.py @@ -21,7 +21,7 @@ See http://docs.openstack.org/developer/oslo.i18n/usage.html . from oslo import i18n -_translators = i18n.TranslatorFactory(domain='oslo.log') +_translators = i18n.TranslatorFactory(domain='oslo_log') # The primary translation function using the well-known name "_" _ = _translators.primary diff --git a/oslo/log/_local.py b/oslo_log/_local.py similarity index 100% rename from oslo/log/_local.py rename to oslo_log/_local.py diff --git a/oslo/log/_options.py b/oslo_log/_options.py similarity index 100% rename from oslo/log/_options.py rename to oslo_log/_options.py diff --git a/oslo/log/context.py b/oslo_log/context.py similarity index 100% rename from oslo/log/context.py rename to oslo_log/context.py diff --git a/oslo/log/fixture/__init__.py b/oslo_log/fixture/__init__.py similarity index 100% rename from oslo/log/fixture/__init__.py rename to oslo_log/fixture/__init__.py diff --git a/oslo/log/fixture/logging.py b/oslo_log/fixture/logging.py similarity index 100% rename from oslo/log/fixture/logging.py rename to oslo_log/fixture/logging.py diff --git a/oslo/log/formatters.py b/oslo_log/formatters.py similarity index 99% rename from oslo/log/formatters.py rename to oslo_log/formatters.py index 50071c2b..28a82af3 100644 --- a/oslo/log/formatters.py +++ b/oslo_log/formatters.py @@ -20,9 +20,9 @@ import traceback import six from six import moves -from oslo.log import _local -from oslo.log import context as ctx from oslo.serialization import jsonutils +from oslo_log import _local +from oslo_log import context as ctx def _dictify_context(context): diff --git a/oslo/log/handlers.py b/oslo_log/handlers.py similarity index 100% rename from oslo/log/handlers.py rename to oslo_log/handlers.py diff --git a/oslo/log/helpers.py b/oslo_log/helpers.py similarity index 100% rename from oslo/log/helpers.py rename to oslo_log/helpers.py diff --git a/oslo/log/log.py b/oslo_log/log.py similarity index 98% rename from oslo/log/log.py rename to oslo_log/log.py index a71f2b50..96f1e36d 100644 --- a/oslo/log/log.py +++ b/oslo_log/log.py @@ -42,11 +42,11 @@ from six import moves _PY26 = sys.version_info[0:2] == (2, 6) -from oslo.log._i18n import _ -from oslo.log import _options -from oslo.log import context as ctx -from oslo.log import formatters -from oslo.log import handlers +from oslo_log._i18n import _ +from oslo_log import _options +from oslo_log import context as ctx +from oslo_log import formatters +from oslo_log import handlers def _get_log_file_path(conf, binary=None): diff --git a/oslo/log/loggers.py b/oslo_log/loggers.py similarity index 100% rename from oslo/log/loggers.py rename to oslo_log/loggers.py diff --git a/oslo_log/tests/__init__.py b/oslo_log/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/__init__.py b/oslo_log/tests/unit/__init__.py similarity index 100% rename from tests/__init__.py rename to oslo_log/tests/unit/__init__.py diff --git a/tests/unit/__init__.py b/oslo_log/tests/unit/fixture/__init__.py similarity index 100% rename from tests/unit/__init__.py rename to oslo_log/tests/unit/fixture/__init__.py diff --git a/tests/unit/fixture/test_logging.py b/oslo_log/tests/unit/fixture/test_logging.py similarity index 91% rename from tests/unit/fixture/test_logging.py rename to oslo_log/tests/unit/fixture/test_logging.py index 05f059f1..11c95bcd 100644 --- a/tests/unit/fixture/test_logging.py +++ b/oslo_log/tests/unit/fixture/test_logging.py @@ -11,8 +11,8 @@ # under the License. -from oslo.log.fixture import logging as logging_fixture -from oslo.log import log as logging +from oslo_log.fixture import logging as logging_fixture +from oslo_log import log as logging from oslotest import base as test_base LOG = logging.getLogger(__name__) diff --git a/tests/unit/test_context.py b/oslo_log/tests/unit/test_context.py similarity index 98% rename from tests/unit/test_context.py rename to oslo_log/tests/unit/test_context.py index f3e9b8f6..b08f74af 100644 --- a/tests/unit/test_context.py +++ b/oslo_log/tests/unit/test_context.py @@ -15,7 +15,7 @@ from oslotest import base as test_base -from oslo.log import context +from oslo_log import context class ContextTest(test_base.BaseTestCase): diff --git a/tests/unit/test_helpers.py b/oslo_log/tests/unit/test_helpers.py similarity index 98% rename from tests/unit/test_helpers.py rename to oslo_log/tests/unit/test_helpers.py index 1fd126b0..aaafb445 100644 --- a/tests/unit/test_helpers.py +++ b/oslo_log/tests/unit/test_helpers.py @@ -11,7 +11,7 @@ # under the License. import mock -from oslo.log import helpers +from oslo_log import helpers from oslotest import base as test_base diff --git a/tests/unit/test_local.py b/oslo_log/tests/unit/test_local.py similarity index 98% rename from tests/unit/test_local.py rename to oslo_log/tests/unit/test_local.py index 90285177..ca304fe0 100644 --- a/tests/unit/test_local.py +++ b/oslo_log/tests/unit/test_local.py @@ -18,7 +18,7 @@ import threading from oslotest import base as test_base from six import moves -from oslo.log import _local +from oslo_log import _local class Dict(dict): diff --git a/tests/unit/test_log.py b/oslo_log/tests/unit/test_log.py similarity index 99% rename from tests/unit/test_log.py rename to oslo_log/tests/unit/test_log.py index d7242f59..c6c4f30c 100644 --- a/tests/unit/test_log.py +++ b/oslo_log/tests/unit/test_log.py @@ -27,12 +27,12 @@ from oslo.serialization import jsonutils from oslotest import base as test_base import six -from oslo.log import _local -from oslo.log import _options -from oslo.log import context -from oslo.log import formatters -from oslo.log import handlers -from oslo.log import log +from oslo_log import _local +from oslo_log import _options +from oslo_log import context +from oslo_log import formatters +from oslo_log import handlers +from oslo_log import log def _fake_context(): diff --git a/setup.cfg b/setup.cfg index 786ef4ed..d376d627 100644 --- a/setup.cfg +++ b/setup.cfg @@ -21,16 +21,14 @@ classifier = [files] packages = - oslo -namespace_packages = - oslo + oslo_log [pbr] warnerrors = true [entry_points] oslo.config.opts = - oslo.log = oslo.log._options:list_opts + oslo.log = oslo_log._options:list_opts [build_sphinx] source-dir = doc/source @@ -42,10 +40,10 @@ upload-dir = doc/build/html [compile_catalog] directory = oslo.log/locale -domain = oslo.log +domain = oslo_log [update_catalog] -domain = oslo.log +domain = oslo_log output_dir = oslo.log/locale input_file = oslo.log/locale/oslo.log.pot diff --git a/tests/unit/fixture/__init__.py b/tests/unit/fixture/__init__.py deleted file mode 100644 index 19f5e722..00000000 --- a/tests/unit/fixture/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# -*- coding: utf-8 -*- - -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. diff --git a/tox.ini b/tox.ini index 07b899ed..36795180 100644 --- a/tox.ini +++ b/tox.ini @@ -38,4 +38,4 @@ ignore = E123,E125,H305,H307,H405,H803,H904 exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,__init__.py [hacking] -import_exceptions = oslo.log._i18n +import_exceptions = oslo_log._i18n