Closed marc-portier closed 1 year ago
I can easily add this as a PR if it helps.
Quickly jotting down some boilerplate code to be added to setup.py
to handle this
def required(sfx=''):
""" Load the requirements from the requirements.txt file"""
reqs = []
try:
with open(f"requirements{sfx}.txt") as f:
reqs = [ln.strip() for ln in f.readlines() if not ln.startswith('-') and not ln.startswith('#') and ln.strip() != '']
finally:
return reqs
requirements = required()
requirements_dev = required('-dev')
setup (
name = 'pyamplipi',
....,
install_requires=requirements,
extras_require={'dev' : requirements_dev},
....
)
With this:
pip install -e .
requirements.txt
) will be installed as wellNote:
It also allows for separated dependencies during development (like stuff needed for tests, doc generating....) --> through pip install -e .[dev]
I would be cracking up a PR along these lines one of these days.
Unless people prefer the road via poetry which is more impactful on the code base, but arguably even more feature-complete yet easier/more elegant to manage (as all of that is deferred to the external tool)
kind request to reopen -- since the applied merge is now missing the return reqs
as mentioned in the comments on the PR #10
after
pip install pyamplipi
one can not just start using the library without also including its dependencies:even a simple
from pyamplipi.amplipi import AmpliPi
yields an error (in that case: missing dependency aiohttp)most straightforward approach would be to have the setup.py take over the dependencies from the requirements.txt file (or using a tool like poetry to handle it)