-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
sdist with --dist-dir on Windows produces incorrect archive #1185
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
Comments
It seems the issue does not happen on Unix:
So the issue seems to be isolated to Windows. |
Since sdist is largely implemented in distutils, I suspect the issue lies in the upstream implementation. Can you confirm the issue happens if you use distutils without setuptools? |
@jaraco Sure! What would those imports be? |
respectful bump |
I tried replicating the issue on Windows with just distutils and could not. Here's the setup script I created:
However, when I tried to replicate your experience in Setuptools, I can't make it happen:
Even on Python 2 with distutils:
Whatever is happening in your environment isn't happening in mine. I suspect you either have an old version of setuptools or Python that has a bug that's since been fixed. If you can find a way to replicate the issue with the latest Python and setuptools, please try with just distutils and report back here. For now I'm going to close this ticket, but I'll certainly re-open if the issue can be replicated. |
Still a problem. Don't use py -m tarfile to test. Just unzip it with 7zip or anything else. |
Kaiser reported more details in the duplicate ticket:
I also had a question I'd like to see answered:
|
Here's where the tarfile gets created. It doesn't do anything special with filenames. It just calls TarFile.add. Can you supply some test that runs on Python that illustrates the undesirable behavior? I'm not even sure it's possible using the Python APIs to affect the name that appears in 7-Zip. |
This is issue of tarfile. It incorrectly writes header for GZIP compression when user gives path with directories as name to TarFile.add. I created an issue at b.p.o. https://bugs.python.org/issue41316 and fixed this by PR python/cpython#21511 |
I also stumbled upon this bug when building using Would be great if this could be merged soon because it limits the usefulness of pep517 on windows platforms. |
Well done. Thanks Artem! |
|
On further examination, I see that the fix is in |
…ersion 0.23.0 Amjith Ramanujam (7): Refactor commands (#23) More commands refactor (#25) Final command refactor (#27) Update AUTHORS.rst (#29) Add a PR template. (#30) Projectfile (#39) Project class (#49) Chris Warrick (1): Fix Travis builds on macOS (#61) Honza Sedloň (1): Fixed bad encoding for Python 3.7 (#62) John Andersen (1): gitignore: Ignore vim swp files (#20) John Vandenberg (2): setup.py: Use OR to indicate MIT or Apache-2.0 (#79) Avoid installing tests as a package (#86) Lucid One (2): Semver docfix for CONFIG.rst (#65) Support tilde in `extras` globs (#69) Lumir Balhar (3): Do not call `virtualenv` executable directly Enable to run tests without internet connection Add {posargs} to be able to run only subset of tests Lumír 'Frenzy' Balhar (3): Add new contributor to the list of authors. Fixes #26 (#32) test_download_file() requires internet connection (#53) Add decorator to tests which require internet connection. (#59) Ofek Lev (14): replace dep fix travis osx travis allow pypy venvs on windows fix import fix update ci (#82) fix DeprecationWarning grow to 0.21.0 Fix tests (#83) Update setup.py (#84) grow to 0.22.0 Update setup.py (#88) grow to 0.23.0 Philip E Blair (1): Support Releases to Alternative Repositories (#42) ofek (781): Initial commit init scaffolding more things close https everywhere cap H more things more see how gh detects licenses try maybe whitespace? maybe readme try see try detecter broken working now more move apache2 copyright outside body more things begin testing see how toc looks try nope caps try no see .. maybe sigh words why . maybe ok finally try entry backlinks top better fix indent make table of contents default try fix title more testing more tests more make idiomatic thanks to @offby1 finish rst tests test name normalization add init rename remove unused imports use normalized package names more testing more need wheel finish setup.py tests test licenses more testing use search test utils rename need new pip use normalized package name more tests test codecov accept empty strings test none test .coveragerc test travis reorder imports test tox test git reorder imports test files improve badges add output remove unused variable improve coverage rename add config command need virtualenv rename file remove unused import large refactor don't overwrite settings on update need virtualenv need setuptools update command remove unused import app, not lib update Travis' PyPy3 rename new to egg update deps just in case only py3 now remove unused var add grow command remove whitespace increase coverage exit breaks coverage of branch refactor make editable its own function update docs allow `grow` of local editable finishing refactoring oops os agnostic improve coverage everything needs temp_chdir add chdir handle errors more gracefully fix test make unknown version parts verboten do the right thing work on test command that was a nightmare add __main__.py for cli add .vscode/ to ignore improve coverage omit __main__.py if cli, cli.py otherwise remove unused vars work on clean touch everything sort output . finish clean remove unused fn add *.pyd fix more tests finish clean command both, not either add license metadata to setup.py change tox command improve travis script minimum wheel support grow for __about__.py rename var sort just in case add build try getting proper python/pip on linux meh add context manager for temporarily setting env vars begin release command fail in a more helpful way when no config file more exit using same code make uniform throughout codebase more release flags fix package path add temp_move_file skip existing uploads by default support moving arbitrary paths redundant lax build args add ability to set env vars in venv no setup for release begin tests for release command test passed exit code only use test pypi remove unused import test when there is no config file finish release command improve coverage allow updates to config file fix name shadowing use new context manager reuse restore branch logic add message add more tests not necessary remove unused imports don't need these anymore 💥 add copy_path refactor basename(normpath(path)) allow extra files/dirs in project creation refactor venv detection support update for just user allow short flag fix derp use python3 on macOS also make python/pip path detection more robust add ability to set named python paths refactor create venvs with proper python path fix getting path. also, test time reduced by 50%✈️ env command refactor structure of tests don't remove entry points if cleaning editable refactor into utility better catch existing venvs oops chect existance of pypath make pyname fully supercede pypath make more lax add success message test env command fix coverage don't be lazy work on shed command only use default settings via deepcopy start testing shed show user available Python paths don't be lazy remove unused var add get_python_version rename as we'll need both probably nope, output too unreliable add get_python_implementation fix getting version show user available virtual envs fix assertion test it use var make easier finish testing env remove unused var refactor add shells try things allow updating env vars refactor use command is working try fix see try all you need is kill terminate actually need atomic write fix linux looks bad on Windows shell remove unused import refactor shells omit shells for coverage be explicit support xonsh allow nesting shells increment level with every venv activation shell search order: arg, config, env var, platform default start nesting shell prompt logic change default fix get cmd working do zsh refactor fix zsh prompt fix shell discovery more nest zsh has issues too if SHELL env var exists use path as command catch immortal shell if it was discovered via env var try bash try keep spaces maybe meh bash done try fix fix do zsh do xonsh prepare for future no --user on Windows for now add test detect conda supply VIRTUAL_ENV for better interop add ability to update venv add --infra to update command clearly seperate use correct shell always use run add CC0 license put attribution on top add mpl-2.0 add licenses option to egg/init use noqa too build source distribution too pass exit code up need Twine fix fix travis file make function begin work on copying virtual envs just in case fix complete fix_executable another test add option to clean only .pyc rename move try clone refactor fix typo make it easier to get available venvs add ability to restore venvs from another machine remove unused var have dedicated error simplify test fix coverage add merge option to test coverage fix merge be explicit for readers of this try no backlinks try . maybe don't pollute headers support image alt text for badges support markdown see render looks great begin docs remove width extension, allow -h for help more docs better docs no period more docs more docs more docs support __version__.py for grow better example give probable package paths precedence support alternative pre & build tokens fix build test sdist allow specific Python when building don't be lazy make option support updating specific packages support dev-requirements.txt start install command oops just pass exit code fix tests finish install fix support globs for extra files add MANIFEST.in start detecting self updates speed up match dev requirements lazily catch self in requirements too refactor support invoking pip as module update docs meh support self updates test self update oops test use same Python when self updating note about pipfile reword more docs don't test self updates docs rethink requirements avoid complaints more docs fix more logical more docs specify add note more docs better docs make uniform more docs fix update wording support growing a single file support editable installs use proper words fix test support quiet venv creation support multiple sheds action before success message more tests support concurrent shed quote path more docs more docs try thing support elevating privileges disable new features by default when --global allow setting of the admin name fix Windows privilege elevation fix coverage more docs examples support quiet pip update example improve example we're not vim release for testers remove whitespace make default cli print hello world reorder improve metadata meh change name more docs do features update install docs fix rst make function fix logic fix test add uninstall command support dev-only requirements update! describe how we decide on the correct executables make less verbose oops better words I do see try reword better more docs see hmm ? ok maybe more see fix more update info update docs fix docs better more docs update docs oops allow -py docs more docs docs more docs docs speed up editable package discovery docs more docs more docs oops see more fix more oops image actually config docs finished! make know almost see fix rst <3 Click more credits add MANIFEST.in use Travis' PyPy3 update test deps fix pypy fix this too fix test on pypy first release more license info fix rst forgot one reuse link rename command `python` to `pypath` I like pretty 100% message locally remove unused import cry for help document cry for help this too move snake actual release fix setup.py grow update docs pypa/packaging.python.org#264 rename `egg` command to `new` update history grow refactor docs remove extensions put example usage build manifest after copying extra files update history update docs fix manifest update our manifest fix #3 grow list supported shells make venv creation quiet by default show more env info print lazily refactor make function remove unused import better output for builds improve path resolving fix 3.5 grow remove unused import make creating new random envs easy allow install during project creation fix #6 fix logic fix test test improve release command fix rst make simpler grow only need the workaround on Windows update todo add more info reword update link explain how we elevate privileges move to utils try temp env update docs more info restructure readme try colors update docs grow try fish support fish fix #8 add bounty jeez... nope try fish maybe keep state try ? try . fix fix fish no more stacking just in case refactor prevent nesting logic nah more cleanup make easy call option add ability to choose venv location update docs update support powershell update update examples update docs typo yay refactor docs oops grow grow fix ensure only our Twine is used try to fix fedora packaging more colors more colors add message fix test update docs improve xonsh support more fix try macos travis' osx is slow fix macOS yml fix travis configure codecov update docs make creating venvs faster update docs xonsh is now perfect improve test command better output remove unused import refactor tests grow remove optimized bytecode files too exception for ci fix rst grow communicate new color for information success more info better last of it hmm better output link Fedora ticket update docs yay this too new flag fix rst allow choice when creating temp envs grow fix rst document alias more shells recommend xonsh reorder allow no sudo/runas for global fix #21 grow remove this fix test race condition cleanup PyPy... meh annoyed now . more quiet new feature . meh initial project-based package management fix coverage support commands too grow be specific for later use allow choice of Python fix coverage begin new feature start refactor some more clean up add authors clean up features clean up only warn take no action during install fix travis fix change command name clean up grow list fix tests fail better message oops improve setup.py generation allow system site-packages grow refactor conditional detect macOS chain it add appveyor try maybe ok what... increase timeout fix grow fix travis document it unclutter done prepare to fetch things wow... oops reorder imports begin Python installations not yet fix #35 grow new function docs debug update docs fix #37 grow ... implement #38 better spacing test this too .. .. . oops . why try bah . try . oops see all good fix coverage fix test show install same indeed grow reoder change message why not better try conda fix linux try anything show example try this clean up fix up use single quotes decrease AppVeyor build times refactor improve Conda command update docs show in ci fix test hmm try . hmm oops bump dep use new function perhaps update history grow begin python installs reorder refactor handle race condition refactor use defaults fix reorder improve refactor be less verbose begin python add conda to path in ci try hmm good no need refactor no need add new skip condition spacing docs update shells more python clean up better for now improve find_project_root no need test it basic handling of pypa/setuptools#1185 wim glenn (1): fix broken link (#64)
@jaraco
Using a relative path works as expected (
python setup.py sdist --dist-dir dist
)however using an absolute path (
python setup.py sdist --dist-dir C:\Users\Ofek\Desktop\mypkg\dist
) includes the entire path structure starting at the drive/rootThe text was updated successfully, but these errors were encountered: