Skip to content

Instantly share code, notes, and snippets.

@jaraco
jaraco / .py
Created October 21, 2020 16:25
import gc
import random
import contextlib
class Opener:
def __enter__(self):
return random.randint(1, 100)
def __exit__(self, *args):
tahoe-lafs 3399.mypy $ tox -e typechecks
typechecks installed: attrs==20.2.0,Automat==20.2.0,cffi==1.14.3,constantly==15.1.0,cryptography==3.1.1,foolscap @ git+https://github.com/jaraco/foolscap@ff3b9e8c1e4fa13701273a2143ba80b1e58f47cf,hyperlink==20.0.1,idna==2.10,incremental==17.5.0,mypy==0.782,mypy-extensions==0.4.3,mypy-zope @ git+https://github.com/jaraco/mypy-zope@4d75c8ed677f30cf05bc94755d64ec7c8f561e63,pyasn1==0.4.8,pyasn1-modules==0.2.8,pycparser==2.20,PyHamcrest==2.0.2,pyOpenSSL==19.1.0,service-identity==18.1.0,six==1.15.0,Twisted==20.3.0,typed-ast==1.4.1,typing-extensions==3.7.4.3,zope.event==4.5.0,zope.interface==5.1.2,zope.schema==6.0.0
typechecks run-test-pre: PYTHONHASHSEED='1876895777'
typechecks run-test: commands[0] | mypy src
src/allmydata/util/pollmixin.py:26: error: Need type annotation for '_poll_should_ignore_these_errors' (hint: "_poll_should_ignore_these_errors: List[<type>] = ...")
src/allmydata/test/test_python3.py:50: error: "Callable[[Python3PortingEffortTests], Any]" has no attrib
typechecks create: /Users/jaraco/code/public/tahoe-lafs/.tox/typechecks
typechecks installdeps: mypy, git+https://github.com/jaraco/mypy-zope@bugfix/21-InterfaceClass-subclass, git+https://github.com/jaraco/foolscap@bugfix/75-use-metaclass
typechecks installed: attrs==20.2.0,Automat==20.2.0,cffi==1.14.3,constantly==15.1.0,cryptography==3.2.1,foolscap @ git+https://github.com/jaraco/foolscap@d70d8ecee926d3693b9fac55aebe13573d4f71c9,hyperlink==20.0.1,idna==2.10,incremental==17.5.0,mypy==0.790,mypy-extensions==0.4.3,mypy-zope @ git+https://github.com/jaraco/mypy-zope@48f912cc3cdb4ee37d4d3783ef466a7dce8bf0a9,pyasn1==0.4.8,pyasn1-modules==0.2.8,pycparser==2.20,PyHamcrest==2.0.2,pyOpenSSL==19.1.0,service-identity==18.1.0,six==1.15.0,Twisted==20.3.0,typed-ast==1.4.1,typing-extensions==3.7.4.3,zope.event==4.5.0,zope.interface==5.1.2,zope.schema==6.0.0
typechecks run-test-pre: PYTHONHASHSEED='1725564413'
typechecks run-test: commands[0] | mypy src
src/allmydata/util/pollmixin.py:26: error: Need type annotation for '_p
~ $ python
Python 3.9.0 (v3.9.0:9cf6752276, Oct 5 2020, 11:29:23)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib.request
>>> import zipfile
>>> import io
>>> import importlib.metadata
>>> url = 'https://files.pythonhosted.org/packages/2d/c6/59aa4188e7eddb9e89ec67a51598ca6bfc09f1b38c9b45f7ee45af7a4df4/httpx-0.16.1-py3-none-any.whl'
>>> stream = urllib.request.urlopen(url)
Using random seed 735017
0:00:00 load avg: 2.17 Run tests in parallel using 10 child processes
0:00:02 load avg: 2.16 [1/1/1] test.test_importlib failed
test_join_path
Warning -- sys.path was modified by test.test_importlib
Before: (4326187200, ['/Users/jaraco/code/public/cpython', '/usr/local/lib/python310.zip', '/Users/jaraco/code/public/cpython/Lib', '/Users/jaraco/code/public/cpython/build/lib.macosx-11.1-x86_64-3.10'], ['/Users/jaraco/code/public/cpython', '/usr/local/lib/python310.zip', '/Users/jaraco/code/public/cpython/Lib', '/Users/jaraco/code/public/cpython/build/lib.macosx-11.1-x86_64-3.10'])
After: (4326187200, ['/Users/jaraco/code/public/cpython', '/usr/local/lib/python310.zip', '/Users/jaraco/code/public/cpython/Lib', '/Users/jaraco/code/public/cpython/build/lib.macosx-11.1-x86_64-3.10'], ['/Users/jaraco/code/public/cpython', '/usr/local/lib/python310.zip', '/Users/jaraco/code/public/cpython/Lib', '/Users/jaraco/code/public/cpython/build/lib.macosx-11.1-x86_64-3.10', '/Users/jaraco/code/pub
foolscap master $ pyproject-build
Collecting wheel
Using cached wheel-0.36.2-py2.py3-none-any.whl (35 kB)
Collecting setuptools>=40.8.0
Using cached setuptools-51.1.2-py3-none-any.whl (784 kB)
Installing collected packages: wheel, setuptools
Successfully installed setuptools-51.1.2 wheel-0.36.2
running sdist
running egg_info
writing src/foolscap.egg-info/PKG-INFO
draft $ pip-run --use-pep517 sqlalchemy@git+https://github.com/sqlalchemy/sqlalchemy.git@master 'sqlalchemy[postgresql]' -- -c pass
Collecting sqlalchemy@ git+https://github.com/sqlalchemy/sqlalchemy.git@master
Cloning https://github.com/sqlalchemy/sqlalchemy.git (to revision master) to /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-43td_xz5/sqlalchemy_fbdc1e8c7e9a43bdbeee65cd0bcf4735
Running command git clone -q https://github.com/sqlalchemy/sqlalchemy.git /private/var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/pip-install-43td_xz5/sqlalchemy_fbdc1e8c7e9a43bdbeee65cd0bcf4735
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Collecting sqlalchemy[postgresql]
Using cached SQLAlchemy-1.3.22-cp39-cp39-macosx_10_14_x86_64.whl (1.2 MB)
Collecting greenlet!=0.4.17
$ docker run jaraco/multipy-tox pip-run -q jaraco.docker -- -c "import jaraco.docker; print(jaraco.docker.is_docker())"
True
$ pip-run -q jaraco.docker -- -c "import jaraco.docker; print(jaraco.docker.is_docker())"
False
these paths will be fetched (45.42 MiB download, 200.97 MiB unpacked):
/nix/store/1fpxk7nq33jyxv5psgv7fcya0zk1dh02-setuptools-setup-hook
/nix/store/25qhsb4lx6h9qxd2zs5y0vzqvqmj3njm-bash-interactive-4.4-p23-info
/nix/store/55hb783qfks5n51x65bhckzy3xj1v6n1-python-namespaces-hook.sh
/nix/store/6h64pgvdlv9xii0i9cxr2k7rz7clz4pc-python3.8-peppercorn-0.6
/nix/store/6mic0pcmp4va0ghx7hn5wl3jl4ll4h2q-gnumake-4.3
/nix/store/6wzkn6gdpj3psqjgbfx858wd3dhanj12-diffutils-3.7
/nix/store/7d2w3lafm8cla7n6ii5jskhsnqg4zv3a-stdenv-linux
/nix/store/7w60y5y9vq1lvxndn1mvzwswijjbp9q6-python-catch-conflicts-hook
/nix/store/83zz05y2rh15y108ydkcmz3pl7bddccz-bash-interactive-4.4-p23-doc
cpython bpo-44461-refactor-targets $ git diff
diff --git a/Lib/pdb.py b/Lib/pdb.py
index b1f0c7fab0..ca0bbbbd8f 100755
--- a/Lib/pdb.py
+++ b/Lib/pdb.py
@@ -1566,6 +1566,7 @@ def lookupmodule(self, filename):
@functools.singledispatchmethod
def _run(self, target: 'ModuleTarget'):
+ raise ValueError('module!')