Skip to content

fix: support space in constraints file path #738

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

Merged
merged 12 commits into from
Jul 9, 2021

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented Jun 29, 2021

Closes #740.

@henryiii
Copy link
Contributor Author

For some reason this works on macOS but gives

ERROR: Could not open requirements file: [Errno 22] Invalid argument: '/C:/Users/VssAdministrator/AppData/Local/Temp/pytest-of-VssAdministrator/pytest-1/test_dependency_constraints_fi1/constraints file.txt'

On windows. Does pip not understand URI's on Windows?

@henryiii
Copy link
Contributor Author

Both types of quotes do not work.

@henryiii
Copy link
Contributor Author

henryiii commented Jul 4, 2021

The best way to fix this would be to rely on pypa/pip#10116 when it becomes available, but for now, on Windows, we can make a temporary file if there is a space in the name, which is less likely to contain a space, I think.

@henryiii henryiii marked this pull request as ready for review July 4, 2021 02:19
@henryiii henryiii changed the title tests: add space in constraints file fix: support space in constraints file path Jul 4, 2021
@henryiii
Copy link
Contributor Author

henryiii commented Jul 5, 2021

Could someone take a look at this? I think it will fix the bug with pip breaking build.

Copy link
Contributor

@joerick joerick left a comment

Choose a reason for hiding this comment

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

Other than the note, this looks good to me!

@henryiii henryiii force-pushed the henryiii/fix/constraints branch from 32f7d0a to b6a5968 Compare July 8, 2021 20:21
@henryiii
Copy link
Contributor Author

henryiii commented Jul 9, 2021

@joerick Would it be possible to get another dev release after this to see if if fixes the problem I was seeing in the wild?

@joerick
Copy link
Contributor

joerick commented Jul 9, 2021

Yep, sure! Let me have another look at this.

@joerick
Copy link
Contributor

joerick commented Jul 9, 2021

I hope it's okay with you @henryiii, I just pushed a couple of tidy up commits. If that looks good to you, I should be able to get another alpha out today.

args: Sequence[PathOrStr], env: Optional[Dict[str, str]] = None, cwd: Optional[str] = None
args: Sequence[PathOrStr], env: Optional[Dict[str, str]] = None, cwd: Optional[PathOrStr] = None
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would have been nice with #672, would have fixed this for all OSs. :)

Copy link
Contributor

Choose a reason for hiding this comment

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

haha! yeah... need to decide what to do with that...

Comment on lines 320 to 322
constr = options.dependency_constraints.get_for_python_version(config.version)
constraints_path = options.dependency_constraints.get_for_python_version(
config.version
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI, this originally was exactly the number of characters that kept this from wrapping. ;) This is fine, though.

@henryiii henryiii merged commit 4307b52 into pypa:main Jul 9, 2021
@henryiii henryiii deleted the henryiii/fix/constraints branch July 9, 2021 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: space in directory name can cause issues
3 participants