-
Notifications
You must be signed in to change notification settings - Fork 370
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
Organize Python dependencies in separate requirements files #2834
Conversation
I wholeheartedly agree with this change from a conceptual point of view. Having the dependencies defined in individual files and using those from whereever seems like a very good idea. That said, I'm not a user of Conda nor of any other Python environment tools, so I am definitely not the one to review this and suggest to request a review from someone else. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Gives more fine grained control, and allows the requirements to be installed independently of the package manager you decide to use. One remark though: won't the conda users be annoyed to find out most of the environment was installed by pip
? Aren't conda
users usually recommended not to use pip
inside of conda
?
https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-pkgs.html#installing-non-conda-packages
https://www.anaconda.com/blog/using-pip-in-a-conda-environment (Best Practices Checklist)
@terhorstd Would you be able to review this quickly? #2881 touches the files changed here, and so would my solution to #2868. |
@nicolossus Could you resolve the conflict? |
Conflicts: environment.yml
Conflicts: environment.yml
@terhorstd Ping! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this is currently the best way to go. (Even though this mechanism has various drawbacks.)
@terhorstd if they're not already listed, could you summarize the drawbacks? Always nice for future reference |
This PR migrates the Python dependencies that were listed in
environment.yml
to separate requirements files following the already used distinction, that is, requirements for PyNEST, documentation, testing and NEST Server.Previously, most Python dependencies were installed with
conda
. However, besides for large Python packages likeNumPy
, aconda
build of a package is usually not continually maintained. An example of this isSphinx
; the version now available withpip
is 7.0.1 and 5.0.2 withconda
.Besides ensuring more up-to-date Python dependencies, this PR makes it easier to only use
pip
to install required Python packages for those that don't want to useconda
(seerequirements.txt
).The complexity of maintaining our dependencies should not increase with this PR since the
environment.yml
uses the requirements files to create theconda
environment.Changes to conda environment.yml
graphviz
(needed forpydot
)Conda
now installs the non-Python requirements of the software stack (with a couple of exceptions) andpip
installs the Python requirements.Changes to PyNEST requirements
black
csa
pre-commit
ipython
(automatically installed bynotebook
)Note that packages essential to PyNEST that were listed under other sections now have been moved to
requirements_pynest.txt
.Changes to documentation requirements
path.py
.path.py
has been renamed topath
. However, it looks like all code now usepathlib
from the standard library instead.mock
. Could not find it used anywhere. If still needed,mock
is now part of the standard library, available asunittest.mock
in Python 3.3 onwards.recommonmark
. Seems to not be used. The package was archieved in 2022.MyST
can be used as replacement.Note that there already exists a
doc/requirements.txt
where the versions are pinned for Read the Docs. I opted to also let this file exist for the time being, since I am unfamiliar with the reason behind pinning the versions. However, therequirements_doc.txt
introduced by this PR should be able to replacedoc/requirements.txt
.Changes to testsuite requirements
None.
Changes to NEST Server requirements
All packages retained except for
werkzeug
which is automatically installed byFlask
. The names of a few packages are changed so they correspond with the official spelling:flask
->Flask
,flask_cors
->flask-cors
,restrictedpython
->RestrictedPython
.