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.
Remove deprecated v1 Subsystem facilities (pantsbuild#11424)
### Problem As initiated in pantsbuild#11388, the v1 `Subsystem.{global_instance,scoped_instance}()` facilities are being removed. ### Solution Remove `Subsystem.{global_instance,scoped_instance}()` and their support code. To reduce bootstrap dependencies, the `RunTracker` is no longer a `Subsystem`: its options have moved to being global options, and are deprecated in their previous locations. The `--streaming-workunit-handlers` option (which relied on singleton `Subsystem`s) is also removed in favor of the APIs added in pantsbuild#11388. ### Result Plugins that need access to `Subsystem`s should do so via `@rule` arguments, and callers outside of `@rule`s should use `Scheduler.product_request(<subsystem_cls>, [Params()])` to get an instance.
- Loading branch information
Showing
16 changed files
with
201 additions
and
356 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
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
23 changes: 23 additions & 0 deletions
23
src/python/pants/engine/streaming_workunit_handler_integration_test.py
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,23 @@ | ||
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
import os | ||
|
||
from pants.testutil.pants_integration_test import run_pants, setup_tmpdir | ||
from pants.util.dirutil import maybe_read_file | ||
|
||
|
||
def test_workunits_logger() -> None: | ||
with setup_tmpdir({}) as tmpdir: | ||
dest = os.path.join(tmpdir, "dest.log") | ||
pants_run = run_pants( | ||
[ | ||
"--backend-packages=+['workunit_logger','pants.backend.python']", | ||
f"--workunit-logger-dest={dest}", | ||
"list", | ||
"3rdparty::", | ||
] | ||
) | ||
pants_run.assert_success() | ||
# Assert that the file was created and non-empty. | ||
assert maybe_read_file(dest) |
Oops, something went wrong.