profile
viewpoint

cjwatson/acceptable 0

API version negotiation for flask-based web services.

cjwatson/ampoule 0

Process pool for Twisted, using AMP

cjwatson/apt-mirror 0

Time-traveling apt mirror.

cjwatson/bson 0

Independent BSON codec for Python that doesn't depend on MongoDB.

cjwatson/build.snapcraft.io 0

The Snapcraft Build site.

cjwatson/chameleon 0

Fast HTML/XML template engine for Python

cjwatson/charm-hacluster 0

Juju Charm - HACluster

delete branch cjwatson/craft-providers

delete branch : weaken-instance-path-types

delete time in 5 days

push eventcjwatson/craft-providers

Sergio Schvezov

commit sha b5980e0a2f4b6d3b2e7a445f98ca8a439b50ff4c

python: unpin dependencies - Updated the GHA workflow to be similar to our other projects - The docs target is now separated into its own requirements for readthedocs - The documentation logic was updated to easily integrate with readthedocs Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>

view details

Sergio Schvezov

commit sha 0e4ad45c1e0299502f7ccaa17d818b8333ebc5e0

static: update list and dict literals Follow latest pylint recommendations for: - use-dict-literal - use-list-literal Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>

view details

Colin Watson

commit sha 11e96d3ace1e8d42680eee59032f6f6a1f05ba93

Declare instance paths as PurePath Paths that are only handled on the instance side can be declared as `pathlib.PurePath` rather than the stronger type `pathlib.Path`, since this Python process doesn't need to (and shouldn't) do any direct filesystem access using them.

view details

Sergio Schvezov

commit sha 1be2efff222ac4a3c28844e75b5c16524987d0d2

Merge pull request #82 from canonical/unpin-requirements python: unpin dependencies (CRAFT-664)

view details

Sergio Schvezov

commit sha 411cec5524e37efe0f2d2c9d784f95dcaaa34a44

Merge pull request #83 from cjwatson/weaken-instance-path-types Declare instance paths as PurePath

view details

push time in 5 days

PR opened canonical/craft-providers

Declare instance paths as PurePath

Paths that are only handled on the instance side can be declared as pathlib.PurePath rather than the stronger type pathlib.Path, since this Python process doesn't need to (and shouldn't) do any direct filesystem access using them.

+10 -8

0 comment

2 changed files

pr created time in 5 days

create barnchcjwatson/craft-providers

branch : weaken-instance-path-types

created branch time in 5 days

issue commentpre-commit/identify

License check is very slow

Confirmed - thanks a lot!

cjwatson

comment created time in 12 days

issue closedzopefoundation/zope.proxy

zope.proxy 4.5.0 broken on Python 2.7

What I did:

git clone https://git.launchpad.net/lazr.restful
cd lazr.restful
# ensure python2.7 is available on $PATH by whatever means you prefer (e.g. pyenv)
tox -r -e py27

What I expect to happen:

Tests pass; I've confirmed that they passed with zope.proxy 4.4.0.

What actually happened:

py27 run-test: commands[0] | zope-testrunner --test-path src --tests-pattern '^tests'
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.


Failure in test /home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst
Failed doctest test for checker-utilities.rst
  File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst", line 0

