Open sarahec opened 8 hours ago
There's one issue remaining -- testing segfaults during unittest discovery if run in the sandbox. I found significant work happening upstream to update the unit testing infrastructure, so I suggest we run with this as is and see what we can do differently in the next release.
pytest can often run unittest tests, I think. Have you tried pytestCheckHook
?
Will review more thoroughly in the next couple days.
pytest can often run unittest tests, I think. Have you tried
pytestCheckHook
?
The short answer: pytest can't run these. I spent a full day trying to make it work with miniscule success. (I could run one or two test modules, tops. The code does non-standard things with how it uses unittest and sets up loading paths. Using the unittestCheckHook was a compromise to not have to use python setup.py test
.)
I then reverted back to unittest to get a good number of tests working.
Executing unittestCheckPhase
2024-11-22 11:01:04.320 python3.12[68975:231545759] XType: com.apple.fonts is not accessible.
2024-11-22 11:01:04.320 python3.12[68975:231545759] XType: XTFontStaticRegistry is enabled.
2024-11-22 11:01:15.103 python3.12[68975:231545759] -[__NSCFType pointSize]: unrecognized selector sent to instance 0x6000030886c0
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/__main__.py", line 18, in <module>
main(module=None)
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/main.py", line 105, in __init__
self.runTests()
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/main.py", line 281, in runTests
self.result = testRunner.run(self.test)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/runner.py", line 240, in run
test(result)
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 122, in run
test(result)
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 122, in run
test(result)
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 84, in __call__
return self.run(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 122, in run
test(result)
File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/case.py", line 690, in __call__
return self.run(*args, **kwds)
^^^^^^^^^^^^^^^^^^^^^^^
File "/nix/store/4x0n3j7gh0di0h9mr5a93r1q3z2nzq44-python3.12-pyobjc-core-10.3.1/lib/python3.12/site-packages/PyObjCTools/TestSupport.py", line 1414, in run
cls.sharedApplication()
ValueError: NSInvalidArgumentException - -[__NSCFType pointSize]: unrecognized selector sent to instance 0x6000030886c0
error: builder for '/nix/store/jly4z1v62y7sa210g29nlr5nqmm7m0gs-python3.12-pyobjc-core-10.3.1.drv' failed with exit code 1;
last 25 log lines:
> self.result = testRunner.run(self.test)
> ^^^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/runner.py", line 240, in run
> test(result)
> File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 84, in __call__
> return self.run(*args, **kwds)
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 122, in run
> test(result)
> File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 84, in __call__
> return self.run(*args, **kwds)
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 122, in run
> test(result)
> File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 84, in __call__
> return self.run(*args, **kwds)
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/suite.py", line 122, in run
> test(result)
> File "/nix/store/zyak8iqzh1ww83qa4sqwwz3qax0lrky7-python3-3.12.7/lib/python3.12/unittest/case.py", line 690, in __call__
> return self.run(*args, **kwds)
> ^^^^^^^^^^^^^^^^^^^^^^^
> File "/nix/store/4x0n3j7gh0di0h9mr5a93r1q3z2nzq44-python3.12-pyobjc-core-10.3.1/lib/python3.12/site-packages/PyObjCTools/TestSupport.py", line 1414, in run
> cls.sharedApplication()
> ValueError: NSInvalidArgumentException - -[__NSCFType pointSize]: unrecognized selector sent to instance 0x6000030886c0
For full logs, run 'nix log /nix/store/jly4z1v62y7sa210g29nlr5nqmm7m0gs-python3.12-pyobjc-core-10.3.1.drv'.
Builds on the excellent work done by @ferrine in #336801 and completes the patch.
Changes from #336801:
darwin.libffi
build'unittestCheckHook
in place of deprecatedpython setup.py test
sw_vers
into testing instead of editing filesmeta
entriesThings done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a :+1: reaction to pull requests you find important.