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

Add per-requirement --config-settings #11634

Merged
merged 26 commits into from
Apr 10, 2023
Merged

Conversation

q0w
Copy link
Contributor

@q0w q0w commented Dec 5, 2022

Closes #11325

@uranusjr
Copy link
Member

uranusjr commented Dec 6, 2022

Hmm, tests are failing but they seem to be unrelated. Something may be wrong in the CI?

@q0w
Copy link
Contributor Author

q0w commented Dec 6, 2022

I've tried to investigate, whats wrong with ssl but unsuccessfully

@q0w q0w marked this pull request as ready for review December 14, 2022 23:27
news/11325.feature.rst Outdated Show resolved Hide resolved
@q0w q0w force-pushed the per-req-config-settings branch from ee0ac23 to 6177722 Compare December 21, 2022 20:21
@sbidoul
Copy link
Member

sbidoul commented Mar 18, 2023

I tentatively added this to the 23.1 milestone as it'd be nice to have it at the same time as the removal of --install-option.

It looks like this PR is doing two things:

  1. adding --config-settings as a per-requirement option
  2. also propagating per requirements config settings to their transitive dependencies?

It seems (2.) was not done for --global-option and --build-option so I'd like to flag this to make sure everyone is on board with that.

I don't have a ton of practical experience with these options, but my instinct says it might be more flexible not to do that and let the user precisely specify which req must get which config settings.

@github-actions github-actions bot added the needs rebase or merge PR has conflicts with current master label Mar 18, 2023
@pfmoore
Copy link
Member

pfmoore commented Mar 18, 2023

I don’t have any practical experience to draw on either, but I strongly believe that we shouldn’t be introducing (2) silently. I’d rather see it as a separate PR so the implications can be discussed in isolation, but even if that isn’t possible I’d want to see some clear justification for the behaviour. It should also be explained clearly in the docs (as it’s far from obvious - see the comment by @uranusjr above) and explicitly noted as new behaviour in the changelog. I don’t believe we have any other case of settings being inherited by dependencies like this.

I’m personally -1 on behaviour (2), but mostly because it feels really confusing to me, and I expect it to be a source of bugs as users misunderstand it as well.

@q0w
Copy link
Contributor Author

q0w commented Mar 19, 2023

So should I remove the build flag propagation?

@sbidoul
Copy link
Member

sbidoul commented Mar 19, 2023

So should I remove the build flag propagation?

@q0w I think so yes.

Can you also add a test where config settings are passed both on the CLI and as per-requirement options?
We need to decide what to do in that case, but my current assumption is that we should merge both.
Please also add a test where the same config setting is passed on the CLI and and as per-requirement option, or multiple identical config settings are passed as per-requirement options (see #11681).

You may also want to base your work on #11876.

@pypa-bot pypa-bot removed the needs rebase or merge PR has conflicts with current master label Mar 20, 2023
@q0w
Copy link
Contributor Author

q0w commented Mar 20, 2023

Can you also add a test where config settings are passed both on the CLI and as per-requirement options?

added pypa/pip@2f6f36c (#11634)

@q0w

This comment was marked as resolved.

@sbidoul
Copy link
Member

sbidoul commented Mar 27, 2023

Keep in mind that this PR should not be merged before #11876 is.

@q0w
Copy link
Contributor Author

q0w commented Mar 27, 2023

after #11876 i cant pass merged cli/reqs config_settings to install_req_from_parsed_requirement

@sbidoul
Copy link
Member

sbidoul commented Mar 27, 2023

after #11876 i cant pass merged cli/reqs config_settings to install_req_from_parsed_requirement

Well that config_setting argument was not used so I removed it in #11876. But you can still re-introduce it if that's the best way to do it :)

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

Thanks @q0w ! A last round comment and it it should be good to go.

src/pip/_internal/cli/req_command.py Outdated Show resolved Hide resolved
src/pip/_internal/utils/misc.py Outdated Show resolved Hide resolved
tests/unit/test_utils_misc.py Outdated Show resolved Hide resolved
@q0w q0w force-pushed the per-req-config-settings branch from 1dd2328 to 6ea91c8 Compare March 31, 2023 08:46
@pfmoore
Copy link
Member

pfmoore commented Apr 1, 2023

This looks pretty close to being ready for merging. If we can get this done in the next week or so, it'll make it into 23.1 which would be excellent.

@sbidoul
Copy link
Member

sbidoul commented Apr 8, 2023

@q0w following the discussion in #11915 (comment) we'll need to rework this PR to remove the merging with CLI requirements. Sorry again for the confusion. If you think you will not have time to do it by mid next week, just let me know and I'll finalize it.

@q0w
Copy link
Contributor Author

q0w commented Apr 9, 2023

@sbidoul Removed merging config settings

Copy link
Member

@sbidoul sbidoul left a comment

Choose a reason for hiding this comment

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

Thanks!

@uranusjr uranusjr merged commit 3ac7e10 into pypa:main Apr 10, 2023
@q0w q0w deleted the per-req-config-settings branch April 10, 2023 08:56
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Per requirements --config-settings
6 participants