psf / pyperf

Toolkit to run Python benchmarks
http://pyperf.readthedocs.io/
MIT License
771 stars 74 forks source link

Propagating PYTHONPATH in tests #146

Closed tjni closed 1 year ago

tjni commented 1 year ago

I am working on running the test suite of this package in nixpkgs.

The nix package manager builds each Python package from source and installs it into its own location in a read-only directory instead of relying on a virtual environment and a wheel. To build an environment with dependencies in which a package can be built, we figure out where the dependencies are in the read-only directory and add them to PYTHONPATH.

Currently, a number of tests are failing because they spawn subprocesses which do not have PYTHONPATH passed along, so dependencies of pyperf such as psutil will not be found.

Would you accept a PR to inherit this environment variable in tests, or do you have other suggestions?

vstinner commented 1 year ago

@corona10 @pablogsal: I'm fine with inheriting PYTHONPATH by default, or even consider inheriting all environment variables by default. What do you think?

corona10 commented 1 year ago

@corona10 @pablogsal: I'm fine with inheriting PYTHONPATH by default, or even consider inheriting all environment variables by default. What do you think?

I can not expect the side effect, so looks good to go.