pdm-project / tox-pdm

A plugin for tox that utilizes PDM as the package manager and installer
MIT License
25 stars 2 forks source link

Installation instruction is not accurate #56

Closed janoskut closed 2 months ago

janoskut commented 2 months ago

I'm just "converting" from pip to pdm, and find that the installation instruction of this project is not accurate.

It says, install pip install tox-pdm OR pdm add -d tox-pdm.

However, adding tox-pdm to pdm itself will not help, as tox will not find it.

Still there's a chance that I'm missing something, but for me the only way to get tox to know the tox=pdm plugin is to install it at system level. Also manually in a virtualenv won't work, because tox is using it's own virtualenvs.

pip install --break-system-packages tox-pdm

I guess there is nothing the plugin can do about, but at least that should be updated in the README.md with a note that it has to be the system pip to install tox-pdm in.

I'm happy to file PRs if you agree, otherwise I'd be more than happy to learn about other ways to get this to work.


Update

I'm just finding out more about this...

This works: install pdm in it's venv, then run tox in the venv:

# not in an venv
pdm install
$(pdm venv activate)
tox -r

Somehow this works - there is no pip in that venv, but tox sees tox-pdm and installs the deps.

This does not work: activate a venv, install pdm in the venv, run tox:

virtualenv .venv && source .venv/bin/activate
pdm install
# pip freeze shows that tox-pdm ins installed in pip
tox -r

Even though tox-pdm is installed in pip of the venv, tox doesn't seem to see it. Probably because as I said above, tox is using it's own venv.

Sorry for the noise - this seems more complicated than I though, and probably there is a lot to understand first about pdm works differently with virtualenvs than what pip does. Feel free to close this if that is all as expected.

frostming commented 2 months ago

It works if you install tox with pdm too and run tox inside project enviroment with pdm run.

It is not an issue with the doc but people just have their own habitual ways of using tools.