[FR][and a bug?] Support file:
URLs in --installpkg
#3498
Labels
enhancement
help:wanted
Issues that have been acknowledged, a solution determined and a PR might likely be accepted.
What's the problem this feature will solve?
I'm making a matrix of wheels in a separate job in CI, then I want to invoke tox to test something from a wheel. In non-pure python projects, I have to first identify a compatible wheel.
To do this, I use something along the lines of
pip install --find-links=./dist --no-index '${{ env.PROJECT_NAME }}' --dry-run --report=- | jq --raw-output .install[].download_info.url
.But it returns things like
file:///home/runner/work/pylibssh/pylibssh/dist/ansible_pylibssh-1.2.3.dev126%2Bgf256788-cp312-cp312-manylinux_2_28_x86_64.whl
. And so when it's passed as--installpkg file:///home/runner/work/pylibssh/pylibssh/dist/ansible_pylibssh-1.2.3.dev126%2Bgf256788-cp312-cp312-manylinux_2_28_x86_64.whl
, tox gets confused:This is obviously passed to
pathlib.Path()
which treats it as a relative path. And then when it's made absolute, the CWD is prepended. The correct way to do this would be usingpathlib.Path.from_uri()
.Describe the solution you'd like
I think a simple
str.startswith('file:')
for the pathlib object constructor selection would solve this.Alternative Solutions
I could do the conversion before calling tox. But I feel like this is a valid use case for tox to support natively.
Additional context
N/A
The text was updated successfully, but these errors were encountered: