Skip to content
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

symlinks not supported by pip / setup.py? #5856

Closed
asciidoc3 opened this issue Oct 5, 2018 · 4 comments
Closed

symlinks not supported by pip / setup.py? #5856

asciidoc3 opened this issue Oct 5, 2018 · 4 comments
Labels
auto-locked Outdated issues that have been locked by automation project: setuptools Related to setuptools type: support User Support

Comments

@asciidoc3
Copy link

  • Pip version: 18.0
  • Python version: 3.6
  • Operating system: debian sid

Hi, I searched and tried for (a lot of) hours to get symlinks in my package asciidoc3 (see alpha here https://pypi.org/project/asciidoc3/ and about 50(!) attempts https://test.pypi.org/project/asciidoc3).
I failed; it's frustrating. 'include_package_data=True' / MANIFEST.in doesn't work: 'data_files contains unexpected objects'. Say, we have

myprogram.py
myprogram.conf
images ---
       image1.png
       image2.png
       ...
other_data ---
       other_data1.txt
       other_data2.txt
       images --> ./images  # <-- ?

What can I do to "install" the symlink 'images --> ./images' in dir 'other_data' in ~/.local/lib/python3.5/site-packages/myprogram/other_data?
The 'workaround' described here https://stackoverflow.com/questions/20288711/post-install-script-with-python-setuptools
(using 'class my_install(install_data)' and 'cmdclass={'install_data': my_install}' ...) didn't work either. And here another link, which does not help me: #3500

Is there a way to include symlinks?

@uranusjr
Copy link
Member

I don’t think packaging symlinks is a good idea in general, since it is extremely likely to break on Windows. It would also be difficult to support symlinks inside a wheel, since Python’s zipfile module does not support archiving symlinks at the current time.

@cjerdonek
Copy link
Member

cjerdonek commented Oct 21, 2018

See also this very recent comment by @waveform80: #5848 (comment)

@pradyunsg pradyunsg added the S: needs triage Issues/PRs that need to be triaged label Dec 14, 2018
@chrahunt chrahunt added project: setuptools Related to setuptools type: support User Support labels Jul 25, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Jul 25, 2019
@chrahunt
Copy link
Member

chrahunt commented Jul 25, 2019

Given that the packaging attempts for asciidoc3 3.0.2.post* were all sdists formatted as tar.gz, it should not be an issue to have a symlink included in the sdist itself or to get setup.py to generate a symlink when it is executed. If this is a problem with that phase then I would suggest IRC, StackOverflow, or (if it looks like something is wrong) the setuptools issue tracker.

For pip's handling of that sdist there are two routes:

  1. legacy install that invokes setup.py directly - this should work but again depends on the behavior of setuptools - this is the one that would apply for asciidoc3 if wheel is not installed since it does not include a pyproject.toml
  2. building a wheel and then installing it - pip is responsible for the wheel extraction and currently this will fail - addressing this one way or another is covered by Symlink (and other) handling of archives #5919.

@chrahunt
Copy link
Member

chrahunt commented Sep 2, 2019

Hello. For getting the symlinks into an sdist in the first place I would check the setuptools issue tracker and mailing list, sending a question to the mailing list if there are no results. Given the pip-specific changes to support these use cases are in #5919 I will close this issue and we can track the activity there. Thank you for reporting!

@chrahunt chrahunt closed this as completed Sep 2, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Oct 2, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation project: setuptools Related to setuptools type: support User Support
Projects
None yet
Development

No branches or pull requests

5 participants