convert git's path separators to match os.sep#447
convert git's path separators to match os.sep#447mawillcockson wants to merge 12 commits intopypa:mainfrom
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 <takowl@gmail.com>
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. |
gitreturns 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 WindowsVCSErroris 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.gzthatflitcreates 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.gzwhen run with--deleted, but this way each test can specify the tracked files, and the files produced byflitare dynamically discovered.I can understand if this makes the tests too flaky.