setup.py 982 B

12345678910111213141516171819202122232425262728
  1. from setuptools import setup
  2. def load_requirements(use_case: str) -> list[str]:
  3. """
  4. Loading requirements.
  5. These are not exactly-pinned versions.
  6. For the standard packaging (as it should be here), we assume someone is installing FlexMeasures into an existing stack.
  7. We want to avoid version clashes. That is why we read the .in file for the use case.
  8. .txt files include the exact pins, and are useful for deployments with
  9. exactly comparable environments. If you want those, install them before pip-installing FlexMeasures.
  10. """
  11. reqs = []
  12. with open("requirements/%s.in" % use_case, "r") as f:
  13. reqs = [
  14. req
  15. for req in f.read().splitlines()
  16. if not req.strip() == ""
  17. and not req.strip().startswith("#")
  18. and not req.strip().startswith("-c")
  19. and not req.strip().startswith("--find-links")
  20. ]
  21. return reqs
  22. setup(install_requires=load_requirements("app"))