forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use dependency inference internally (pantsbuild#10283)
We also add a new `python_integration_tests` macro to cut down on boilerplate even further. [ci skip-rust-tests]
- Loading branch information
1 parent
2f493cd
commit d60cde2
Showing
90 changed files
with
152 additions
and
2,062 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
def python_integration_tests(*, uses_pants_run: bool, **kwargs): | ||
kwargs["tags"] = [*kwargs.get("tags", []), "integration"] | ||
if uses_pants_run: | ||
kwargs["dependencies"] = [ | ||
*kwargs.get("dependencies", []), "src/python/pants/testutil:int-test" | ||
] | ||
if "sources" not in kwargs: | ||
kwargs["sources"] = ["*_integration_test.py"] | ||
python_tests(**kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
__import__("pkg_resources").declare_namespace(__name__) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
|
||
python_library( | ||
dependencies = [ | ||
'3rdparty/python:dataclasses', | ||
'3rdparty/python:requests', | ||
'3rdparty/python:www-authenticate', | ||
'src/python/pants/subsystem', | ||
'src/python/pants/process', | ||
'src/python/pants/util:dirutil', | ||
'src/python/pants/util:memo', | ||
'src/python/pants:version', | ||
], | ||
) | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
__import__("pkg_resources").declare_namespace(__name__) | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,4 @@ | ||
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
|
||
python_library( | ||
dependencies=[ | ||
'src/python/pants/base:build_root', | ||
'src/python/pants/core/util_rules', | ||
'src/python/pants/engine:console', | ||
'src/python/pants/engine:fs', | ||
'src/python/pants/engine:goal', | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:selectors', | ||
'src/python/pants/engine:target', | ||
'src/python/pants/engine:unions', | ||
], | ||
) | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,6 @@ | ||
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies=[ | ||
'src/python/pants/backend/python/rules', | ||
'src/python/pants/backend/python/subsystems', | ||
'src/python/pants/backend/awslambda/common', | ||
'src/python/pants/build_graph', | ||
'src/python/pants/core/util_rules', | ||
'src/python/pants/engine:addresses', | ||
'src/python/pants/engine:fs', | ||
'src/python/pants/engine:process', | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:selectors', | ||
'src/python/pants/engine:target', | ||
'src/python/pants/engine:unions', | ||
'src/python/pants/python', | ||
], | ||
) | ||
python_library() | ||
|
||
python_tests( | ||
name='tests', | ||
dependencies=[ | ||
':python', | ||
'src/python/pants/backend/python/rules', | ||
'src/python/pants/backend/python/subsystems', | ||
'src/python/pants/backend/awslambda/common', | ||
'src/python/pants/engine:addresses', | ||
'src/python/pants/engine:fs', | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:selectors', | ||
'src/python/pants/engine:target', | ||
'src/python/pants/source', | ||
'src/python/pants/util:contextutil', | ||
'src/python/pants/testutil:external_tool_test_base', | ||
'src/python/pants/testutil/option', | ||
], | ||
) | ||
python_tests(name='tests') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies = [ | ||
'src/python/pants/core/util_rules', | ||
'src/python/pants/engine:platform', | ||
'src/python/pants/engine:target', | ||
], | ||
) | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,6 @@ | ||
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies = [ | ||
'src/python/pants/backend/codegen/protobuf', | ||
'src/python/pants/backend/python:target_types', | ||
'src/python/pants/build_graph', | ||
'src/python/pants/core/util_rules', | ||
'src/python/pants/engine:addresses', | ||
'src/python/pants/engine:fs', | ||
'src/python/pants/engine:platform', | ||
'src/python/pants/engine:process', | ||
'src/python/pants/engine:target', | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:unions', | ||
], | ||
) | ||
python_library() | ||
|
||
python_tests( | ||
name="tests", | ||
dependencies = [ | ||
':python', | ||
'src/python/pants/backend/codegen/protobuf', | ||
'src/python/pants/engine:addresses', | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:target', | ||
'src/python/pants/testutil:external_tool_test_base', | ||
'src/python/pants/testutil/option', | ||
], | ||
) | ||
python_tests(name="tests") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies=[ | ||
'src/python/pants/backend/native/config', | ||
'src/python/pants/backend/native/subsystems', | ||
'src/python/pants/backend/native/subsystems/binaries', | ||
], | ||
) | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,4 @@ | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies=[ | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:platform', | ||
'src/python/pants/util:osutil', | ||
], | ||
) | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,4 @@ | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies=[ | ||
'3rdparty/python:dataclasses', | ||
'src/python/pants/backend/native/config', | ||
'src/python/pants/backend/native/subsystems/binaries', | ||
'src/python/pants/backend/native/subsystems/utils', | ||
'src/python/pants/build_graph', | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:platform', | ||
'src/python/pants/engine:selectors', | ||
'src/python/pants/subsystem', | ||
'src/python/pants/util:collections', | ||
'src/python/pants/util:enums', | ||
'src/python/pants/util:memo', | ||
'src/python/pants/util:meta', | ||
], | ||
) | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,4 @@ | ||
# coding=utf-8 | ||
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies=[ | ||
'src/python/pants/backend/native/config', | ||
'src/python/pants/backend/native/subsystems/utils', | ||
'src/python/pants/core/util_rules', | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:platform', | ||
'src/python/pants/util:dirutil', | ||
'src/python/pants/util:enums', | ||
'src/python/pants/util:memo', | ||
], | ||
) | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,4 @@ | ||
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies=[ | ||
'src/python/pants/subsystem', | ||
'src/python/pants/util:dirutil', | ||
'src/python/pants/util:memo', | ||
'src/python/pants/util:ordered_set', | ||
'src/python/pants/util:strutil', | ||
], | ||
) | ||
python_library() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,6 @@ | ||
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_library( | ||
dependencies = [ | ||
'3rdparty/python:dataclasses', | ||
'src/python/pants/base:build_root', | ||
'src/python/pants/engine:addresses', | ||
'src/python/pants/engine:console', | ||
'src/python/pants/engine:fs', | ||
'src/python/pants/engine:goal', | ||
'src/python/pants/engine:platform', | ||
'src/python/pants/engine:process', | ||
'src/python/pants/engine:rules', | ||
'src/python/pants/engine:selectors', | ||
'src/python/pants/engine:target', | ||
'src/python/pants/engine:unions', | ||
'src/python/pants/option', | ||
'src/python/pants/source', | ||
'src/python/pants/util:objects', | ||
], | ||
) | ||
python_library() | ||
|
||
python_tests( | ||
name = "tests", | ||
dependencies = [ | ||
':pants_info', | ||
'src/python/pants/engine:fs', | ||
'src/python/pants/engine:target', | ||
'src/python/pants/engine:unions', | ||
'src/python/pants/option', | ||
'src/python/pants/source', | ||
'src/python/pants/testutil:test_base', | ||
'src/python/pants/testutil/engine', | ||
'src/python/pants/testutil/subsystem', | ||
], | ||
) | ||
python_tests(name = "tests") |
Oops, something went wrong.