-
Notifications
You must be signed in to change notification settings - Fork 137
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
convert git's path separators to match os.sep #447
base: main
Are you sure you want to change the base?
Conversation
@mawillcockson do you think you'll get back to this, or would you like me to take it over? |
Yes, I can finish it, sorry for the delay. I went down a rabbit hole trying to find out if I wasn't able to come to a conclusion, so I'm leaving it as-is with a note, in case someone finds a bug with it. |
Apologies: I abandoned this PR for so long, I forgot most of the context. None of the tests currently find the untracked files, because the original mock script was not designed to print any. For example, if flit/flit_core/flit_core/sdist.py Lines 159 to 171 in 9335bfb
The original script simulated only the The more complicated rewrite of the script I added and then subsequently removed did both. In light of #445 adding tests with real I think adding a helper function could minimize the added complexity? I also added a test that explicitly runs the build step twice. I think it's possible for the build steps outlined above to change, and running it twice ensures the second build will interact with the previous build's artifacts (e.g. the |
I have confirmed that, without the addition of |
this is a focused fix for the problem referenced in: pypa#445 (comment)
Co-authored-by: Thomas Kluyver <[email protected]>
keep explicit tracked files listing remove unneeded import from git mock script template
efe7c54
to
4de697e
Compare
I've rebased to include the namespace subpackage test. |
git
returns file paths separated by/
regardless of the platform.After
flit.build.main()
is called, starting from this line:flit.vcs.git.list_untracked_deleted_files()
returns a list of files in the directory, all using/
as the path separatorflit.sdist.include_path()
checks if this string starts withdist\
on WindowsVCSError
is thrown because thedist/
folder is not excludedThe current tests fake listing the files in the directory, but do not list the
dist/module1-0.1.tar.gz
thatflit
creates as untracked.I changed the mock git script to behave a little more similarly to the git commands that would be called.
The simpler fix would be to have the mock git script return
dist/module1-0.1.tar.gz
when run with--deleted
, but this way each test can specify the tracked files, and the files produced byflit
are dynamically discovered.I can understand if this makes the tests too flaky.