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

Specifying dependencies in the install_requires #731

Open
ddelpiano opened this issue Jan 20, 2023 · 1 comment
Open

Specifying dependencies in the install_requires #731

ddelpiano opened this issue Jan 20, 2023 · 1 comment
Assignees

Comments

@ddelpiano
Copy link
Collaborator

ddelpiano commented Jan 20, 2023

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
Copy link
Collaborator

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

5 participants