-
Notifications
You must be signed in to change notification settings - Fork 423
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
Warn if package contains console_scripts without listing entry_points #3965
Comments
Conda is technically incapabale of doing binary prefix replacement on Windows because we do not have the 256 byte path prefix space in which to work. This is not something conda/conda-build have ever done and this test makes sure of that for this specific case. You are required to tell conda-build about entry points in all scenarios on Windows. |
Regarding the documentation, it's confusing I agree, but recording != rewriting. |
Thanks for the explanation, Ray! I am not a regular Windows user, so I wasn't aware of this issue. I think a warning or error from conda-build would give the clueless uninitiated (such as myself) some idea of what's going on. I will change the title of this issue. If I get a chance, I will work on a PR. |
Count me in as another person who spent a day or so debugging because of this (saved by finding this thread; It didn't help that on my CI the message about missing the host-environment python path was suppressed, so a lot of that was tracing the problem to conda-build). I also completely unambiguously interpreted this paragraph to mean that it should work and not be an issue. Only in retrospect knowing the issue did that and "Making packages relocatable" interpreted with rather excessive word-lawyering somewhat make the issue understandable. FWIW the docs imply that they should be automatically registered into I'll try and have a think about how the wording could be improved; since it specifically mentions python/pip as a known exception, maybe just a sentence saying that they must be registered in one or the other documentation locations would be enough. |
conda-forge/numpy-feedstock#276 also falls into this category. This needs to be documented better. |
Hi there, thank you for your contribution! This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs. If you would like this issue to remain open please:
NOTE: If this issue was closed prematurely, please leave a comment. Thanks! |
Update: This is known and unavoidable behavior, as explained in the thread below. So instead of a fix, a warning would be nice.
I'm confused about how to package
console_scripts
entrypoints in a way that will work on Windows. This is related to #3731, but I think it's not exactly the same issue.Here is a minimal example of a package and conda recipe that defines an entry point via
console_scripts
. The entry point is tested in the recipe, which works fine on linux, but fails on Windows:As you can see, the issue is that
pip
creates an entry point with a hard-coded reference to...\_h_env\python.exe
, andconda-build
doesn't patch that prefix. In fact, conda-build's own test suite expects and enforces this non-replacement behavior. That seems to be in conflict with what the docs suggest, but maybe I'm confused:So, what is the proper way to package
console_scripts
on WIndows?Edit: OK, While writing up this issue, I noticed that this problem occurs with
python -m pip install .
, but not withpython setup.py install
. I suppose that's a workaround. But it would be nice to know what the intended solution is.Edit: I now see that conda-build's
entry_points
feature also serves as a workaround. (I tested it.) Are recipe authors required to list allconsole_scripts
as conda-buildentry_points
? If so, perhaps a warning should be issued for anyconsole_scripts
that the recipe author has neglected to explicitly list inmeta.yaml
.Actual Behavior
conda-build does not replace the prefix in pip-generated
console_scripts
, which means those scripts don't work.Expected Behavior
I thought conda-build would treat those files as binary files, and therefore replace the prefix so it gets updated at install time.
Steps to Reproduce
Build the recipe contained in this repo on a Windows machine. The test will fail with the error shown above.
Output of conda info
The text was updated successfully, but these errors were encountered: