-
-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Python install line standard #528
Python install line standard #528
Comments
3 for me |
I still can't find docs for 3 so am concerned that this vanishes at some point without warning. If somebody can show me in their docs, I might change my tune, but for now this is a no-go for me. We have determined that 4 errors so also a no-go. I'm not clear on whether 5 always plays nice with 1 or 2 are the recommended way of doing this (ref1 ref2). While verbose and annoying, it sadly seems to fit with the standard python packaging ecosystem. Maybe we can just accept this minor annoyance until the real annoyance (writing recipes for Python packages at all) is dealt with in an automated fashion ( conda-forge/conda-forge.github.io#28 ) ( conda-forge/conda-forge.github.io#51 ). |
I am with @jakirkham here. We have been using |
I like the option 5 just because it is the shortest one and, in the end, we will get the same result as BTW, source code of setuptools asks to avoid Also, I was trying to find a way to set those arguments from options 1 and 2 via environment variables, so Conda-Build can just set those by default, but I failed to find them. :( |
Interesting note. Thanks for dredging that up, @frol. Not sure if that means it is deprecated, has bad behavior, or something else. FWIW, it survived the 21.0.0 release.
That's nice. This is also backed up by their docs. Maybe
That would really be ideal. Let's not give up hope. |
I would be very happy to have --root=/ I was also thinking about setting these automatically with jinja. I'm not sure how ready that is today, but some logic like: if (script in build) and (setuptools in requirements["build"]): |
You can always have an environment variable that is |
Should we update the list? |
Interesting. I have been wondering if we should just have some jinja module that we load up that has common magic. For instance, adding these arguments, setting standard compiler arguments, etc. |
Good point. That would work. |
@scopatz Hmm, I cannot find anything but custom Makefiles inlining |
@frol there isn't any. I was just saying that conda-forge can make up and define an envvar that stores that standard install line (or part of it). This convention can then be used by all of the conda-forge recipes than can / do follow a standard install procedure. Obviously, this would need to be documented by conda-forge. |
That is, say conda-forge defined an envvar python setup.py install ${CF_PY_INSTALL_OPTS} or in the meta.yaml build:
cmd:
- python setup.py install {{ CF_PY_INSTALL_OPTS }} Or whatever it is. The recipe author does need to tie this in explicitly, but they already have to write the whole line explicitly now. |
yes, that's fine. It's only necessary when setuptools is used, though. It would be nice to have a catch-all, where people wouldn't need to learn when it is or is not necessary. |
Moreover - unfortunately, it breaks things when it is present, but not needed (no setuptools) =( |
@scopatz Oh, got it now. However, I would vote against this since this will require non-standard build:
number:0
python:
setuptools: [] , where the Yet, I'm not sure whether this is a good idea to hard-code this one-liner, which is irrelevant for other languages/build systems. |
I'd go for 5. 4 also works if The disadvantage of 1-3 is that they all assume setuptools is imported in setup.py, whereas pip should do the right thing in both cases (mainly by importing setuptools itself). If a package doesn't use setuptools, then you have to use |
I must say I do like the simplicity of 5 as long as we don't run into issues with |
I am 👍 to option Another question is: should we add |
The likely sources of issues with pip that I can see are the package being found and installation skipped (this was the issue with 4, and avoided with So a more rigorous command might be:
at which point pip is doing very little beyond ensuring that These extra arguments can be added on a case by case basis, if issues are encountered with particular packages, because they shouldn't generally make a difference. You could, however, specify some or all of them in pip.conf during the build: [install]
ignore-installed = true
no-dependencies = true
use-wheel = false edit: fixed typos in config I don't know if there's a great way to get pip.conf loaded during |
This seems core enough that we might want to build it right into conda/conda-build. It might make pip-installed packages work a little better with conda. Thanks for your insight, @minrk. |
@ocefpaf as for whether pip needs to be explicitly included, I think it's up to the |
That is correct. It has caused some issues with the solver in the past, but yes you do get it automatically. Though I kind of prefer the "explicit is better than implicit" mantra personally. |
Thanks for the explanation @minrk. So TL;DR better safe than sorry. Let's keep it there. |
Should add NumPy 1.11.0 recommends using
|
Read more details here: conda-forge/staged-recipes#528
I believe all the proposals do flat egg and pth-free installations. Certainly 5 does. @anguslees it sounds like the issues you encountered had to do with pip's dependency handling, which should not affect anything here, as pip is only used to install the recipe's own package, not pull in any dependencies. |
Hi, just came across this ticket after trying to update a recipe, and performing a pull request.
I'll update to option 5. |
I'm also having the issue @mjscosta mentioned ( |
@jasongrout, commonmark 0.5.4 uses distutils, so |
Ah, thanks! |
Can this be closed then? |
Can we make sure a recommended solution is added to the docs first, with whatever caveats someone should know? |
It's mentioned in the docs here, https://conda-forge.org/docs/meta.html#single-version-externally-managed, but that's not what the general consensus in this thread is. |
@isuruf - I tried using Can you shed more light on your comment above about using distutils, and what I might be able to do? This python packaging situation has me really confused right now. |
@jasongrout I'm experimenting with PS0: that does the |
IIRC, --no-binary needs an argument: https://pip.pypa.io/en/stable/reference/pip_install/#cmdoption-no-binary |
I tried using |
Yep. See edit above. |
I am sure that my vote doesn't count for much and that this issue is very old, but I vote for 5, modified:
I also note that for pure python (noarch: python), that none of the setuptools options (1-3) will build a wheel and that wheels have technical advantages to eggs (like no egg-info entries in the package and true python universality). |
Necro. ☠️ This probably constitutes a separate issue entirely, but it might be helpful to note in official documentation that the
Setuptools is the Great Hell. Ideally, Until that far-fetched day, a note in official conda-forge documentation might suffice. Thanks, all! |
This is almost certainly the wrong place to ask this, but as I can't seem to find documentation for it anywhere, I will anyways. So I apologize in advance. At some point I started using This worked for awhile, but has now stopped working. Instead of copying the python files into the temporary directory created by I wonder why none of this has been clearly documented yet in the conda docs. Or perhaps I'm looking int he wrong place. If I can figure this out, I would be happy to submit a MR to the docs myself. What is the currently recommended way to do this? Update: Actually it looks like $PREFIX is getting changed somewhere, even though the log output says it's being set to the temp directory. |
It is documented in the conda-forge docs: https://conda-forge.org/docs/maintainer/adding_pkgs.html#use-pip 👍 |
- based on conda-forge#528: used --single-version-externally-managed --record record.txt
Can we establish a standard for how we do the whole python setup.py dance?
Please vote by posting a comment with the corresponding number. Majority after 1 week wins?
python setup.py install --single-version-externally-managed --record=record.txt
python setup.py install --single-version-externally-managed --root=/
python setup.py install --old-and-unmanageable
python -m pip install --no-deps .
pip install --no-deps .
I give up on strikethrough. 4 is out, due to error (https://travis-ci.org/conda-forge/staged-recipes/jobs/127374916#L405)
The text was updated successfully, but these errors were encountered: