I am trying to write script, which should use Portage API. But Portage python package doesn't available in PyPi, but even if it were available that would not make any sense, because it should be used from some configured system with package database and configs.
I tried to wrote the following ugly enough code:
[tool.poetry.dependencies]
python = "^3.6"
click = "^7.0-r1"
portage = [
{ markers = "python_version ~= '3.6' and sys_platform == 'linux'", path = "/usr/lib64/python3.6/site-packages/portage/" },
{ markers = "python_version ~= '3.7' and sys_platform == 'linux'", path = "/usr/lib64/python3.7/site-packages/portage/" },
{ markers = "python_version ~= '3.8' and sys_platform == 'linux'", path = "/usr/lib64/python3.8/site-packages/portage/" },
{ markers = "python_version ~= '3.9' and sys_platform == 'linux'", path = "/usr/lib64/python3.9/site-packages/portage/" }
]
But it doesn't work. Code in the path directory doesn't considered by Poetry as python package.
[ValueError]
Directory /usr/lib64/python3.6/site-packages/portage does not seem to be a Python package
Is there a way to do this and to use system as virtual environment for running tests (I understand that running tests in host system isn't a good idea, but there is a docker image with installed Portage)?