-
Notifications
You must be signed in to change notification settings - Fork 249
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
Solving problems in OS X when library has dependencies #11
Conversation
Hey @YannickJadoul - thanks for doing a bit of debugging! We've been looking at some similar things over in #9 - perhaps you could give the latest release 0.2.1 a shot and see if that fixes things? |
Oh, sorry, I should've checked the other pull requests better, before. But building on the new release again, so let's see: https://travis-ci.org/YannickJadoul/Parselmouth/builds/241758708 |
My build is timing out now, because for some reason, the whole library is fully compiled twice (the first time after |
@YannickJadoul Good catch! I hadn't realized the As for my recent PR and your issue with it: I hadn't imagined the double compilation would be an issue but now I see that it is...I think ideally you would want to do a |
@YannickJadoul gah, sorry, that's annoying. Maybe you could use CIBW_SKIP in a Travis matrix to split your builds onto two machines so you stay under the limit? @tgarc agreed re |
Hmmm, that's maybe also a plan, yes. I was also thinking of setting up
So, with the
I'm all for consistency, but why should that be a for-loop, actually? After all, the dependencies are separate projects (probably on PyPI), so you don't need to |
I've started looking at this problem again, seeing if there's some kind of flag for But in the meanwhile: could someone please explain again what the actual purpose of PR #9 was? |
#9 was solving the problem in #6. Some packages need their dependencies installed before they will compile. This is described in setup.py I think we need a way of getting the dependencies from a package, so we can pip install them, and then do a |
Ah, I see, I'd looked over those details; thanks! Just playing the devil's advocate: is that the actual function of 'install_requires', actually? The Python documentation says install_requires is a setuptools setup.py keyword that should be used to specify what a project minimally needs to run correctly. When the project is installed by pip, this is the specification that is used to install its dependencies. |
Just tested, and Edit: finally found sóme documentation on |
I think you're right @YannickJadoul re. install_requires vs. setup_requires, however, the distinction is not really seen elsewhere in the packaging ecosystem so most devs don't know about setup_requires. I've had a couple tickets about this already on this repo, so I'm thinking it's better just to sidestep the problem and install dependencies before trying to build. I also think I had one ticket that wasn't solved by the setup_requires. Ah, yes I found it. #2 (comment) The problem being that the non-standard .eggs installation means the header files are in a different place. Ah, packaging 😉. I guess if we can't figure out the double-compile problem we could add an option to disable the 'pip install' step, but keeping the slower and safer way by default. But I'm still hopeful about installing the deps before! |
I mentioned this in passing earlier, but pip freeze seems to automatically generate a requirements file for a package so that may be a potential solution. I was planning at some point to look a little closer at why pip install is really required in my case (#6) and if there was some other way around it but I haven't found the time just yet. |
@joerick Yeah, I was still just trying to understand everything, not trying to make a point on how I think things should be done. After all, the whole packaging procedure ís a complex mess, which is why I was so happy to find your small but oh-so-useful library ;-) I can probably 'fix' the double compilation by using ccache (so it will just preprocess and see it can use the cached object files), but that still feels as if there should be a better option. |
@tgarc I can't see how |
I actually found this thread on StackOverflow, yesterday: https://stackoverflow.com/questions/24236266/how-to-extract-dependencies-information-from-a-setup-py |
Joe, my mistake, I didn't realize pip freeze only works for installed packages. Although with some further searching I came across pip-compile : seems painless enough. I wonder if that might do the trick. |
Aha! I did a little trawling through pip-tools and found
|
Also, I had a look at pip - found that it seems to use
|
@YannickJadoul I ask because for my package (github.com/tgarc/pastream) |
@tgarc The original issue of this PR is that But your pull request does fix that, actually, because you now run the So my current problem is that my C code base is rather big (since I'm wrapping an existing program) and takes a long time to compile. Since you added the |
There's this package, extending setuptools: https://setupext-pip.readthedocs.io/en/latest/requirements-command.html But if we want, I suppose we could do something similar? Edit: The other option is to point people to |
Thanks Yannick! So your problem is not really related to #6 but is 'fixed'
by side effect in the last PR. That's good to know.
…On Jun 30, 2017 7:11 AM, "Yannick Jadoul" ***@***.***> wrote:
There's this package, extending setuptools: https://setupext-pip.
readthedocs.io/en/latest/requirements-command.html
But it also only uses the setup_requires (and mentions the difference:
https://setupext-pip.readthedocs.io/en/latest/
requirements-files.html#using-requirement-files)
But if we want, I suppose we could do something similar?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#11 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAaVHI6kf0U4pISuY3GSCeFKK7cjkcspks5sJOXkgaJpZM4N2Z83>
.
|
I'm thinking maybe we should revert #9. Instead, what about this:
This is just a suggestion so please free to criticize, but it seems like pre-installing a requirements file is a common build step (I'm mostly following the manylinux example). BTW, do you have any ideas on why users would need to retrieve wheels for all their dependencies (as is automatically done when running |
Hey @tgarc. Wow, thanks for the thinking you've done here.
I'm going to push back a little on using
Agreed, this is the best approach. Perhaps using the
No, I don't acutually. I think it was just an interesting side-effect of the code as written that multiple wheels would get produced. I got the distutils command down to a one-liner, might be useful for the linux build
|
Cool, this indeed seems like a good path to take to me. If we can either make the installing of depencencies a no-op in case nothing need to be done, or an optional thing, users could do what seems best to them.
Is that possible, to build multiple wheels in one package? Either way, as long as we keep the
Nicely done, looks clean. But is distutils still supported by Python? I thought setuptools took over that function? (But I'm not an expert on Python packaging, so maybe that's wrong?) |
Yeah, sounds reasonable. With a little more thought, I don't think there's any apparent reason why we would want to include this as default behavior. I suppose people can always install using BEFORE_BUILD if needed.
I just wonder whether this side effect is benign or not. From what I've read and seen in other builds, it seems like BTW, just in case you haven't seen this before, there is another project for wheel building available which quite a bit more complex: https://github.com/matthew-brett/multibuild . Obviously, I prefer the simplicity of your project, but we might get some ideas from them.
Cool, thanks. Works for python 3 as well. |
+ Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect + add --no-deps to avoid building wheels for dependencies and to fix pypa#11
+ Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect + add --no-deps to avoid building wheels for dependencies and to fix pypa#11
I apparently automatically closed this because I (force-)updated my master branch to the cibuildwheel master. Let me see what I can do to reopen such that this conversation/issue does not get lost? |
Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
I've attempted to address this in PR #18 |
Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
revert PR9; add --no-deps to pip wheel Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR pypa#11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
revert PR9; add --no-deps to pip wheel Revert PR9; it was never actually needed in the first place it just fixed an issue by side effect. 1) add --no-deps to pip wheel step in order to avoid building wheels for dependencies. This also addresses the issues raised in PR #11. 2) Modify the pip install step across platforms to allow installation of dependencies from the index. (This is required since we will no longer be building wheels for dependencies).
I ran into problems when I tried using
cibuildwheel
on Travis CI's OS X, because my library depends on another wheel from the PyPI (numpy
, in this case). (In particular in the finalinstall
step, since it could not find the wheel of my library it had just built.)Looking into the code, I figured the problem was the line that says
temp_wheel = glob(temp_wheel_dir+'/*.whl')[0]
and thus basically ignores thatpip wheel .
will by default download the wheels on which the library depends.This PR simply solves that by not downloading those dependencies until the actual
install
step. However, I'm not sure this is the very best solution and I am not an expert onsetuptools
andpip
, so maybe there are other possibilities to consider... ?