Skip to content

Conversation

@uranusjr
Copy link
Member

Resolves issue raised in #9617 (comment).

News fragment skipped since the sysconfig migration has not been released yet.

This matches the legacy distutils behavior.
@uranusjr uranusjr added skip news Does not need a NEWS file entry (eg: trivial changes) type: bugfix labels Mar 22, 2021
@uranusjr uranusjr added this to the 21.1 milestone Mar 22, 2021
paths["scripts"] = os.path.join(base, python_xy, "Scripts")

# Substitute an empty name with "UNKNOWN" for distutils compatibility.
headers = os.path.join(paths["include"], dist_name or "UNKNOWN")
Copy link
Member

Choose a reason for hiding this comment

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

Wait, what?

I thought the new behaviour was "more correct", and it'd be worthwhile to be a little disruptive about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Strictly speaking, there isn’t really a “more correct” behaviour here. This is trying to get a header path for a distribution, and a distribution without a name shouldn’t have a header path in the first place.

In practice, this case is hit when pip tries to get some other paths (e.g. to get the scripts directory) and doesn’t really care about headers. Those calls should ideally be changed to use something that makes more sense instead, but there are a lot of them.

Copy link
Member Author

Choose a reason for hiding this comment

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

The warning message about this is not just “a little” disruptive. It’s pretty likely to be shown much too often things and flood over actual issue reports.

@uranusjr
Copy link
Member Author

uranusjr commented Mar 22, 2021

Hey, congrats, this fails from the other direction:

WARNING: Value for scheme.headers does not match. Please report this to <***/issues/9617>
    distutils: R:\...\include\site\python3.8
    sysconfig: R:\...\include\site\python3.8\UNKNOWN

So this is not the correct fix. Back to the drawing board, I guess.

@uranusjr uranusjr closed this Mar 22, 2021
@uranusjr uranusjr deleted the sysconfig-header-missing-distname branch July 9, 2021 04:24
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

skip news Does not need a NEWS file entry (eg: trivial changes)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants