Skip to content

Draft: Use tox-pdm to integrate tox and pdm

Barry Warsaw requested to merge pdm-tox-pdm into main

This is a draft branch to attempt to integrate pdm and tox using tox-pdm and the instructions in the pdm project here. Mysterious failures all around.

It seems like this must be invoked via pdm run tox otherwise, tox doesn't know about the tox-pdm plugin (because I haven't and don't want to install it globally for my brew installed tox).

Note as well that while the documentation says to add sections = qa to your tox.ini, it appears to really be groups = qa.

$ pdm config use_venv
False
$ pdm run tox -e qa
qa recreate: /Users/barry/projects/flufl/lock/.tox/qa
qa pdminstall: ['qa']
________________________________________________________ summary ________________________________________________________
  qa: commands succeeded
  congratulations :)
Traceback (most recent call last):
  File "/Users/barry/projects/flufl/lock/__pypackages__/3.9/bin/tox", line 8, in <module>
    sys.exit(cmdline())
  File "/Users/barry/projects/flufl/lock/__pypackages__/3.9/lib/tox/session/__init__.py", line 44, in cmdline
    main(args)
  File "/Users/barry/projects/flufl/lock/__pypackages__/3.9/lib/tox/session/__init__.py", line 69, in main
    exit_code = session.runcommand()
  File "/Users/barry/projects/flufl/lock/__pypackages__/3.9/lib/tox/session/__init__.py", line 197, in runcommand
    return self.subcommand_test()
  File "/Users/barry/projects/flufl/lock/__pypackages__/3.9/lib/tox/session/__init__.py", line 225, in subcommand_test
    run_sequential(self.config, self.venv_dict)
  File "/Users/barry/projects/flufl/lock/__pypackages__/3.9/lib/tox/session/commands/run/sequential.py", line 9, in run_sequential
    if venv.setupenv():
  File "/Users/barry/projects/flufl/lock/__pypackages__/3.9/lib/tox/venv.py", line 661, in setupenv
    envlog.set_python_info(command_path)
  File "/Users/barry/projects/flufl/lock/__pypackages__/3.9/lib/tox/logs/env.py", line 18, in set_python_info
    answer["executable"] = python_executable
TypeError: 'NoneType' object does not support item assignment
Edited by Barry Warsaw

Merge request reports