ckan / ckanext-googleanalytics

CKAN extension to integrate Google Analytics data into CKAN. Gives download stats on package pages, list of most popular packages, etc.
GNU Affero General Public License v3.0
35 stars 81 forks source link

requirements.txt vs. install_requires within setup.py #48

Closed cuducos closed 3 years ago

cuducos commented 4 years ago

Hi there,

Is there a specific reason for keeping the dependencies of this Python package in a requirements.txt file and not in the install_requires=[] part of the setup.py?

The way this project is made ignores requirements.txt during pip install -e <repo>, making it mandatory to do an extra pip install -r requirements.txt. If we use install_requires, all dependencies would be handled during pip install -e <repo>, simplifying the installation steps.

I would like to have everything handles by pip and I can open a PR.

Also, if you think this way is interesting for the project, I can drop both requirements.txt and setup.py adopting the PEP 517's pyproject.toml, which would give even more flexibility with tools like Poetry (such as dependencies and development dependencies). Any thoughts?

smotornyuk commented 3 years ago

It's just common practice in CKAN project to use requirements file instead of pinning requirements using install_requires. Mainly it's done in order to avoid situations when you unable to install a particular set of extensions\packages because of conflicting requirements - you always have a chance to solve conflict manually

But I think it's ok to use extras_require instead, so that you'll be able to use something like pip install -e .[requirements]

cuducos commented 3 years ago

Ow, got it! Many thanks, @smotornyuk!