twisted / incremental

A library for versioning your Python projects.
Other
136 stars 22 forks source link

Please make `test_examples.py` use venv #109

Open mgorny opened 1 month ago

mgorny commented 1 month ago

The tests in test_examples.py currently install straight into the parent environment. Unfortunately, this means that in the best case the examples are left installed, and in the worst the tests cannot be run because pip is set not to allow installing packages into the build environment (the error: externally-managed-environment):

$ pip list | grep example
example_hatchling  24.7.0
example_noop       100
example_setuppy    1.2.3
example_setuptools 2.3.4

Could you please make the tests use a dedicated venv (set up with system_site_packages=True and symlinks=True) for every test case?

twm commented 1 month ago

That sounds possible... I've already taken a step in that direction in #107 by isolating the package builds.

Why is it important that the venv be created with system_site_packages=True?

mgorny commented 1 month ago

I presumed you need some of the dependencies there, though perhaps you don't. Then I guess it's mostly a matter whether you want venv to install pip from the Python bundle or use system pip.

mgorny commented 1 month ago

Ah, also please note that we actually need the tests to work fully offline, as all Gentoo builds are isolated from the Internet for security reasons.