I recently wrote and released a python package - it's the first time I've ever released something to PyPi so I'm still learning.
I always thought it seemed crazy to store your requirements in both the setup.py and the requirements.txt, so instead I got my setup.py to just read the requirements.txt file instead: https://github.com/big-o/cherrypicker/blob/bf7382cbdabfc6608e3aec388903db32a917314c/setup.py#L32. I've never seen any other project do this though, which leads me to suggest that there's a good reason not to do it.
Can anyone explain to me why I shouldn't do this (or why it isn't a problem)?
I've seen other explanations that say setup.py is for installing your package whereas requirements.txt is for setting up your environment. But I fail to see what the difference is - the dependencies are the same and always will be. If I need a different set of packages, e.g. extra test packages for development, I can specify this separately in the extras_require part of setup.py.
EDIT: I get what the two different roles of setup.py and requirements.txt are, my question is why do the two need to be independent rather than sharing a common list of dependencies across both?