Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated default ICs. #18627

Merged
merged 12 commits into from
Apr 10, 2023
Merged

Remove deprecated default ICs. #18627

merged 12 commits into from
Apr 10, 2023

Conversation

benjyw
Copy link
Contributor

@benjyw benjyw commented Mar 30, 2023

Now every repo must explicitly specify ICs.

@benjyw benjyw requested a review from stuhood March 30, 2023 23:59
@benjyw benjyw added this to the 2.17.x milestone Mar 30, 2023
benjyw added 3 commits April 1, 2023 17:14
Now a repo must explicitly specify ICs.
@benjyw
Copy link
Contributor Author

benjyw commented Apr 2, 2023

I acknowledge that the hack in setup.py is unpleasant, but the alternative is impractical right now. I can chip away at the relevant tests over time.

Comment on lines +86 to +91
# TODO: This is a hacky affordance for Pants's own tests, dozens of which were
# written when Pants provided default ICs, and implicitly rely on that assumption.
# We'll probably want to find and modify all those tests to set an explicit IC, but
# that will take time.
if "PYTEST_CURRENT_TEST" in os.environ:
return (">=3.7,<4",)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could include another (longer) deprecation here, to commit us to doing that on some timeframe? Maybe 4 releases or something.

Comment on lines +120 to +125
# The python backend requires setting ICs explicitly.
# We do this centrally here for convenience.
if any("pants.backend.python" in arg for arg in command) and not any(
"--python-interpreter-constraints" in arg for arg in command
):
args.append("--python-interpreter-constraints=['>=3.7,<4']")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto a deprecation here? Or are there too many callsites to actually fix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is too hacky not to fix, but it will take time. I'll try and see how many tests are affected.

@benjyw benjyw merged commit d35dba8 into pantsbuild:main Apr 10, 2023
@benjyw benjyw deleted the require_ics branch April 10, 2023 03:22
benjyw added a commit that referenced this pull request Apr 10, 2023
Subsequent PRs will apply this in relevant tests, so we can remove
one of the hacks introduced in #18627.

I have applied this to several tests and verified that it works.
benjyw added a commit to benjyw/pants that referenced this pull request Apr 11, 2023
This is a step towards getting rid of the
IC-setting hack introduced in pantsbuild#18627.
benjyw added a commit to benjyw/pants that referenced this pull request Apr 11, 2023
This is a step towards getting rid of the
IC-setting hack introduced in pantsbuild#18627.
benjyw added a commit that referenced this pull request Apr 11, 2023
This is a step towards getting rid of the IC-setting hack introduced
in #18627.

This is a very mechanical change that replaced uses of RuleRunner
with  PythonRuleRunner. There is also one change to a test timeout.

This is not exhaustive - there are other tests that will need similar
treatment before we can rid of the hack.
huonw added a commit that referenced this pull request Apr 30, 2023
This bumps up the timeouts of several tests that are regularly causing
spurious failures:

1. `src/python/pants/init/load_backends_integration_test.py`
2. `src/python/pants/base/specs_integration_test.py`
3. `src/python/pants/backend/python/goals/coverage_py_integration_test.py`

The most common of these is 1, especially for cherry-picks to 2.16. For
instance, #18832 required 8 re-attempts, #18839 required 5 and #18850
got to 13.

Given these seem to affect 2.16 cherry-picks so much, I'm thinking it
makes sense to cherry pick this back to that branch too, along with the
increase in #18847, and part of #18627 (the increase to
`src/python/pants/engine/streaming_workunit_handler_integration_test.py`).
huonw added a commit to huonw/pants that referenced this pull request Apr 30, 2023
This bumps up the timeouts of several tests that are regularly causing
spurious failures:

1. `src/python/pants/init/load_backends_integration_test.py`
2. `src/python/pants/base/specs_integration_test.py`
3. `src/python/pants/backend/python/goals/coverage_py_integration_test.py`

The most common of these is 1, especially for cherry-picks to 2.16. For
instance, pantsbuild#18832 required 8 re-attempts, pantsbuild#18839 required 5 and pantsbuild#18850
got to 13.

Given these seem to affect 2.16 cherry-picks so much, I'm thinking it
makes sense to cherry pick this back to that branch too, along with the
increase in pantsbuild#18847, and part of pantsbuild#18627 (the increase to
`src/python/pants/engine/streaming_workunit_handler_integration_test.py`).
huonw added a commit that referenced this pull request Apr 30, 2023
#18859)

This cherry-picks a bunch of test timeout increases from main to 2.16.x,
to reduce the number of spurious re-attempts required for other
cherry-picks.

Fully cherry-picked: #18847, #18857

Partially cherry-picked (just the timeout increases): #18627, #18712.

Motivation: when cherry-picking, #18832 required 8 re-attempts, #18839
required 5 and #18850 got to 13, almost all due to tests timing out.
Various other cherry-picks likely required many re-attempts too.

---------

Co-authored-by: Asher Foa <asher@toolchain.com>
benjyw added a commit to benjyw/pants that referenced this pull request Jul 15, 2023
Moves us towards getting rid of the hacky affordance
introduced in pantsbuild#18627.
benjyw added a commit that referenced this pull request Jul 16, 2023
Moves us towards getting rid of the hacky affordance introduced in
#18627.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants