suny-downstate-medical-center / netpyne

A Python package to facilitate the development, parallel simulation, optimization and analysis of multiscale biological neuronal networks in NEURON.
http://www.netpyne.org
MIT License
144 stars 135 forks source link

Specifying dependencies in the install_requires #731

Open ddelpiano opened 1 year ago

ddelpiano commented 1 year ago

As discussed at the last sprint meeting for the UI, it would be nice to minimise the range of versions available for each dependency netpyne needs in order to ensure the functionalities.

The setup.py script contains the description of a package. All Python packages that are registered with PyPI (the PYthon
 Package Index) need to have a setup script in their root folder, because installation tools like pip read it to know how the
 package needs to be installed.

The section inside the setup script that describes package dependencies is called install_requires. 
Dependencies are specified as a list of strings, with each string containing the name of a package plus optionally one or 
more version specifiers to restrict the range of supported versions.

As an example, here is the package dependency specification for Flask 0.10:

install_requires=[
    'Werkzeug>=0.7',
    'Jinja2>=2.4',
    'itsdangerous>=0.21'
]
As you can see, this is a "loose" mechanism to define dependencies. 
Versions aren't called directly but instead ranges of accepted versions are specified.

The best way to specify dependencies for a reusable component is through the setup.py file. 
Reusable components are, by definition, going to be imported as dependencies by other projects, and you want pip to be 
able to sort out the dependencies for parent projects automatically, without giving the developer the extra work of having 
to install indirect dependencies manually.

source https://blog.miguelgrinberg.com/post/the-package-dependency-blues

vvbragin commented 1 year ago

https://app.asana.com/0/1200408935614168/1203859764867026/f