Skip to content

Commit

Permalink
Move setup-py info to src/python/pants/testinfra
Browse files Browse the repository at this point in the history
This is necessary to fix an issue with building wheels
  • Loading branch information
Eric-Arellano committed Oct 6, 2019
1 parent 7e62204 commit ca33f3b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 40 deletions.
2 changes: 1 addition & 1 deletion build-support/bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ function pkg_testinfra_install_test() {
shift
local PIP_ARGS=("$@")
pip install "${PIP_ARGS[@]}" "pantsbuild.pants.testinfra==${version}" && \
python -c "import pants_test"
python -c "import pants.testinfra"
}

#
Expand Down
2 changes: 1 addition & 1 deletion src/python/pants/releases/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def core_packages():
bdist_wheel_flags = ("--py-limited-api", "cp36")
return {
Package("pantsbuild.pants", "//src/python/pants:pants-packaged", bdist_wheel_flags=bdist_wheel_flags),
Package("pantsbuild.pants.testinfra", "//tests/python/pants_test:test_infra"),
Package("pantsbuild.pants.testinfra", "//src/python/pants/testinfra:test_infra"),
}


Expand Down
35 changes: 35 additions & 0 deletions src/python/pants/testinfra/BUILD
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

python_library(
name='test_infra',
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',
# NB: The below targets are only here to ensure that we still include in the wheel the original
# pants_test files. We add all transitive dependencies on testinfra code explicitly.
# These should be deleted once we can remove the files.
'tests/python/pants_test:int-test-for-export',
'tests/python/pants_test:test_base',
'tests/python/pants_test/jvm:jar_task_test_base',
'tests/python/pants_test/jvm:nailgun_task_test_base',
'tests/python/pants_test/jvm:jvm_tool_task_test_base',
'tests/python/pants_test/engine:engine_test_base',
'tests/python/pants_test/subsystem:subsystem_utils',
'tests/python/pants_test/base:context_utils',
'tests/python/pants_test/engine:util',
'tests/python/pants_test/option/util',
'tests/python/pants_test/testutils:file_test_util',
],
provides=pants_setup_py(
name='pantsbuild.pants.testinfra',
description='Test support for writing pants plugins.',
namespace_packages=['pants_test'],
additional_classifiers=[
'Topic :: Software Development :: Testing',
]
)
)

python_library(
name = 'int-test-for-export',
sources = [
Expand Down
36 changes: 0 additions & 36 deletions tests/python/pants_test/BUILD
Original file line number Diff line number Diff line change
@@ -1,42 +1,6 @@
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

# TODO: move this to src/python/pants/testinfra once we finish moving all testinfra code to src
# and delete the code in tests.
python_library(
name='test_infra',
dependencies=[
'src/python/pants/testinfra:int-test-for-export',
'src/python/pants/testinfra: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',
# NB: The below targets are only here to ensure that we still include in the wheel the original
# pants_test files. We add all transitive dependencies on testinfra code explicitly.
'tests/python/pants_test:int-test-for-export',
'tests/python/pants_test:test_base',
'tests/python/pants_test/jvm:jar_task_test_base',
'tests/python/pants_test/jvm:nailgun_task_test_base',
'tests/python/pants_test/jvm:jvm_tool_task_test_base',
'tests/python/pants_test/engine:engine_test_base',
'tests/python/pants_test/subsystem:subsystem_utils',
'tests/python/pants_test/base:context_utils',
'tests/python/pants_test/engine:util',
'tests/python/pants_test/option/util',
'tests/python/pants_test/testutils:file_test_util',
],
provides=pants_setup_py(
name='pantsbuild.pants.testinfra',
description='Test support for writing pants plugins.',
namespace_packages=['pants_test'],
additional_classifiers=[
'Topic :: Software Development :: Testing',
]
)
)

python_library(
name = 'int-test-for-export',
sources = ['pants_run_integration_test.py'],
Expand Down
2 changes: 1 addition & 1 deletion tests/python/pants_test/backend/jvm/tasks/reports/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ python_tests(
'src/python/pants/backend/jvm/tasks/reports',
'src/python/pants/util:contextutil',
'src/python/pants/util:strutil',
'tests/python/pants_test:test_infra',
'tests/python/pants_test:test_base',
]
)
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def run_with_testproject_backend_pkgs(self, cmd):
get_buildroot(), 'testprojects/pants-plugins/src/python')
testproject_backend_pkg_name = 'test_pants_plugin'
pants_req_addr = 'testprojects/pants-plugins/3rdparty/python/pants'
pants_test_infra_addr = 'tests/python/pants_test:test_infra'
pants_test_infra_addr = 'src/python/pants/testinfra:test_infra'
pre_cmd_args = [
"--pythonpath=+['{}']".format(testproject_backend_src_dir),
"--backend-packages=+['{}']".format(testproject_backend_pkg_name),
Expand Down

0 comments on commit ca33f3b

Please sign in to comment.