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
makespec: Use portable path separators #8116
base: develop
Are you sure you want to change the base?
Conversation
Hmm, I'm quite sure that the splash image path needs to receive the |
Is there a reason why (Actually, perhaps it would make sense for all fields in the generated template to use %r as a format string?). |
836966e
to
1e3ce10
Compare
Mind if I scrap the whole |
Hmm, I have a vague recollection of trying to make sense of that part of code sometime back... As you say, So yeah, go ahead and scrape it. |
Ahh, Plus, you have a 50% chance of having it work on linux with venv, due to |
scripts = [make_path_spec_relative(x, specpath) for x in scripts] | ||
# With absolute paths replace prefix with variable HOMEPATH. | ||
scripts = list(map(Path, scripts)) | ||
scripts = list(map(portable_filepath, scripts)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these script paths still need to be made spec-relative, though, because the build process assumes that if they are relative, they are relative to spec directory.
For example, this used to work
pyinstaller --clean --noconfirm program/program.py --specpath spec/
and now it does not (and in contrast to the HOMEPATH
thing, I imagine this is used).
Although I suspect that this scenario is party broken anyway, because all given relative paths (icons, etc.) that we later treat as spec-relative would need to be made relative to spec here... But for now, we should at least maintain status quo here.
Those test failures are not directly related to the PR; the matching pattern in
does not account for numbers greater than 99 (e.g., Analysis-105.toc ). This probably depends on the test order (I recall seeing that test fail sporadically on the CI), and the changes made here might have rearranged the tests so that the issue occurs more consistently.
|
Use forward slashes – even on Windows – in filenames in generated spec files so that the spec file is independent of the platform it was generated.
Remove the automatic substitution of PyInstaller.HOME_PATH (most likely the ``site-packages`` directory) in relative CLI path parameters to into a relocatable ``os.path.join(HOME_PATH, ...)``. I can't think of any good reason why anyone would even notice this feature exists whereas it's more likely that a PyInstaller test would unwittingly run into it.
e503ff8
to
b825ef6
Compare
resources = list(map(escape_win_filepath, resources)) | ||
exe_options += "\n resources=%s," % repr(resources) | ||
resources = [portable_filepath(r) for r in resources] | ||
exe_options += "\n resources=%r," % repr(resources) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This repr()
needs to be removed as it is now part of the format.
Use forward slashes – even on Windows – in filenames in generated spec files so that the spec file is independent of the platform it was generated.