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

Installation of dependencies #100

Closed
yannikschaelte opened this issue Mar 10, 2021 · 9 comments
Closed

Installation of dependencies #100

yannikschaelte opened this issue Mar 10, 2021 · 9 comments

Comments

@yannikschaelte
Copy link
Contributor

As stated in the README, the tool depends on pip install numpy cython future six setuptools prior to installation. While these are listed under requirements in setup.py, Cython itself is used in setup.py already, making this kind of a hen-egg problem. It would be preferable (as it would simplify builds) to auto-install those dependencies by configuring the pypi package properly, could e.g. be done via setup_requires, so that pip install ipopt is all that is required.

@yannikschaelte
Copy link
Contributor Author

@yannikschaelte
Copy link
Contributor Author

Minimal dirty fix:

# install requirements before import
from setuptools import dist
SETUP_REQUIRES = ['cython>=0.26', 'numpy>=1.15']
dist.Distribution().fetch_build_eggs(SETUP_REQUIRES)

, see also master...yannikschaelte:master

@moorepants
Copy link
Collaborator

Thanks @yannikschaelte for the advice. We welcome pull requests with your suggested changes.

@moorepants
Copy link
Collaborator

The only issue is that the user still has to install a compiler and ipopt as build dependencies. So we will always be left with preinstallation statements like this because all build dependencies can't be installed via pypi.

@yannikschaelte
Copy link
Contributor Author

Sure! I have added a suggestion in #101. This is basically a simple fix, needs to be verified that it works with the pypi+conda deployment. In the long-term, I would suggest to shift the build system to e.g. pyproject.toml, which may allow specifying all dependencies correctly.

Agreed that non-pip dependencies will continue to need a separate installation here. The advantage for us would be that we use standard testing workflows, where we just pip-install all dependencies in a new virtual environment, and having all pip deps of ipopt ready there would simplify a few things. However, no necessity from our side, so feel free to ignore or accept the proposal, as you like.

@moorepants
Copy link
Collaborator

I'm sorta old school and the pyproject.toml file has only seemed to cause problems when I've dealt with them (for example, most conda feedstocks have to remove them for things to work: conda-forge/conda-forge.github.io#1174). We could add one but I'd be wary about shipping it with the source tarball due to the downstream complications. Moving some dependencies from install_requires to setup_requires seems safe to do though, without any downstream consequences.

@yannikschaelte
Copy link
Contributor Author

I think it would be the only "clean" solution. However, we haven't distributed packages via conda, so possible it causes problems there. Certainly python build systems are still in flow, maybe easiest to stick to setup.py hence.

@moorepants
Copy link
Collaborator

Yeah, this is (still) one of those package types that is a bit of a pain to install only with pip.

@moorepants
Copy link
Collaborator

This is resolved (as much as it can be), so closing. There are improvements in the development install docs now too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants