I decided to ask about single sourcing dependencies in separate issue, since there might be slightly different approach than with version numbers.
Currently, I list my dependencies in setup.py:
import setuptools
setuptools.setup(
name='mypackage',
version=find_version(),
author="Niko Pasanen",
description="My package",
packages=setuptools.find_packages(),
install_requires=[
'astropy>=3.2.1',
'click>=7.0',
'ipython>=7.4.0',
'geopy>=1.2.0',
'numba~=0.51.1',
'pandas~=1.1.2',
],
)
This is needed so that I can install the mypackage in editable state with
This is not, however the full list of packages, since all of the packages listed in install_requires might depend on other packages. Since I am using virtual environments, I can easily take a snapshot of everything I'm using with pip freeze. I could use this snapshotted list (with perhaps some manual editing, removing development time dependencies) then in the setup.py and installer.cfg. But if I modify anything, I have to remember modify two places. What would be the best way to single-source dependencies? I'm thinking that perhaps I could put all to installer.cfg and read them in setup.py. Would that be the way to go?
I decided to ask about single sourcing dependencies in separate issue, since there might be slightly different approach than with version numbers.
Currently, I list my dependencies in
setup.py:This is needed so that I can install the
mypackagein editable state withThis is not, however the full list of packages, since all of the packages listed in
install_requiresmight depend on other packages. Since I am using virtual environments, I can easily take a snapshot of everything I'm using withpip freeze. I could use this snapshotted list (with perhaps some manual editing, removing development time dependencies) then in thesetup.pyandinstaller.cfg. But if I modify anything, I have to remember modify two places. What would be the best way to single-source dependencies? I'm thinking that perhaps I could put all toinstaller.cfgand read them insetup.py. Would that be the way to go?