----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst", line 49, in checker-utilities.rst
Failed example:
    print(debug_proxy(ProxyFactory(content)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest checker-utilities.rst[9]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(content)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: __builtin__.MyContent
       - type: __builtin__.MyContent
    ForbiddenAttribute: ('_wrapped', <MyContent object at 0x7fd29997a290>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst", line 58, in checker-utilities.rst
Failed example:
    print(debug_proxy(ProxyFactory(content)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest checker-utilities.rst[12]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(content)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: __builtin__.MyContent
       - type: __builtin__.MyContent
    ForbiddenAttribute: ('_wrapped', <MyContent object at 0x7fd29997a290>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst", line 67, in checker-utilities.rst
Failed example:
    print(debug_proxy(ProxyFactory(content)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest checker-utilities.rst[15]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(content)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: __builtin__.MyContent
       - type: __builtin__.MyContent
    ForbiddenAttribute: ('_wrapped', <MyContent object at 0x7fd29997a290>)



Failure in test /home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst
Failed doctest test for debug.rst
  File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst", line 0

----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst", line 25, in debug.rst
Failed example:
    print(debug_proxy(ProxyBase(1)))
Differences (ndiff with -expected +actual):
    - zope.proxy.ProxyBase
    + zope.proxy.PyProxyBase
    ?             ++
    + <BLANKLINE>
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst", line 34, in debug.rst
Failed example:
    print(debug_proxy(SimpleProxy(ProxyBase(1))))
Differences (ndiff with -expected +actual):
      SimpleProxy
    - zope.proxy.ProxyBase
    + zope.proxy.PyProxyBase
    ?             ++
    + <BLANKLINE>
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst", line 48, in debug.rst
Failed example:
    print(debug_proxy(p))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest debug.rst[9]>", line 1, in <module>
        print(debug_proxy(p))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: __builtin__.int
       - type: __builtin__.int
    ForbiddenAttribute: ('_wrapped', 1)



Failure in test /home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst
Failed doctest test for webservice-declarations.rst
  File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 0

----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2740, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(entry_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[462]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(entry_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.BookEntry_betaAdapter
       - type: lazr.restful.declarations.BookEntry_betaAdapter
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.BookEntry_betaAdapter object at 0x7fd299866390>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2745, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(collection_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[463]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(collection_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.BookSetCollectionAdapter___Earliest
       - type: lazr.restful.declarations.BookSetCollectionAdapter___Earliest
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.BookSetCollectionAdapter___Earliest object at 0x7fd2999b9a90>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2749, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(read_method_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[464]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(read_method_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.GET_ICachedBookSet_getAllBooks_beta
       - type: lazr.restful.declarations.GET_ICachedBookSet_getAllBooks_beta
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.GET_ICachedBookSet_getAllBooks_beta object at 0x7fd29993dc50>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2753, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(write_method_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[465]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(write_method_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.POST_IBookOnSteroids_checkout_beta
       - type: lazr.restful.declarations.POST_IBookOnSteroids_checkout_beta
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.POST_IBookOnSteroids_checkout_beta object at 0x7fd29986d250>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2757, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(factory_method_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[466]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(factory_method_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.POST_IBookSetOnSteroids_create_book_beta
       - type: lazr.restful.declarations.POST_IBookSetOnSteroids_create_book_beta
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.POST_IBookSetOnSteroids_create_book_beta object at 0x7fd29986d490>)

  Ran 163 tests with 3 failures, 0 errors and 0 skipped in 4.562 seconds.

Of course it's possible that this is a bug in our code; but since zope.proxy 4.5.0 doesn't seem to have introduced any intentional changes other than metadata, and since it was only released today, it seems at least possible that the Python 2.7 wheel is broken in some way, so I thought I'd file this as soon as possible.

Tests for other Python versions work fine.

What version of Python and Zope/Addons I am using:

Ubuntu 20.04, Python 2.7.18 (for this particular test), zope.proxy 4.5.0, zope.interface 5.4.0, zope.security 5.1.1.

closed time in 13 days

cjwatson

issue commentzopefoundation/zope.proxy

zope.proxy 4.5.0 broken on Python 2.7

Hmm:

$ find ~/.cache/pip -name zope.proxy-4.5.0\*
/home/cjwatson/.cache/pip/wheels/6c/00/3f/060d3a6048a045cf45656aa2c5f75d4003973e09de2bd0276a/zope.proxy-4.5.0-cp35-cp35m-linux_x86_64.whl
/home/cjwatson/.cache/pip/wheels/47/87/1f/69d62e36963f1d20a1a7aa9381ae334b1868f0cb867da718ab/zope.proxy-4.5.0-cp27-cp27mu-linux_x86_64.whl

I deleted both of those and now things work, even though it's resulted in the same cached paths. So I guess either pip downloaded the faulty wheel you mention and called it something else, or I somehow ended up with a corrupted wheel on disk; but in any case this seems solved, so thanks for your hint.

cjwatson

comment created time in 13 days

issue commentzopefoundation/zope.proxy

lazr.restful tests fail on Python 2.7 with zope.proxy 4.5.0

Here's a reduced test case that exits with no output when using zope.proxy 4.4.0 on Python 2.7.18, but raises ForbiddenAttribute when using zope.proxy 4.5.0:

from zope.interface import Interface, implementer
from zope.proxy import ProxyIterator
from zope.security.checker import Checker, ProxyFactory, defineChecker


class MySchema(Interface):
    pass


@implementer(MySchema)
class MyContent(object):
    pass


defineChecker(MyContent, Checker({}, {}))
list(ProxyIterator(ProxyFactory(MyContent())))
cjwatson

comment created time in 14 days

issue openedzopefoundation/zope.proxy

lazr.restful tests fail on Python 2.7 with zope.proxy 4.5.0

What I did:

git clone https://git.launchpad.net/lazr.restful
cd lazr.restful
# ensure python2.7 is available on $PATH by whatever means you prefer (e.g. pyenv)
tox -r -e py27

What I expect to happen:

Tests pass; I've confirmed that they passed with zope.proxy 4.4.0.

What actually happened:

py27 run-test: commands[0] | zope-testrunner --test-path src --tests-pattern '^tests'
Running zope.testrunner.layer.UnitTests tests:
  Set up zope.testrunner.layer.UnitTests in 0.000 seconds.


Failure in test /home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst
Failed doctest test for checker-utilities.rst
  File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst", line 0

----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst", line 49, in checker-utilities.rst
Failed example:
    print(debug_proxy(ProxyFactory(content)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest checker-utilities.rst[9]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(content)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: __builtin__.MyContent
       - type: __builtin__.MyContent
    ForbiddenAttribute: ('_wrapped', <MyContent object at 0x7fd29997a290>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst", line 58, in checker-utilities.rst
Failed example:
    print(debug_proxy(ProxyFactory(content)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest checker-utilities.rst[12]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(content)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: __builtin__.MyContent
       - type: __builtin__.MyContent
    ForbiddenAttribute: ('_wrapped', <MyContent object at 0x7fd29997a290>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/checker-utilities.rst", line 67, in checker-utilities.rst
Failed example:
    print(debug_proxy(ProxyFactory(content)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest checker-utilities.rst[15]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(content)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: __builtin__.MyContent
       - type: __builtin__.MyContent
    ForbiddenAttribute: ('_wrapped', <MyContent object at 0x7fd29997a290>)



Failure in test /home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst
Failed doctest test for debug.rst
  File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst", line 0

----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst", line 25, in debug.rst
Failed example:
    print(debug_proxy(ProxyBase(1)))
Differences (ndiff with -expected +actual):
    - zope.proxy.ProxyBase
    + zope.proxy.PyProxyBase
    ?             ++
    + <BLANKLINE>
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst", line 34, in debug.rst
Failed example:
    print(debug_proxy(SimpleProxy(ProxyBase(1))))
Differences (ndiff with -expected +actual):
      SimpleProxy
    - zope.proxy.ProxyBase
    + zope.proxy.PyProxyBase
    ?             ++
    + <BLANKLINE>
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/debug.rst", line 48, in debug.rst
Failed example:
    print(debug_proxy(p))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest debug.rst[9]>", line 1, in <module>
        print(debug_proxy(p))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: __builtin__.int
       - type: __builtin__.int
    ForbiddenAttribute: ('_wrapped', 1)



Failure in test /home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst
Failed doctest test for webservice-declarations.rst
  File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 0

----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2740, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(entry_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[462]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(entry_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.BookEntry_betaAdapter
       - type: lazr.restful.declarations.BookEntry_betaAdapter
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.BookEntry_betaAdapter object at 0x7fd299866390>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2745, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(collection_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[463]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(collection_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.BookSetCollectionAdapter___Earliest
       - type: lazr.restful.declarations.BookSetCollectionAdapter___Earliest
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.BookSetCollectionAdapter___Earliest object at 0x7fd2999b9a90>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2749, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(read_method_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[464]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(read_method_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.GET_ICachedBookSet_getAllBooks_beta
       - type: lazr.restful.declarations.GET_ICachedBookSet_getAllBooks_beta
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.GET_ICachedBookSet_getAllBooks_beta object at 0x7fd29993dc50>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2753, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(write_method_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[465]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(write_method_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.POST_IBookOnSteroids_checkout_beta
       - type: lazr.restful.declarations.POST_IBookOnSteroids_checkout_beta
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.POST_IBookOnSteroids_checkout_beta object at 0x7fd29986d250>)
----------------------------------------------------------------------
File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/docs/webservice-declarations.rst", line 2757, in webservice-declarations.rst
Failed example:
    print(debug_proxy(ProxyFactory(factory_method_adapter)))
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/doctest.py", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest webservice-declarations.rst[466]>", line 1, in <module>
        print(debug_proxy(ProxyFactory(factory_method_adapter)))
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/lazr/restful/debug.py", line 73, in debug_proxy
        for proxy in zope.proxy.ProxyIterator(obj):
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 30, in ProxyIterator
        p = getProxiedObject(p)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/proxy/__init__.py", line 476, in py_getProxiedObject
        return obj._wrapped
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/proxy.py", line 153, in __getattr__
        checker.check_getattr(wrapped, name)
      File "/home/cjwatson/src/canonical/lazr.restful/lazr.restful/.tox/py27/lib/python2.7/site-packages/zope/security/checker.py", line 269, in check
        raise ForbiddenAttribute(name, object)
       - class: lazr.restful.declarations.POST_IBookSetOnSteroids_create_book_beta
       - type: lazr.restful.declarations.POST_IBookSetOnSteroids_create_book_beta
    ForbiddenAttribute: ('_wrapped', <lazr.restful.declarations.POST_IBookSetOnSteroids_create_book_beta object at 0x7fd29986d490>)

  Ran 163 tests with 3 failures, 0 errors and 0 skipped in 4.562 seconds.

Of course it's possible that this is a bug in our code; but since zope.proxy 4.5.0 doesn't seem to have introduced any intentional changes other than metadata, and since it was only released today, it seems at least possible that the Python 2.7 wheel is broken in some way, so I thought I'd file this as soon as possible.

Tests for other Python versions work fine.

What version of Python and Zope/Addons I am using:

Ubuntu 20.04, Python 2.7.18 (for this particular test), zope.proxy 4.5.0, zope.interface 5.4.0, zope.security 5.1.1.

created time in 14 days

push eventcjwatson/craft-cli

Colin Watson

commit sha 0d9f3b1ef3804b128bf4c9547e17ea5a54158174

Declare public API names `mypy --strict` enforces these by default.

view details

push time in 14 days

PR opened canonical/craft-cli

Declare public API names

mypy --strict enforces these by default.

I'm not sure whether Emitter should be public. It doesn't have an underscore, but it also isn't used by charmcraft - I guess it might be needed to implement test fixtures? I decided to err on the side of strictness and you can always open it up if you want.

  • [X] Have you signed the CLA? (Canonical employee, so not required.)

+10 -0

0 comment

2 changed files

pr created time in 14 days

create barnchcjwatson/craft-cli

branch : declare-public-api

created branch time in 14 days

issue commentpre-commit/identify

License check is very slow

Ah, in that case my apologies for misdiagnosing!

cjwatson

comment created time in 14 days

issue commentpre-commit/identify

License check is very slow

$ git clone https://git.launchpad.net/lpcraft
$ cd lpcraft
$ git checkout be42b4bca4de7a20dff462a9808c9001f2dc9a9f
$ time pre-commit run -a setup-cfg-fmt
setup-cfg-fmt............................................................Passed

real    0m11.336s
user    0m11.110s
sys     0m0.063s

Re editdistance, the problem seems to be not that editdistance is slow, but that all the license normalization run prior to calling editdistance is slow. (Though I only verified that by playing around a bit in pdb.)

cjwatson

comment created time in 14 days

issue openedpre-commit/identify

License check is very slow

setup-cfg-fmt takes about 11 seconds on my system, at least if it doesn't find any exact matches for the license text so has to scan all the way through the list. This makes it awkward to use as a fast lint check. Most of the time is spent in identify.identify.license_id, specifically in normalizing each of the vendored license texts in turn, before getting to the editdistance_s.distance call.

Is there anything that could be done to speed this up? One thing I thought of as a possibility would be to pre-normalize all the license texts in bin/vendor-licenses, though of course that would make the vendored list rather less readable; I don't know if you care about that.

created time in 14 days

pull request commentsamuelcolvin/pydantic

Fix "dataclasess" typos

please review

cjwatson

comment created time in 18 days

PR opened samuelcolvin/pydantic

Fix "dataclasess" typos

<!-- Thank you for your contribution! --> <!-- Unless your change is trivial, please create an issue to discuss the change before creating a PR --> <!-- See https://pydantic-docs.helpmanual.io/contributing/ for help on Contributing -->

Change Summary

Trivial typo fixes in docs.

Checklist

  • [ ] Unit tests for the changes exist
  • [ ] Tests pass on CI and coverage remains at 100%
  • [x] Documentation reflects the changes where applicable
  • [ ] changes/<pull request or issue id>-<github username>.md file added describing change (see changes/README.md for details)
  • [ ] My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers
+2 -2

0 comment

1 changed file

pr created time in 18 days

create barnchcjwatson/pydantic

branch : fix-typos

created branch time in 18 days

fork cjwatson/pydantic

Data parsing and validation using Python type hints

https://pydantic-docs.helpmanual.io/

fork in 18 days

issue openedtesting-cabal/testtools

Deprecate testtools.distutilscmd?

The entire setup.py test workflow is deprecated in favour of test runners such as tox. As a result, any project that imports testtools incurs warnings such as this with Python >= 3.10:

.tox/py310/lib/python3.10/site-packages/testtools/distutilscmd.py:7
  .../.tox/py310/lib/python3.10/site-packages/testtools/distutilscmd.py:7: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
    from distutils.core import Command

Should we deprecate testtools.distutilscmd and aim to remove it?

created time in 19 days

push eventtesting-cabal/testtools

Jürgen Gmach

commit sha ec9bb7ed026566688a14be9d8d5d1e4c506e71c0

Add support for Python 3.10

view details

Colin Watson

commit sha 3bcab148b5fc5491f83232874dd71234ccf94bd8

Merge pull request #315 from jugmac00/add-support-for-python3.10 Add support for Python 3.10

view details

push time in 19 days

PullRequestReviewEvent

issue commentPyCQA/flake8-bugbear

Proposed Check: variable used outside of for-loop scope

This would be great. One of my colleagues just found a bug in our codebase dating from 2010 that would have been caught by such a check.

jamesstidard

comment created time in 21 days

Pull request review commenttwisted/twisted

10273 use current_thread() instead of currentThread()

 class ThreadPool:     name = None      threadFactory = Thread-    currentThread = staticmethod(currentThread)+    current_thread = staticmethod(current_thread)

This looks like externally-visible API. Does this need to keep the old currentThread name around, perhaps with a Twisted deprecation notice?

altendky

comment created time in 23 days

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentget-woke/woke

Make pre-commit hook more self-contained

Thanks! I've proposed #155 as an alternative implementation which I think might match what you're looking for better (and also included documentation there).

cjwatson

comment created time in a month

more