So far, embedded_python:packages required that the user passes a space-separated list of packages, just like one would to pip install <packages>. This PR enables users to pass a full requirements.txt file verbatim, similar to pip install -r <file>. But note that embedded_python:packages expects the contents of a requirements.txt file, not the path to the file.
The full requirements.txt format supports markers. They allow conditionally depending on packages based on a platform or Python version. For example, the following line in a requirements.txt file will only install the dependency on Windows:
pywin32==300; sys_platform == "win32"
This is a crucial feature to enable multi-platform support.
As a nice extra benefit, this simplifies how we pass the packages specification to Conan. We no longer need .split(“\n”). See the test package for example.
This PR makes a couple of robustness improvements along the way. Please review per-commit.
So far,
embedded_python:packages
required that the user passes a space-separated list of packages, just like one would topip install <packages>
. This PR enables users to pass a fullrequirements.txt
file verbatim, similar topip install -r <file>
. But note thatembedded_python:packages
expects the contents of arequirements.txt
file, not the path to the file.The full
requirements.txt
format supports markers. They allow conditionally depending on packages based on a platform or Python version. For example, the following line in arequirements.txt
file will only install the dependency on Windows:This is a crucial feature to enable multi-platform support.
As a nice extra benefit, this simplifies how we pass the
packages
specification to Conan. We no longer need.split(“\n”)
. See the test package for example.This PR makes a couple of robustness improvements along the way. Please review per-commit.