It happens all of the time (but the only machine I have verified this on is my M1 Mac), but I only know how to reproduce it inside of nixpkgs at the moment. You can do so by installing the nix package manager and running:
However, this is only reproducible currently on the staging or staging-next branches, which contain changes to core packages, and, due to how nix works, hundreds of packages require being rebuilt taking several hours. (Once changes move to the nixpkgs-unstable branch, they will be built and cached in a binary cache.)
Testing environment
❯ sw_vers took 26s
ProductName: macOS
ProductVersion: 12.6
BuildVersion: 21G115
❯ twist --version
22.8.0
Additional context
The root cause is that executing the source defined for that test results in:
Traceback (most recent call last):
File "<string>", line 4, in <module>
File "/nix/store/pvfxk0gw5nb276gqhb2xj5w24w67zwgi-python3.10-twisted-22.8.0/lib/python3.10/site-packages/twisted/__init__.py", line 10, in <module>
from twisted._version import __version__ as version
File "/nix/store/pvfxk0gw5nb276gqhb2xj5w24w67zwgi-python3.10-twisted-22.8.0/lib/python3.10/site-packages/twisted/_version.py", line 8, in <module>
from incremental import Version\nModuleNotFoundError: No module named \'incremental\'
Indeed, there is nothing else in that site-packages directory except for twisted. My guess is that the build in nixpkgs adds test dependencies specified to PYTHONPATH instead of using virtual environments.
From looking at the code, I think that a solution (which I have verified fixes the issue in nixpkgs) is to emulate the other tests in that file and pass properEnvs to the spawned process. I will create a PR illustrating this and attach it to this issue, but please feel free to reject it if you think it isn't the right way to resolve this.
The text was updated successfully, but these errors were encountered:
Describe the incorrect behavior you saw
When the nixpkgs package manager builds and tests twisted, the following two tests fails:
Describe how to cause this behavior
It happens all of the time (but the only machine I have verified this on is my M1 Mac), but I only know how to reproduce it inside of nixpkgs at the moment. You can do so by installing the nix package manager and running:
However, this is only reproducible currently on the staging or staging-next branches, which contain changes to core packages, and, due to how nix works, hundreds of packages require being rebuilt taking several hours. (Once changes move to the nixpkgs-unstable branch, they will be built and cached in a binary cache.)
Testing environment
Additional context
The root cause is that executing the
source
defined for that test results in:Indeed, there is nothing else in that
site-packages
directory except for twisted. My guess is that the build in nixpkgs adds test dependencies specified toPYTHONPATH
instead of using virtual environments.From looking at the code, I think that a solution (which I have verified fixes the issue in nixpkgs) is to emulate the other tests in that file and pass
properEnvs
to the spawned process. I will create a PR illustrating this and attach it to this issue, but please feel free to reject it if you think it isn't the right way to resolve this.The text was updated successfully, but these errors were encountered: