-
Notifications
You must be signed in to change notification settings - Fork 109
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
Make wheels available on PyPI #191
Comments
I'm not sure what the project priorities are, but from a user perspective I totally agree. Having pre-built wheels available would be wonderful as helping less-advanced programmers get started using this package can be a challenge. I would be willing to help put some work towards this as well if that would be a useful place to contribute. |
This is something we're aware of, but unfortunately none of the maintainers have time to work on this. If anyone is willing to do this and submit a PR (maybe @dhill2522?) then that would be greatly appreciated. I don't really know too much about how Python wheels work, or conda packages for that matter. More specifically, I'm not sure how binaries would work if the user wants to also install optional optimizers, which must be installed separately and linked via dynamic libraries. |
Ok. We have had some experience with PyPi and binaries with project GEKKO and I think we should be able to figure something out. I will probably be relatively busy for the next week, but after that I should have a good chance to take a look at it. Certainly no guarantees I will have the time, but we will see. |
As a note to myself and anyone working on this. If we were to release this as a conda package rather than a PyPi package then we might be able to take advantage of solver installations already published as conda packages. For example IPOPT is available relatively easily on Mac and Linux through cyipopt (Some tweaking likely required). I realize we would probably expect people to install the solvers themselves, but it seems that pyoptsparse has some pretty inherently system-level dependencies rather than just python ones. In my experience Conda has generally worked better for that. Are there any strong feelings on a conda package vs a PyPi one? |
on challenge is that pyoptsparse is often run on clusters, where the
anaconda build is not always available. I don't object to a conda package
though, as long as the manual install remains an option.
…On Sat, Dec 5, 2020 at 5:23 PM Daniel Hill ***@***.***> wrote:
As a note to myself and anyone working on this. If we were to release this
as a conda package rather than a PyPi package then we might be able to take
advantage of solver installations already published as conda packages. For
example IPOPT is available relatively easily on Mac and Linux through
cyipopt <https://github.com/matthias-k/cyipopt> (Some tweaking likely
required). I realize we would probably expect people to install the solvers
themselves, but it seems that pyoptsparse has some pretty inherently
system-level dependencies rather than just python ones. In my experience
Conda has generally worked better for that.
Are there any strong feelings on a conda package vs a PyPi one?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#191 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAN7OKOQ44YX52E5PMIBWTSTKXETANCNFSM4UOS4EJQ>
.
|
Good point. I'm guessing that people really looking to maximize performance would opt for a manual install anyway as it would allow for configuration of linear solver packages and things like that. I certainly agree that a manual install should still be possible no matter how an installation package is made. |
Being able to interface to cyipopt or others would be great, but will likely require some substantial changes to not just the installation process but the Python wrapper as well. This will probably be a broader issue tackled at a later stage. I don't know too much about python packaging (with pip/conda), but if it's possible to provide say just the base package without any additional optimizers using Python wheels (i.e. pip) then that is probably a great starting point, since like @JustinSGray said not everyone uses conda but pretty much everyone uses pip. This is a broad issue and I would prefer tackling it incrementally, rather than aiming for a larger goal (such as some sort of conda package with configurable linking with other optimizer libraries). |
So I took a look at it and it looks pretty simple so far. I think I did this on the pip branch of my fork. It seemed to work fine and I was able to release to the test PyPI instance without an issue using the package name of "pyoptsparse-dhill2522". You can take a look at it the branch here and the test release here. The built package can also be installed with the following: There are a couple questions I had though:
Finally, I added some required metadata to setup.py and used my own info there in order to avoid impersonating anyone and because I don't know exactly what should go there. These fields will obviously need to be updated before actually doing any release. |
Hi Daniel, thanks for putting in some work on this. However, I tried it out and the package available on PyPI (the test one) does not seem to contain any compiled libraries, so none of the optimizers work. The way the current The additional complication comes in through the optional optimizers as I mentioned before. These are detected by |
Ok, looks like I completely missed the majority of the work then, but thanks for the direction. I have not had any experience with packages that require compilation of other languages, so it will likely take me a little while to figure it out. I will see if I can make progress on this, but it is not pressing for my work, so it may go slowly. |
No worries, this would be a major overhaul of the setup process for pyOptSparse so it will for sure take some time. Since this is more of a "nice to have" feature, there is no rush to get this working. That being said, this is probably not as difficult as I made it out to seem. In fact, it's possible that everything is already there in |
I actually tried simply running On second thought there is probably some sort of hook in |
That's not really a problem for building the wheel since it won't be done by the user. It'll be run by the CI provider (currently Travis) on new releases in order to publish the package on PyPI, so as long as the environment there has the required dependencies to build the wheel we should be okay. For those that install from source, there are ways around this also, using for example |
It seems that this package is a prerequisite for testing
dymos
(OpenMDAO/dymos#471). Thus, it would be great ifpyoptsparse
was available on PyPI as well.The installations instructions for
pyoptsparse
(pip install .
) did not work out of the box for me, apparently due to compilation problems of the Fortran code:error.log
For packages with compiled code, I would strongly recommend uploading precompiled wheels to PyPI to make installation easy on systems that don't have the necessary compilers installed (Windows especially). I've had good experiences with using https://github.com/joerick/cibuildwheel running on Github actions to generate the wheels.
Releasing a conda-package on conda-forge may also be something to look into (but personally, I think wheels have a higher priority)
The text was updated successfully, but these errors were encountered: