Closed guillep closed 4 years ago
I'm ok to remove it
However,
requirements.txt
file.requirements.txt
and install_requires
in the setup.py
Until now, the content of requirements.txt
and install_requires
coincide, but there might be something better to do?
After looking at the differences of the two files, I prepared a pull request (#60) decoupling dppy's base requirements (numpy, scipy, matplotlib) from the more advanced/optional stuff (e.g. cvxopt which requires a full gcc installation, sphynx for docs).
Note that with this pull request setup.py
and requirements.txt
diverge:
setup.py
now has only the basic dependencies as install_requires
and all the optional stuff as extra. This is what pip
uses when installing (which is the recommended installation method), so it plays a role of "official" dependency listrequirements.txt
can only have a flat (i.e. equal importance) list of dependencies, and is used when creating virtualenvs (and for human reading). I added comments explaining what is necessary and what is optional when installingThis split creates a bit of extra maintenance cost (to make sure that the dependencies are correctly listed in both files, and that the code can deal with missing optional dependencies), but I think making installation simpler/lighter is important for users.
While in theory we could remove requirements.txt
(only setup.py
is referenced in our docs) it would break stuff based on virtualenvs (e.g. ReadTheDocs uses it to build our docs), so I suggest to keep it.
Ok, thanks @guilgautier for the link, now I understand better the difference between both mechanisms :).
I kind of understand that the requirements.txt can be autogenerated from the setup.py. And in that case I'll have an exact list of resolved transitive dependencies that can work in a given environment.
For example, I did:
$ git clone https://github.com/guilgautier/DPPy.git
$ cd DPPy
$ pip freeze
and I got
labaster==0.7.10
atomicwrites==1.3.0
attrs==19.1.0
Babel==2.5.1
certifi==2017.7.27.1
chardet==3.0.4
click==6.7
configparser==3.7.4
contextlib2==0.5.5
docutils==0.14
funcsigs==1.0.2
idna==2.6
imagesize==0.7.1
importlib-metadata==0.18
itsdangerous==0.24
Jinja2==2.9.6
MarkupSafe==1.0
more-itertools==5.0.0
nose==1.3.7
numpy==1.13.0
packaging==19.0
pathlib2==2.3.4
pluggy==0.12.0
py==1.8.0
Pygments==2.2.0
pyparsing==2.4.0
pytest==4.6.4
python-grocery-list==0.1.0.dev0
pytz==2017.2
PyYAML==5.2
requests==2.18.4
scandir==1.10.0
six==1.11.0
snowballstemmer==1.2.1
sphinxcontrib-websupport==1.0.1
typing==3.6.2
urllib3==1.22
virtualenv==15.1.0
wcwidth==0.1.7
Werkzeug==0.12.2
zipp==0.5.2
Which is actually returning the list of packages I have installed in the system... It would be safer to use it together with a virtual env it seems.
It's good to know! Thanks @guillep !
I also think it's good to keep it, as now GitHub uses requirements.txt
files to list the "used by" section on top of repositories.
If we are not using anymore maybe we can remove it?