Skip to content

Commit

Permalink
Rename src/testinfra -> src/testutils
Browse files Browse the repository at this point in the history
This solves the problem of a duplicate wheel name
  • Loading branch information
Eric-Arellano committed Nov 6, 2019
1 parent 26fc618 commit a002ca0
Show file tree
Hide file tree
Showing 59 changed files with 135 additions and 137 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,20 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

python_library(
name='test_infra',
name='testutils_wheel',
dependencies=[
':int-test-for-export',
':test_base',
'src/python/pants/testinfra/jvm:jar_task_test_base',
'src/python/pants/testinfra/jvm:nailgun_task_test_base',
'src/python/pants/testinfra/jvm:jvm_tool_task_test_base',
'src/python/pants/testinfra/engine:engine_test_base',
'src/python/pants/testinfra/subsystem',
'src/python/pants/testutils/jvm:jar_task_test_base',
'src/python/pants/testutils/jvm:nailgun_task_test_base',
'src/python/pants/testutils/jvm:jvm_tool_task_test_base',
'src/python/pants/testutils/engine:engine_test_base',
'src/python/pants/testutils/subsystem',
],
# TODO(???): Once we remove `pants_test:testinfra`, reclaim the wheel name
# `pantsbuiuld.pants.testinfra`. We let that keep the ideal name for backwards compatibility.
provides=pants_setup_py(
name='pantsbuild.pants.testinfra.new_namespace',
name='pantsbuild.pants.testutils',
description='Test support for writing pants plugins.',
namespace_packages=['pants.testinfra'],
namespace_packages=['pants.testutils'],
additional_classifiers=[
'Topic :: Software Development :: Testing',
]
Expand All @@ -39,7 +37,7 @@ python_library(
'src/python/pants/base:exiter',
'src/python/pants/fs',
'src/python/pants/subsystem',
'src/python/pants/testinfra/utils:file_test_util',
'src/python/pants/testutils/utils:file_test_util',
'src/python/pants/util:contextutil',
'src/python/pants/util:dirutil',
'src/python/pants/util:osutil',
Expand Down Expand Up @@ -76,10 +74,10 @@ python_library(
'src/python/pants/source',
'src/python/pants/subsystem',
'src/python/pants/task',
'src/python/pants/testinfra/base:context_utils',
'src/python/pants/testinfra/engine:util',
'src/python/pants/testinfra/option',
'src/python/pants/testinfra/subsystem',
'src/python/pants/testutils/base:context_utils',
'src/python/pants/testutils/engine:util',
'src/python/pants/testutils/option',
'src/python/pants/testutils/subsystem',
'src/python/pants/util:collections',
'src/python/pants/util:contextutil',
'src/python/pants/util:dirutil',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from pants.init.options_initializer import BuildConfigInitializer
from pants.init.target_roots_calculator import TargetRootsCalculator
from pants.option.options_bootstrapper import OptionsBootstrapper
from pants.testinfra.test_base import TestBase
from pants.testutils.test_base import TestBase
from pants.util.meta import classproperty


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ python_library(
dependencies = [
'src/python/pants/goal',
'src/python/pants/goal:task_registrar',
'src/python/pants/testinfra:test_base',
'src/python/pants/testutils:test_base',
]
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from pants.goal.goal import Goal
from pants.goal.task_registrar import TaskRegistrar
from pants.testinfra.test_base import TestBase
from pants.testutils.test_base import TestBase


class EngineTestBase(TestBase):
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ python_library(
sources=['jvm_task_test_base.py'],
dependencies=[
'src/python/pants/backend/jvm/tasks:classpath_products',
'src/python/pants/testinfra/subsystem',
'src/python/pants/testinfra:task_test_base',
'src/python/pants/testutils/subsystem',
'src/python/pants/testutils:task_test_base',
'src/python/pants/util:dirutil',
],
)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.testinfra.jvm.nailgun_task_test_base import NailgunTaskTestBase
from pants.testutils.jvm.nailgun_task_test_base import NailgunTaskTestBase


class JarTaskTestBase(NailgunTaskTestBase):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

from pants.backend.jvm.subsystems.resolve_subsystem import JvmResolveSubsystem
from pants.backend.jvm.tasks.classpath_products import ClasspathProducts
from pants.testinfra.subsystem.util import init_subsystem
from pants.testinfra.task_test_base import TaskTestBase
from pants.testutils.subsystem.util import init_subsystem
from pants.testutils.task_test_base import TaskTestBase
from pants.util.dirutil import safe_file_dump, safe_mkdir, safe_mkdtemp


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from pants.build_graph.build_file_aliases import BuildFileAliases
from pants.build_graph.target import Target
from pants.ivy.bootstrapper import Bootstrapper
from pants.testinfra.jvm.jvm_task_test_base import JvmTaskTestBase
from pants.testutils.jvm.jvm_task_test_base import JvmTaskTestBase
from pants.util.dirutil import safe_mkdir


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.backend.jvm.tasks.nailgun_task import NailgunTask
from pants.testinfra.jvm.jvm_tool_task_test_base import JvmToolTaskTestBase
from pants.testutils.jvm.jvm_tool_task_test_base import JvmToolTaskTestBase


class NailgunTaskTestBase(JvmToolTaskTestBase):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pants.base.exiter import PANTS_SUCCEEDED_EXIT_CODE
from pants.fs.archive import ZIP
from pants.subsystem.subsystem import Subsystem
from pants.testinfra.utils.file_test_util import check_symlinks, contains_exact_files
from pants.testutils.utils.file_test_util import check_symlinks, contains_exact_files
from pants.util.contextutil import environment_as, pushd, temporary_dir
from pants.util.dirutil import fast_relpath, safe_mkdir, safe_mkdir_for, safe_open
from pants.util.osutil import Pid
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
python_library(
dependencies=[
'src/python/pants/subsystem',
'src/python/pants/testinfra/option',
'src/python/pants/testutils/option',
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.subsystem.subsystem import Subsystem
from pants.testinfra.option.fakes import create_options_for_optionables
from pants.testutils.option.fakes import create_options_for_optionables


def global_subsystem_instance(subsystem_type, options=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
from pants.source.source_root import SourceRootConfig
from pants.subsystem.subsystem import Subsystem
from pants.task.goal_options_mixin import GoalOptionsMixin
from pants.testinfra.base.context_utils import create_context_from_options
from pants.testinfra.engine.util import init_native
from pants.testinfra.option.fakes import create_options_for_optionables
from pants.testinfra.subsystem import util as subsystem_util
from pants.testutils.base.context_utils import create_context_from_options
from pants.testutils.engine.util import init_native
from pants.testutils.option.fakes import create_options_for_optionables
from pants.testutils.subsystem import util as subsystem_util
from pants.util.collections import assert_single_element
from pants.util.contextutil import temporary_dir
from pants.util.dirutil import (
Expand Down
File renamed without changes.
16 changes: 8 additions & 8 deletions tests/python/pants_test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,31 +30,31 @@ python_library(
name = 'int-test-for-export',
sources = ['pants_run_integration_test.py'],
dependencies = [
'src/python/pants/testinfra:int-test-for-export',
'src/python/pants/testutils:int-test-for-export',
]
)

target(
name = 'int-test',
dependencies=[
':int-test-for-export',
'src/python/pants/testinfra:int-test',
'src/python/pants/testutils:int-test',
],
)

python_library(
name = 'test_base',
sources = ['test_base.py'],
dependencies = [
'src/python/pants/testinfra:test_base',
'src/python/pants/testutils:test_base',
]
)

python_library(
name = 'console_rule_test_base',
sources = ['console_rule_test_base.py'],
dependencies = [
'src/python/pants/testinfra:console_rule_test_base',
'src/python/pants/testutils:console_rule_test_base',
]
)

Expand All @@ -63,15 +63,15 @@ python_library(
name = 'task_test_base',
sources = ['task_test_base.py'],
dependencies = [
'src/python/pants/testinfra:task_test_base',
'src/python/pants/testutils:task_test_base',
]
)

python_library(
name='interpreter_selection_utils',
sources=['interpreter_selection_utils.py'],
dependencies = [
'src/python/pants/testinfra:interpreter_selection_utils',
'src/python/pants/testutils:interpreter_selection_utils',
]
)

Expand All @@ -82,7 +82,7 @@ python_tests(
'src/python/pants/backend/jvm/subsystems:junit',
'src/python/pants/build_graph',
'src/python/pants/source',
'src/python/pants/testinfra:test_base',
'src/python/pants/testinfra/subsystem',
'src/python/pants/testutils:test_base',
'src/python/pants/testutils/subsystem',
]
)
2 changes: 1 addition & 1 deletion tests/python/pants_test/base/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ python_library(
name = 'context_utils',
sources = ['context_utils.py'],
dependencies = [
'src/python/pants/testinfra/base:context_utils',
'src/python/pants/testutils/base:context_utils',
]
)

Expand Down
6 changes: 3 additions & 3 deletions tests/python/pants_test/base/context_utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.testinfra.base.context_utils import TestContext as TestContext
from pants.testinfra.base.context_utils import (
from pants.testutils.base.context_utils import TestContext as TestContext # noqa
from pants.testutils.base.context_utils import (
create_context_from_options as create_context_from_options,
)
) # noqa
2 changes: 1 addition & 1 deletion tests/python/pants_test/console_rule_test_base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.testinfra.console_rule_test_base import ConsoleRuleTestBase as ConsoleRuleTestBase
from pants.testutils.console_rule_test_base import ConsoleRuleTestBase as ConsoleRuleTestBase # noqa
4 changes: 2 additions & 2 deletions tests/python/pants_test/engine/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ python_library(
name = 'util',
sources = ['util.py'],
dependencies = [
'src/python/pants/testinfra/engine:util',
'src/python/pants/testutils/engine:util',
],
)

python_library(
name = 'engine_test_base',
sources = ['base_engine_test.py'],
dependencies = [
'src/python/pants/testinfra/engine:engine_test_base',
'src/python/pants/testutils/engine:engine_test_base',
]
)

Expand Down
2 changes: 1 addition & 1 deletion tests/python/pants_test/engine/base_engine_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.testinfra.engine.base_engine_test import EngineTestBase as EngineTestBase
from pants.testutils.engine.base_engine_test import EngineTestBase as EngineTestBase # noqa
18 changes: 9 additions & 9 deletions tests/python/pants_test/engine/util.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.testinfra.engine.util import TARGET_TABLE as TARGET_TABLE
from pants.testinfra.engine.util import MockConsole as MockConsole
from pants.testinfra.engine.util import Target as Target
from pants.testinfra.engine.util import assert_equal_with_printing as assert_equal_with_printing
from pants.testinfra.engine.util import create_scheduler as create_scheduler
from pants.testinfra.engine.util import init_native as init_native
from pants.testinfra.engine.util import (
from pants.testutils.engine.util import TARGET_TABLE as TARGET_TABLE # noqa
from pants.testutils.engine.util import MockConsole as MockConsole # noqa
from pants.testutils.engine.util import Target as Target # noqa
from pants.testutils.engine.util import assert_equal_with_printing as assert_equal_with_printing # noqa
from pants.testutils.engine.util import create_scheduler as create_scheduler # noqa
from pants.testutils.engine.util import init_native as init_native # noqa
from pants.testutils.engine.util import (
remove_locations_from_traceback as remove_locations_from_traceback,
)
from pants.testinfra.engine.util import run_rule as run_rule
) # noqa
from pants.testutils.engine.util import run_rule as run_rule # noqa
44 changes: 22 additions & 22 deletions tests/python/pants_test/interpreter_selection_utils.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.testinfra.interpreter_selection_utils import PY_2 as PY_2
from pants.testinfra.interpreter_selection_utils import PY_3 as PY_3
from pants.testinfra.interpreter_selection_utils import PY_27 as PY_27
from pants.testinfra.interpreter_selection_utils import PY_36 as PY_36
from pants.testinfra.interpreter_selection_utils import PY_37 as PY_37
from pants.testinfra.interpreter_selection_utils import has_python_version as has_python_version
from pants.testinfra.interpreter_selection_utils import (
from pants.testutils.interpreter_selection_utils import PY_2 as PY_2 # noqa
from pants.testutils.interpreter_selection_utils import PY_3 as PY_3 # noqa
from pants.testutils.interpreter_selection_utils import PY_27 as PY_27 # noqa
from pants.testutils.interpreter_selection_utils import PY_36 as PY_36 # noqa
from pants.testutils.interpreter_selection_utils import PY_37 as PY_37 # noqa
from pants.testutils.interpreter_selection_utils import has_python_version as has_python_version # noqa
from pants.testutils.interpreter_selection_utils import (
python_interpreter_path as python_interpreter_path,
)
from pants.testinfra.interpreter_selection_utils import (
) # noqa
from pants.testutils.interpreter_selection_utils import (
skip_unless_all_pythons_present as skip_unless_all_pythons_present,
)
from pants.testinfra.interpreter_selection_utils import (
) # noqa
from pants.testutils.interpreter_selection_utils import (
skip_unless_python3_present as skip_unless_python3_present,
)
from pants.testinfra.interpreter_selection_utils import (
) # noqa
from pants.testutils.interpreter_selection_utils import (
skip_unless_python27_and_python3_present as skip_unless_python27_and_python3_present,
)
from pants.testinfra.interpreter_selection_utils import (
) # noqa
from pants.testutils.interpreter_selection_utils import (
skip_unless_python27_and_python36_present as skip_unless_python27_and_python36_present,
)
from pants.testinfra.interpreter_selection_utils import (
) # noqa
from pants.testutils.interpreter_selection_utils import (
skip_unless_python27_present as skip_unless_python27_present,
)
from pants.testinfra.interpreter_selection_utils import (
) # noqa
from pants.testutils.interpreter_selection_utils import (
skip_unless_python36_and_python37_present as skip_unless_python36_and_python37_present,
)
from pants.testinfra.interpreter_selection_utils import (
) # noqa
from pants.testutils.interpreter_selection_utils import (
skip_unless_python36_present as skip_unless_python36_present,
)
) # noqa
8 changes: 4 additions & 4 deletions tests/python/pants_test/jvm/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -23,30 +23,30 @@ python_library(
name='jvm_tool_task_test_base',
sources=['jvm_tool_task_test_base.py'],
dependencies=[
'src/python/pants/testinfra/jvm:jvm_tool_task_test_base',
'src/python/pants/testutils/jvm:jvm_tool_task_test_base',
]
)

python_library(
name='nailgun_task_test_base',
sources=['nailgun_task_test_base.py'],
dependencies=[
'src/python/pants/testinfra/jvm:nailgun_task_test_base',
'src/python/pants/testutils/jvm:nailgun_task_test_base',
]
)

python_library(
name='jar_task_test_base',
sources=['jar_task_test_base.py'],
dependencies=[
'src/python/pants/testinfra/jvm:jar_task_test_base',
'src/python/pants/testutils/jvm:jar_task_test_base',
]
)

python_library(
name='jvm_task_test_base',
sources=['jvm_task_test_base.py'],
dependencies=[
'src/python/pants/testinfra/jvm:jvm_task_test_base',
'src/python/pants/testutils/jvm:jvm_task_test_base',
]
)
Loading

0 comments on commit a002ca0

Please sign in to comment.