-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect PURE_PYTHON
environment variable set to 0
#115
Conversation
oh tests are failing, I set to draft |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checker module contains a docstring specifying that the value of the PURE_PYTHON
envvar is not relevant. It should get changed to be in line with this modification.
Thank you, I have changed this.
actually it was OK, I opened the same pull request for another package, but tests here seems to be OK |
... sorry . No, the tests also fail here. It seems there is a circular dependency between zopefoundation/zope.proxy#71 and this one, or something I don't understand yet. |
Jérome Perrin wrote at 2024-9-30 00:04 -0700:
... sorry . No, the tests also fail here. It seems there is a circular dependency between zopefoundation/zope.proxy#71 and this one, or something I don't understand yet.
I think the test is wrong:
it import `_Proxy` (which is the C implementation) but apparently,
it is not available.
Instead, the test should import "Proxy", which is
the C implementation if available otherwise the Python implementation.
|
If we do this, we may want to add an additional test: if |
I understood the problem with the test, it's because the changes from this pull request depend on zopefoundation/zope.proxy#71 - there's a circular dependency between these two pull requests. The solution seems to be to merge both and release both packages. Also, the test importing The long story about the analysis of the test errors The test code is here: zope.security/src/zope/security/tests/test_proxy.py Lines 1284 to 1291 in e93ff5f
This test is not skipped because
zope.security/src/zope/security/proxy.py Lines 352 to 357 in 66d0c3d
The module import happens in C here: zope.security/src/zope/security/_proxy.c Lines 860 to 861 in 66d0c3d
zope.security/include/zope.proxy/zope/proxy/proxy.h Lines 27 to 43 in 869deee
In plain python, this would be And in and once |
In short, what we can do is merge #115 and zopefoundation/zope.proxy#71 although test fail for both pull requests, once boths are merged and released, the test should pass again. |
zope.proxy depends on zope.security for tests, tests relying on PURE_PYTHON=0 need zope.security to also support it. See zopefoundation/zope.security#115
zope.proxy depends on zope.security for tests, tests relying on PURE_PYTHON=0 need zope.security to also support it. See zopefoundation/zope.security#115
I pushed a tox.ini change to use zope.proxy from zopefoundation/zope.proxy#71 , this change is not planned to be merged, it's just to be sure that tests will be OK with this change. |
2da1909
to
afc6ee6
Compare
I cannot merge this one either because of the test status, but I believe it is in a state where it can be merged. |
Jérome Perrin wrote at 2024-10-2 05:44 -0700:
@perrinjerome commented on this pull request.
> @@ -24,10 +24,10 @@
(:func:`getCheckerForInstancesOf`, :func:`selectChecker`).
This module is accelerated with a C implementation on CPython by
-default. If the environment variable ``PURE_PYTHON`` is set (to any
-value) before this module is imported, the C extensions will be
-bypassed and the reference Python implementations will be used. This
-can be helpful for debugging and tracing.
+default. If the environment variable ``PURE_PYTHON`` is set to ``1``
I don't like to leave it like that, but I could not find better words
...environment variable ``PURE_PYTHON`` (converted to ``int``) has
a nonzero value ...
|
Thank you, I did not notice your message before this was merged. I made a PR with your suggestion #116 |
Setting to 0 should be equivalent to not setting the variable.
Refs zopefoundation/meta#283