I: pbuilder: network access will be disabled during build I: Current time: Wed Apr 17 14:41:16 +14 2024 I: pbuilder-time-stamp: 1713314476 I: Building the build Environment I: extracting base tarball [/var/cache/pbuilder/trixie-reproducible-base.tgz] I: copying local configuration W: --override-config is not set; not updating apt.conf Read the manpage for details. I: mounting /proc filesystem I: mounting /sys filesystem I: creating /{dev,run}/shm I: mounting /dev/pts filesystem I: redirecting /dev/ptmx to /dev/pts/ptmx I: policy-rc.d already exists I: using eatmydata during job I: Copying source file I: copying [python-beniget_0.4.1-3.dsc] I: copying [./python-beniget_0.4.1.orig.tar.gz] I: copying [./python-beniget_0.4.1-3.debian.tar.xz] I: Extracting source gpgv: Signature made Sat Dec 3 21:12:27 2022 gpgv: using EDDSA key CAA7400707A816B0202FC3CDF4257A50B21CFA85 gpgv: Can't check signature: No public key dpkg-source: warning: cannot verify inline signature for ./python-beniget_0.4.1-3.dsc: no acceptable signature found dpkg-source: info: extracting python-beniget in python-beniget-0.4.1 dpkg-source: info: unpacking python-beniget_0.4.1.orig.tar.gz dpkg-source: info: unpacking python-beniget_0.4.1-3.debian.tar.xz I: Not using root during the build. I: Installing the build-deps I: user script /srv/workspace/pbuilder/6182/tmp/hooks/D01_modify_environment starting debug: Running on ionos12-i386. I: Changing host+domainname to test build reproducibility I: Adding a custom variable just for the fun of it... I: Changing /bin/sh to bash '/bin/sh' -> '/bin/bash' lrwxrwxrwx 1 root root 9 Apr 17 00:41 /bin/sh -> /bin/bash I: Setting pbuilder2's login shell to /bin/bash I: Setting pbuilder2's GECOS to second user,second room,second work-phone,second home-phone,second other I: user script /srv/workspace/pbuilder/6182/tmp/hooks/D01_modify_environment finished I: user script /srv/workspace/pbuilder/6182/tmp/hooks/D02_print_environment starting I: set BASH=/bin/sh BASHOPTS=checkwinsize:cmdhist:complete_fullquote:extquote:force_fignore:globasciiranges:globskipdots:hostcomplete:interactive_comments:patsub_replacement:progcomp:promptvars:sourcepath BASH_ALIASES=() BASH_ARGC=() BASH_ARGV=() BASH_CMDS=() BASH_LINENO=([0]="12" [1]="0") BASH_LOADABLES_PATH=/usr/local/lib/bash:/usr/lib/bash:/opt/local/lib/bash:/usr/pkg/lib/bash:/opt/pkg/lib/bash:. BASH_SOURCE=([0]="/tmp/hooks/D02_print_environment" [1]="/tmp/hooks/D02_print_environment") BASH_VERSINFO=([0]="5" [1]="2" [2]="21" [3]="1" [4]="release" [5]="i686-pc-linux-gnu") BASH_VERSION='5.2.21(1)-release' BUILDDIR=/build/reproducible-path BUILDUSERGECOS='second user,second room,second work-phone,second home-phone,second other' BUILDUSERNAME=pbuilder2 BUILD_ARCH=i386 DEBIAN_FRONTEND=noninteractive DEB_BUILD_OPTIONS='buildinfo=+all reproducible=+all parallel=10 ' DIRSTACK=() DISTRIBUTION=trixie EUID=0 FUNCNAME=([0]="Echo" [1]="main") GROUPS=() HOME=/root HOSTNAME=i-capture-the-hostname HOSTTYPE=i686 HOST_ARCH=i386 IFS=' ' INVOCATION_ID=dc3cd64609d14bb4a9a49fab953fbc8b LANG=C LANGUAGE=de_CH:de LC_ALL=C LD_LIBRARY_PATH=/usr/lib/libeatmydata LD_PRELOAD=libeatmydata.so MACHTYPE=i686-pc-linux-gnu MAIL=/var/mail/root OPTERR=1 OPTIND=1 OSTYPE=linux-gnu PATH=/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path PBCURRENTCOMMANDLINEOPERATION=build PBUILDER_OPERATION=build PBUILDER_PKGDATADIR=/usr/share/pbuilder PBUILDER_PKGLIBDIR=/usr/lib/pbuilder PBUILDER_SYSCONFDIR=/etc PIPESTATUS=([0]="0") POSIXLY_CORRECT=y PPID=6182 PS4='+ ' PWD=/ SHELL=/bin/bash SHELLOPTS=braceexpand:errexit:hashall:interactive-comments:posix SHLVL=3 SUDO_COMMAND='/usr/bin/timeout -k 24.1h 24h /usr/bin/ionice -c 3 /usr/bin/nice -n 11 /usr/bin/unshare --uts -- /usr/sbin/pbuilder --build --configfile /srv/reproducible-results/rbuild-debian/r-b-build.GYZ8StLs/pbuilderrc_y0do --distribution trixie --hookdir /etc/pbuilder/rebuild-hooks --debbuildopts -b --basetgz /var/cache/pbuilder/trixie-reproducible-base.tgz --buildresult /srv/reproducible-results/rbuild-debian/r-b-build.GYZ8StLs/b2 --logfile b2/build.log python-beniget_0.4.1-3.dsc' SUDO_GID=112 SUDO_UID=107 SUDO_USER=jenkins TERM=unknown TZ=/usr/share/zoneinfo/Etc/GMT-14 UID=0 USER=root _='I: set' http_proxy=http://78.137.99.97:3128 I: uname -a Linux i-capture-the-hostname 6.1.0-20-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.85-1 (2024-04-11) x86_64 GNU/Linux I: ls -l /bin lrwxrwxrwx 1 root root 7 Apr 16 11:24 /bin -> usr/bin I: user script /srv/workspace/pbuilder/6182/tmp/hooks/D02_print_environment finished -> Attempting to satisfy build-dependencies -> Creating pbuilder-satisfydepends-dummy package Package: pbuilder-satisfydepends-dummy Version: 0.invalid.0 Architecture: i386 Maintainer: Debian Pbuilder Team Description: Dummy package to satisfy dependencies with aptitude - created by pbuilder This package was created automatically by pbuilder to satisfy the build-dependencies of the package being currently built. Depends: debhelper-compat (= 13), dh-python, python3-all, python3-gast, python3-setuptools dpkg-deb: building package 'pbuilder-satisfydepends-dummy' in '/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'. Selecting previously unselected package pbuilder-satisfydepends-dummy. (Reading database ... 19874 files and directories currently installed.) Preparing to unpack .../pbuilder-satisfydepends-dummy.deb ... Unpacking pbuilder-satisfydepends-dummy (0.invalid.0) ... dpkg: pbuilder-satisfydepends-dummy: dependency problems, but configuring anyway as you requested: pbuilder-satisfydepends-dummy depends on debhelper-compat (= 13); however: Package debhelper-compat is not installed. pbuilder-satisfydepends-dummy depends on dh-python; however: Package dh-python is not installed. pbuilder-satisfydepends-dummy depends on python3-all; however: Package python3-all is not installed. pbuilder-satisfydepends-dummy depends on python3-gast; however: Package python3-gast is not installed. pbuilder-satisfydepends-dummy depends on python3-setuptools; however: Package python3-setuptools is not installed. Setting up pbuilder-satisfydepends-dummy (0.invalid.0) ... Reading package lists... Building dependency tree... Reading state information... Initializing package states... Writing extended state information... Building tag database... pbuilder-satisfydepends-dummy is already installed at the requested version (0.invalid.0) pbuilder-satisfydepends-dummy is already installed at the requested version (0.invalid.0) The following NEW packages will be installed: autoconf{a} automake{a} autopoint{a} autotools-dev{a} bsdextrautils{a} debhelper{a} dh-autoreconf{a} dh-python{a} dh-strip-nondeterminism{a} dwz{a} file{a} gettext{a} gettext-base{a} groff-base{a} intltool-debian{a} libarchive-zip-perl{a} libdebhelper-perl{a} libelf1{a} libexpat1{a} libfile-stripnondeterminism-perl{a} libicu72{a} libmagic-mgc{a} libmagic1{a} libpipeline1{a} libpython3-stdlib{a} libpython3.11-minimal{a} libpython3.11-stdlib{a} libpython3.12-minimal{a} libpython3.12-stdlib{a} libreadline8{a} libsub-override-perl{a} libtool{a} libuchardet0{a} libxml2{a} m4{a} man-db{a} media-types{a} netbase{a} po-debconf{a} python3{a} python3-all{a} python3-distutils{a} python3-gast{a} python3-lib2to3{a} python3-minimal{a} python3-pkg-resources{a} python3-setuptools{a} python3.11{a} python3.11-minimal{a} python3.12{a} python3.12-minimal{a} readline-common{a} sensible-utils{a} tzdata{a} The following packages are RECOMMENDED but will NOT be installed: ca-certificates curl libarchive-cpio-perl libltdl-dev libmail-sendmail-perl lynx wget 0 packages upgraded, 54 newly installed, 0 to remove and 0 not upgraded. Need to get 32.0 MB of archives. After unpacking 125 MB will be used. Writing extended state information... Get: 1 http://deb.debian.org/debian trixie/main i386 libpython3.11-minimal i386 3.11.8-1 [817 kB] Get: 2 http://deb.debian.org/debian trixie/main i386 libexpat1 i386 2.5.0-2+b2 [104 kB] Get: 3 http://deb.debian.org/debian trixie/main i386 python3.11-minimal i386 3.11.8-1 [2087 kB] Get: 4 http://deb.debian.org/debian trixie/main i386 python3-minimal i386 3.11.6-1 [26.2 kB] Get: 5 http://deb.debian.org/debian trixie/main i386 media-types all 10.1.0 [26.9 kB] Get: 6 http://deb.debian.org/debian trixie/main i386 netbase all 6.4 [12.8 kB] Get: 7 http://deb.debian.org/debian trixie/main i386 tzdata all 2024a-1 [255 kB] Get: 8 http://deb.debian.org/debian trixie/main i386 readline-common all 8.2-3 [69.1 kB] Get: 9 http://deb.debian.org/debian trixie/main i386 libreadline8 i386 8.2-3+b1 [171 kB] Get: 10 http://deb.debian.org/debian trixie/main i386 libpython3.11-stdlib i386 3.11.8-1 [1821 kB] Get: 11 http://deb.debian.org/debian trixie/main i386 python3.11 i386 3.11.8-1 [597 kB] Get: 12 http://deb.debian.org/debian trixie/main i386 libpython3-stdlib i386 3.11.6-1 [9224 B] Get: 13 http://deb.debian.org/debian trixie/main i386 python3 i386 3.11.6-1 [26.2 kB] Get: 14 http://deb.debian.org/debian trixie/main i386 libpython3.12-minimal i386 3.12.2-1 [807 kB] Get: 15 http://deb.debian.org/debian trixie/main i386 python3.12-minimal i386 3.12.2-1 [2244 kB] Get: 16 http://deb.debian.org/debian trixie/main i386 sensible-utils all 0.0.22 [22.4 kB] Get: 17 http://deb.debian.org/debian trixie/main i386 libmagic-mgc i386 1:5.45-2+b1 [314 kB] Get: 18 http://deb.debian.org/debian trixie/main i386 libmagic1 i386 1:5.45-2+b1 [114 kB] Get: 19 http://deb.debian.org/debian trixie/main i386 file i386 1:5.45-2+b1 [43.0 kB] Get: 20 http://deb.debian.org/debian trixie/main i386 gettext-base i386 0.21-14+b1 [162 kB] Get: 21 http://deb.debian.org/debian trixie/main i386 libuchardet0 i386 0.0.8-1+b1 [69.1 kB] Get: 22 http://deb.debian.org/debian trixie/main i386 groff-base i386 1.23.0-3 [1195 kB] Get: 23 http://deb.debian.org/debian trixie/main i386 bsdextrautils i386 2.39.3-6 [93.3 kB] Get: 24 http://deb.debian.org/debian trixie/main i386 libpipeline1 i386 1.5.7-2 [39.7 kB] Get: 25 http://deb.debian.org/debian trixie/main i386 man-db i386 2.12.0-3 [1413 kB] Get: 26 http://deb.debian.org/debian trixie/main i386 m4 i386 1.4.19-4 [293 kB] Get: 27 http://deb.debian.org/debian trixie/main i386 autoconf all 2.71-3 [332 kB] Get: 28 http://deb.debian.org/debian trixie/main i386 autotools-dev all 20220109.1 [51.6 kB] Get: 29 http://deb.debian.org/debian trixie/main i386 automake all 1:1.16.5-1.3 [823 kB] Get: 30 http://deb.debian.org/debian trixie/main i386 autopoint all 0.21-14 [496 kB] Get: 31 http://deb.debian.org/debian trixie/main i386 libdebhelper-perl all 13.15.3 [88.0 kB] Get: 32 http://deb.debian.org/debian trixie/main i386 libtool all 2.4.7-7 [517 kB] Get: 33 http://deb.debian.org/debian trixie/main i386 dh-autoreconf all 20 [17.1 kB] Get: 34 http://deb.debian.org/debian trixie/main i386 libarchive-zip-perl all 1.68-1 [104 kB] Get: 35 http://deb.debian.org/debian trixie/main i386 libsub-override-perl all 0.10-1 [10.6 kB] Get: 36 http://deb.debian.org/debian trixie/main i386 libfile-stripnondeterminism-perl all 1.13.1-1 [19.4 kB] Get: 37 http://deb.debian.org/debian trixie/main i386 dh-strip-nondeterminism all 1.13.1-1 [8620 B] Get: 38 http://deb.debian.org/debian trixie/main i386 libelf1 i386 0.190-1+b1 [182 kB] Get: 39 http://deb.debian.org/debian trixie/main i386 dwz i386 0.15-1 [118 kB] Get: 40 http://deb.debian.org/debian trixie/main i386 libicu72 i386 72.1-4+b1 [9549 kB] Get: 41 http://deb.debian.org/debian trixie/main i386 libxml2 i386 2.9.14+dfsg-1.3+b2 [727 kB] Get: 42 http://deb.debian.org/debian trixie/main i386 gettext i386 0.21-14+b1 [1311 kB] Get: 43 http://deb.debian.org/debian trixie/main i386 intltool-debian all 0.35.0+20060710.6 [22.9 kB] Get: 44 http://deb.debian.org/debian trixie/main i386 po-debconf all 1.0.21+nmu1 [248 kB] Get: 45 http://deb.debian.org/debian trixie/main i386 debhelper all 13.15.3 [901 kB] Get: 46 http://deb.debian.org/debian trixie/main i386 python3-pkg-resources all 68.1.2-2 [241 kB] Get: 47 http://deb.debian.org/debian trixie/main i386 python3-lib2to3 all 3.11.5-1 [77.5 kB] Get: 48 http://deb.debian.org/debian trixie/main i386 python3-distutils all 3.11.5-1 [131 kB] Get: 49 http://deb.debian.org/debian trixie/main i386 python3-setuptools all 68.1.2-2 [468 kB] Get: 50 http://deb.debian.org/debian trixie/main i386 dh-python all 6.20240401 [107 kB] Get: 51 http://deb.debian.org/debian trixie/main i386 libpython3.12-stdlib i386 3.12.2-1 [1927 kB] Get: 52 http://deb.debian.org/debian trixie/main i386 python3.12 i386 3.12.2-1 [653 kB] Get: 53 http://deb.debian.org/debian trixie/main i386 python3-all i386 3.11.6-1 [1060 B] Get: 54 http://deb.debian.org/debian trixie/main i386 python3-gast all 0.5.2-2 [9364 B] Fetched 32.0 MB in 3s (10.1 MB/s) debconf: delaying package configuration, since apt-utils is not installed Selecting previously unselected package libpython3.11-minimal:i386. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19874 files and directories currently installed.) Preparing to unpack .../libpython3.11-minimal_3.11.8-1_i386.deb ... Unpacking libpython3.11-minimal:i386 (3.11.8-1) ... Selecting previously unselected package libexpat1:i386. Preparing to unpack .../libexpat1_2.5.0-2+b2_i386.deb ... Unpacking libexpat1:i386 (2.5.0-2+b2) ... Selecting previously unselected package python3.11-minimal. Preparing to unpack .../python3.11-minimal_3.11.8-1_i386.deb ... Unpacking python3.11-minimal (3.11.8-1) ... Setting up libpython3.11-minimal:i386 (3.11.8-1) ... Setting up libexpat1:i386 (2.5.0-2+b2) ... Setting up python3.11-minimal (3.11.8-1) ... Selecting previously unselected package python3-minimal. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 20191 files and directories currently installed.) Preparing to unpack .../0-python3-minimal_3.11.6-1_i386.deb ... Unpacking python3-minimal (3.11.6-1) ... Selecting previously unselected package media-types. Preparing to unpack .../1-media-types_10.1.0_all.deb ... Unpacking media-types (10.1.0) ... Selecting previously unselected package netbase. Preparing to unpack .../2-netbase_6.4_all.deb ... Unpacking netbase (6.4) ... Selecting previously unselected package tzdata. Preparing to unpack .../3-tzdata_2024a-1_all.deb ... Unpacking tzdata (2024a-1) ... Selecting previously unselected package readline-common. Preparing to unpack .../4-readline-common_8.2-3_all.deb ... Unpacking readline-common (8.2-3) ... Selecting previously unselected package libreadline8:i386. Preparing to unpack .../5-libreadline8_8.2-3+b1_i386.deb ... Unpacking libreadline8:i386 (8.2-3+b1) ... Selecting previously unselected package libpython3.11-stdlib:i386. Preparing to unpack .../6-libpython3.11-stdlib_3.11.8-1_i386.deb ... Unpacking libpython3.11-stdlib:i386 (3.11.8-1) ... Selecting previously unselected package python3.11. Preparing to unpack .../7-python3.11_3.11.8-1_i386.deb ... Unpacking python3.11 (3.11.8-1) ... Selecting previously unselected package libpython3-stdlib:i386. Preparing to unpack .../8-libpython3-stdlib_3.11.6-1_i386.deb ... Unpacking libpython3-stdlib:i386 (3.11.6-1) ... Setting up python3-minimal (3.11.6-1) ... Selecting previously unselected package python3. (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 21179 files and directories currently installed.) Preparing to unpack .../00-python3_3.11.6-1_i386.deb ... Unpacking python3 (3.11.6-1) ... Selecting previously unselected package libpython3.12-minimal:i386. Preparing to unpack .../01-libpython3.12-minimal_3.12.2-1_i386.deb ... Unpacking libpython3.12-minimal:i386 (3.12.2-1) ... Selecting previously unselected package python3.12-minimal. Preparing to unpack .../02-python3.12-minimal_3.12.2-1_i386.deb ... Unpacking python3.12-minimal (3.12.2-1) ... Selecting previously unselected package sensible-utils. Preparing to unpack .../03-sensible-utils_0.0.22_all.deb ... Unpacking sensible-utils (0.0.22) ... Selecting previously unselected package libmagic-mgc. Preparing to unpack .../04-libmagic-mgc_1%3a5.45-2+b1_i386.deb ... Unpacking libmagic-mgc (1:5.45-2+b1) ... Selecting previously unselected package libmagic1:i386. Preparing to unpack .../05-libmagic1_1%3a5.45-2+b1_i386.deb ... Unpacking libmagic1:i386 (1:5.45-2+b1) ... Selecting previously unselected package file. Preparing to unpack .../06-file_1%3a5.45-2+b1_i386.deb ... Unpacking file (1:5.45-2+b1) ... Selecting previously unselected package gettext-base. Preparing to unpack .../07-gettext-base_0.21-14+b1_i386.deb ... Unpacking gettext-base (0.21-14+b1) ... Selecting previously unselected package libuchardet0:i386. Preparing to unpack .../08-libuchardet0_0.0.8-1+b1_i386.deb ... Unpacking libuchardet0:i386 (0.0.8-1+b1) ... Selecting previously unselected package groff-base. Preparing to unpack .../09-groff-base_1.23.0-3_i386.deb ... Unpacking groff-base (1.23.0-3) ... Selecting previously unselected package bsdextrautils. Preparing to unpack .../10-bsdextrautils_2.39.3-6_i386.deb ... Unpacking bsdextrautils (2.39.3-6) ... Selecting previously unselected package libpipeline1:i386. Preparing to unpack .../11-libpipeline1_1.5.7-2_i386.deb ... Unpacking libpipeline1:i386 (1.5.7-2) ... Selecting previously unselected package man-db. Preparing to unpack .../12-man-db_2.12.0-3_i386.deb ... Unpacking man-db (2.12.0-3) ... Selecting previously unselected package m4. Preparing to unpack .../13-m4_1.4.19-4_i386.deb ... Unpacking m4 (1.4.19-4) ... Selecting previously unselected package autoconf. Preparing to unpack .../14-autoconf_2.71-3_all.deb ... Unpacking autoconf (2.71-3) ... Selecting previously unselected package autotools-dev. Preparing to unpack .../15-autotools-dev_20220109.1_all.deb ... Unpacking autotools-dev (20220109.1) ... Selecting previously unselected package automake. Preparing to unpack .../16-automake_1%3a1.16.5-1.3_all.deb ... Unpacking automake (1:1.16.5-1.3) ... Selecting previously unselected package autopoint. Preparing to unpack .../17-autopoint_0.21-14_all.deb ... Unpacking autopoint (0.21-14) ... Selecting previously unselected package libdebhelper-perl. Preparing to unpack .../18-libdebhelper-perl_13.15.3_all.deb ... Unpacking libdebhelper-perl (13.15.3) ... Selecting previously unselected package libtool. Preparing to unpack .../19-libtool_2.4.7-7_all.deb ... Unpacking libtool (2.4.7-7) ... Selecting previously unselected package dh-autoreconf. Preparing to unpack .../20-dh-autoreconf_20_all.deb ... Unpacking dh-autoreconf (20) ... Selecting previously unselected package libarchive-zip-perl. Preparing to unpack .../21-libarchive-zip-perl_1.68-1_all.deb ... Unpacking libarchive-zip-perl (1.68-1) ... Selecting previously unselected package libsub-override-perl. Preparing to unpack .../22-libsub-override-perl_0.10-1_all.deb ... Unpacking libsub-override-perl (0.10-1) ... Selecting previously unselected package libfile-stripnondeterminism-perl. Preparing to unpack .../23-libfile-stripnondeterminism-perl_1.13.1-1_all.deb ... Unpacking libfile-stripnondeterminism-perl (1.13.1-1) ... Selecting previously unselected package dh-strip-nondeterminism. Preparing to unpack .../24-dh-strip-nondeterminism_1.13.1-1_all.deb ... Unpacking dh-strip-nondeterminism (1.13.1-1) ... Selecting previously unselected package libelf1:i386. Preparing to unpack .../25-libelf1_0.190-1+b1_i386.deb ... Unpacking libelf1:i386 (0.190-1+b1) ... Selecting previously unselected package dwz. Preparing to unpack .../26-dwz_0.15-1_i386.deb ... Unpacking dwz (0.15-1) ... Selecting previously unselected package libicu72:i386. Preparing to unpack .../27-libicu72_72.1-4+b1_i386.deb ... Unpacking libicu72:i386 (72.1-4+b1) ... Selecting previously unselected package libxml2:i386. Preparing to unpack .../28-libxml2_2.9.14+dfsg-1.3+b2_i386.deb ... Unpacking libxml2:i386 (2.9.14+dfsg-1.3+b2) ... Selecting previously unselected package gettext. Preparing to unpack .../29-gettext_0.21-14+b1_i386.deb ... Unpacking gettext (0.21-14+b1) ... Selecting previously unselected package intltool-debian. Preparing to unpack .../30-intltool-debian_0.35.0+20060710.6_all.deb ... Unpacking intltool-debian (0.35.0+20060710.6) ... Selecting previously unselected package po-debconf. Preparing to unpack .../31-po-debconf_1.0.21+nmu1_all.deb ... Unpacking po-debconf (1.0.21+nmu1) ... Selecting previously unselected package debhelper. Preparing to unpack .../32-debhelper_13.15.3_all.deb ... Unpacking debhelper (13.15.3) ... Selecting previously unselected package python3-pkg-resources. Preparing to unpack .../33-python3-pkg-resources_68.1.2-2_all.deb ... Unpacking python3-pkg-resources (68.1.2-2) ... Selecting previously unselected package python3-lib2to3. Preparing to unpack .../34-python3-lib2to3_3.11.5-1_all.deb ... Unpacking python3-lib2to3 (3.11.5-1) ... Selecting previously unselected package python3-distutils. Preparing to unpack .../35-python3-distutils_3.11.5-1_all.deb ... Unpacking python3-distutils (3.11.5-1) ... Selecting previously unselected package python3-setuptools. Preparing to unpack .../36-python3-setuptools_68.1.2-2_all.deb ... Unpacking python3-setuptools (68.1.2-2) ... Selecting previously unselected package dh-python. Preparing to unpack .../37-dh-python_6.20240401_all.deb ... Unpacking dh-python (6.20240401) ... Selecting previously unselected package libpython3.12-stdlib:i386. Preparing to unpack .../38-libpython3.12-stdlib_3.12.2-1_i386.deb ... Unpacking libpython3.12-stdlib:i386 (3.12.2-1) ... Selecting previously unselected package python3.12. Preparing to unpack .../39-python3.12_3.12.2-1_i386.deb ... Unpacking python3.12 (3.12.2-1) ... Selecting previously unselected package python3-all. Preparing to unpack .../40-python3-all_3.11.6-1_i386.deb ... Unpacking python3-all (3.11.6-1) ... Selecting previously unselected package python3-gast. Preparing to unpack .../41-python3-gast_0.5.2-2_all.deb ... Unpacking python3-gast (0.5.2-2) ... Setting up media-types (10.1.0) ... Setting up libpipeline1:i386 (1.5.7-2) ... Setting up libicu72:i386 (72.1-4+b1) ... Setting up bsdextrautils (2.39.3-6) ... Setting up libmagic-mgc (1:5.45-2+b1) ... Setting up libarchive-zip-perl (1.68-1) ... Setting up libdebhelper-perl (13.15.3) ... Setting up libpython3.12-minimal:i386 (3.12.2-1) ... Setting up libmagic1:i386 (1:5.45-2+b1) ... Setting up gettext-base (0.21-14+b1) ... Setting up m4 (1.4.19-4) ... Setting up file (1:5.45-2+b1) ... Setting up tzdata (2024a-1) ... Current default time zone: 'Etc/UTC' Local time is now: Wed Apr 17 00:41:45 UTC 2024. Universal Time is now: Wed Apr 17 00:41:45 UTC 2024. Run 'dpkg-reconfigure tzdata' if you wish to change it. Setting up autotools-dev (20220109.1) ... Setting up autopoint (0.21-14) ... Setting up autoconf (2.71-3) ... Setting up sensible-utils (0.0.22) ... Setting up libuchardet0:i386 (0.0.8-1+b1) ... Setting up libsub-override-perl (0.10-1) ... Setting up netbase (6.4) ... Setting up libelf1:i386 (0.190-1+b1) ... Setting up readline-common (8.2-3) ... Setting up libxml2:i386 (2.9.14+dfsg-1.3+b2) ... Setting up automake (1:1.16.5-1.3) ... update-alternatives: using /usr/bin/automake-1.16 to provide /usr/bin/automake (automake) in auto mode Setting up libfile-stripnondeterminism-perl (1.13.1-1) ... Setting up python3.12-minimal (3.12.2-1) ... Setting up gettext (0.21-14+b1) ... Setting up libtool (2.4.7-7) ... Setting up libreadline8:i386 (8.2-3+b1) ... Setting up intltool-debian (0.35.0+20060710.6) ... Setting up dh-autoreconf (20) ... Setting up dh-strip-nondeterminism (1.13.1-1) ... Setting up dwz (0.15-1) ... Setting up groff-base (1.23.0-3) ... Setting up libpython3.12-stdlib:i386 (3.12.2-1) ... Setting up po-debconf (1.0.21+nmu1) ... Setting up libpython3.11-stdlib:i386 (3.11.8-1) ... Setting up python3.12 (3.12.2-1) ... Setting up man-db (2.12.0-3) ... Not building database; man-db/auto-update is not 'true'. Setting up libpython3-stdlib:i386 (3.11.6-1) ... Setting up python3.11 (3.11.8-1) ... Setting up debhelper (13.15.3) ... Setting up python3 (3.11.6-1) ... Setting up python3-lib2to3 (3.11.5-1) ... Setting up python3-pkg-resources (68.1.2-2) ... Setting up python3-distutils (3.11.5-1) ... python3.12: can't get files for byte-compilation Setting up python3-setuptools (68.1.2-2) ... Setting up python3-gast (0.5.2-2) ... Setting up python3-all (3.11.6-1) ... Setting up dh-python (6.20240401) ... Processing triggers for libc-bin (2.37-15) ... Reading package lists... Building dependency tree... Reading state information... Reading extended state information... Initializing package states... Writing extended state information... Building tag database... -> Finished parsing the build-deps I: Building the package I: user script /srv/workspace/pbuilder/6182/tmp/hooks/A99_set_merged_usr starting Not re-configuring usrmerge for trixie I: user script /srv/workspace/pbuilder/6182/tmp/hooks/A99_set_merged_usr finished hostname: Name or service not known I: Running cd /build/reproducible-path/python-beniget-0.4.1/ && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-buildpackage -us -uc -b && env PATH="/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/i/capture/the/path" HOME="/nonexistent/second-build" dpkg-genchanges -S > ../python-beniget_0.4.1-3_source.changes dpkg-buildpackage: info: source package python-beniget dpkg-buildpackage: info: source version 0.4.1-3 dpkg-buildpackage: info: source distribution unstable dpkg-buildpackage: info: source changed by Louis-Philippe VĂ©ronneau dpkg-source --before-build . dpkg-buildpackage: info: host architecture i386 debian/rules clean dh clean --with python3 --buildsystem=pybuild dh_auto_clean -O--buildsystem=pybuild I: pybuild base:311: python3.12 setup.py clean running clean removing '/build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.12_python-beniget/build' (and everything under it) 'build/bdist.linux-i686' does not exist -- can't clean it 'build/scripts-3.12' does not exist -- can't clean it I: pybuild base:311: python3.11 setup.py clean running clean removing '/build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.11_python-beniget/build' (and everything under it) 'build/bdist.linux-i686' does not exist -- can't clean it 'build/scripts-3.11' does not exist -- can't clean it dh_autoreconf_clean -O--buildsystem=pybuild dh_clean -O--buildsystem=pybuild debian/rules binary dh binary --with python3 --buildsystem=pybuild dh_update_autotools_config -O--buildsystem=pybuild dh_autoreconf -O--buildsystem=pybuild dh_auto_configure -O--buildsystem=pybuild I: pybuild base:311: python3.12 setup.py config running config I: pybuild base:311: python3.11 setup.py config running config dh_auto_build -O--buildsystem=pybuild I: pybuild base:311: /usr/bin/python3.12 setup.py build running build running build_py creating /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.12_python-beniget/build/beniget copying beniget/beniget.py -> /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.12_python-beniget/build/beniget copying beniget/__init__.py -> /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.12_python-beniget/build/beniget I: pybuild base:311: /usr/bin/python3 setup.py build running build running build_py creating /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.11_python-beniget/build/beniget copying beniget/beniget.py -> /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.11_python-beniget/build/beniget copying beniget/__init__.py -> /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.11_python-beniget/build/beniget debian/rules override_dh_auto_test make[1]: Entering directory '/build/reproducible-path/python-beniget-0.4.1' python3.12 -m unittest -v tests/*.py; python3.11 -m unittest -v tests/*.py; test_no_attribute (tests.attributes.TestAttributes.test_no_attribute) ... ok test_non_standard_self (tests.attributes.TestAttributes.test_non_standard_self) ... ok test_self_redefinition (tests.attributes.TestAttributes.test_self_redefinition) ... ok test_self_redefinition_in_args (tests.attributes.TestAttributes.test_self_redefinition_in_args) ... ok test_self_redefinition_in_both_branch (tests.attributes.TestAttributes.test_self_redefinition_in_both_branch) ... ok test_self_redefinition_in_branch_false (tests.attributes.TestAttributes.test_self_redefinition_in_branch_false) ... ok test_self_redefinition_in_branch_true (tests.attributes.TestAttributes.test_self_redefinition_in_branch_true) ... ok test_simple_attribute (tests.attributes.TestAttributes.test_simple_attribute) ... ok test_no_capture (tests.capture.TestCapture.test_no_capture) ... ok test_simple_capture (tests.capture.TestCapture.test_simple_capture) ... ok test_assign_in_loop (tests.chains.TestDefUseChains.test_assign_in_loop) ... ok test_assign_in_loop_in_conditional (tests.chains.TestDefUseChains.test_assign_in_loop_in_conditional) ... ok test_assign_in_while_in_conditional (tests.chains.TestDefUseChains.test_assign_in_while_in_conditional) ... ok test_attr (tests.chains.TestDefUseChains.test_attr) ... ok test_augassign (tests.chains.TestDefUseChains.test_augassign) ... ok test_augassign_in_loop (tests.chains.TestDefUseChains.test_augassign_in_loop) ... ok test_break_in_loop (tests.chains.TestDefUseChains.test_break_in_loop) ... ok test_class_annotation (tests.chains.TestDefUseChains.test_class_annotation) ... ok test_class_decorator (tests.chains.TestDefUseChains.test_class_decorator) ... ok test_complex_for_orelse (tests.chains.TestDefUseChains.test_complex_for_orelse) ... ok test_complex_while_orelse (tests.chains.TestDefUseChains.test_complex_while_orelse) ... ok test_continue_in_loop (tests.chains.TestDefUseChains.test_continue_in_loop) ... ok test_expanded_augassign (tests.chains.TestDefUseChains.test_expanded_augassign) ... ok test_expression_chain (tests.chains.TestDefUseChains.test_expression_chain) ... ok test_for_break (tests.chains.TestDefUseChains.test_for_break) ... ok test_for_pass (tests.chains.TestDefUseChains.test_for_pass) ... ok test_functiondef_returns (tests.chains.TestDefUseChains.test_functiondef_returns) ... ok test_if_both_branch (tests.chains.TestDefUseChains.test_if_both_branch) ... ok test_if_false_branch (tests.chains.TestDefUseChains.test_if_false_branch) ... ok test_if_in_loop (tests.chains.TestDefUseChains.test_if_in_loop) ... ok test_if_true_branch (tests.chains.TestDefUseChains.test_if_true_branch) ... ok test_ifexp_chain (tests.chains.TestDefUseChains.test_ifexp_chain) ... ok test_import_from (tests.chains.TestDefUseChains.test_import_from) ... ok test_import_from_as (tests.chains.TestDefUseChains.test_import_from_as) ... ok test_method_function_conflict (tests.chains.TestDefUseChains.test_method_function_conflict) ... ok test_multiple_import_as (tests.chains.TestDefUseChains.test_multiple_import_as) ... ok test_multiple_import_from_as (tests.chains.TestDefUseChains.test_multiple_import_from_as) ... ok test_named_expr_complex (tests.chains.TestDefUseChains.test_named_expr_complex) ... ok test_named_expr_simple (tests.chains.TestDefUseChains.test_named_expr_simple) ... ok test_named_expr_with_rename (tests.chains.TestDefUseChains.test_named_expr_with_rename) ... ok test_nested_if (tests.chains.TestDefUseChains.test_nested_if) ... ok test_nested_if_else (tests.chains.TestDefUseChains.test_nested_if_else) ... ok test_nested_while (tests.chains.TestDefUseChains.test_nested_while) ... ok test_reassign_in_loop (tests.chains.TestDefUseChains.test_reassign_in_loop) ... ok test_redef_try_except (tests.chains.TestDefUseChains.test_redef_try_except) ... ok test_simple_except (tests.chains.TestDefUseChains.test_simple_except) ... ok test_simple_expression (tests.chains.TestDefUseChains.test_simple_expression) ... ok test_simple_for (tests.chains.TestDefUseChains.test_simple_for) ... ok test_simple_for_orelse (tests.chains.TestDefUseChains.test_simple_for_orelse) ... ok test_simple_import (tests.chains.TestDefUseChains.test_simple_import) ... ok test_simple_import_as (tests.chains.TestDefUseChains.test_simple_import_as) ... ok test_simple_print (tests.chains.TestDefUseChains.test_simple_print) ... ok test_simple_redefinition (tests.chains.TestDefUseChains.test_simple_redefinition) ... ok test_simple_try (tests.chains.TestDefUseChains.test_simple_try) ... ok test_simple_try_except (tests.chains.TestDefUseChains.test_simple_try_except) ... ok test_simple_while (tests.chains.TestDefUseChains.test_simple_while) ... ok test_star_import_with_conditional_redef (tests.chains.TestDefUseChains.test_star_import_with_conditional_redef) ... ok test_try_except (tests.chains.TestDefUseChains.test_try_except) ... ok test_type_destructuring_for (tests.chains.TestDefUseChains.test_type_destructuring_for) ... ok test_type_destructuring_list (tests.chains.TestDefUseChains.test_type_destructuring_list) ... ok test_type_destructuring_tuple (tests.chains.TestDefUseChains.test_type_destructuring_tuple) ... ok test_unbound_identifier_message_format (tests.chains.TestDefUseChains.test_unbound_identifier_message_format) ... ok test_while_break (tests.chains.TestDefUseChains.test_while_break) ... ok test_while_cond_break (tests.chains.TestDefUseChains.test_while_cond_break) ... ok test_while_cond_continue (tests.chains.TestDefUseChains.test_while_cond_continue) ... ok test_while_nested_break (tests.chains.TestDefUseChains.test_while_nested_break) ... ok test_while_orelse_break (tests.chains.TestDefUseChains.test_while_orelse_break) ... ok test_with_handler (tests.chains.TestDefUseChains.test_with_handler) ... ok test_call (tests.chains.TestUseDefChains.test_call) ... ok test_simple_expression (tests.chains.TestUseDefChains.test_simple_expression) ... ok test_class_method_assign (tests.definitions.TestClasses.test_class_method_assign) ... ok testAsyncFunctionDef (tests.definitions.TestGlobals.testAsyncFunctionDef) ... ok testClassDef (tests.definitions.TestGlobals.testClassDef) ... ok testClassMethodDef (tests.definitions.TestGlobals.testClassMethodDef) ... ok testClassRedefinition (tests.definitions.TestGlobals.testClassRedefinition) ... ok testDelClassDef (tests.definitions.TestGlobals.testDelClassDef) ... ok testDelClassDefReDef (tests.definitions.TestGlobals.testDelClassDefReDef) ... ok testFuntionNested (tests.definitions.TestGlobals.testFuntionNested) ... ok testFuntionRedefinion (tests.definitions.TestGlobals.testFuntionRedefinion) ... ok testGlobalAfterKeyword (tests.definitions.TestGlobals.testGlobalAfterKeyword) ... ok testGlobalAnnotatedDef (tests.definitions.TestGlobals.testGlobalAnnotatedDef) ... ok testGlobalAsyncFor (tests.definitions.TestGlobals.testGlobalAsyncFor) ... ok testGlobalAsyncWith (tests.definitions.TestGlobals.testGlobalAsyncWith) ... ok testGlobalAugAssign (tests.definitions.TestGlobals.testGlobalAugAssign) ... ok testGlobalBeforeKeyword (tests.definitions.TestGlobals.testGlobalBeforeKeyword) ... ok testGlobalDef (tests.definitions.TestGlobals.testGlobalDef) ... ok testGlobalDestructuring (tests.definitions.TestGlobals.testGlobalDestructuring) ... ok testGlobalDictComp (tests.definitions.TestGlobals.testGlobalDictComp) ... ok testGlobalFor (tests.definitions.TestGlobals.testGlobalFor) ... ok testGlobalForDestructuring (tests.definitions.TestGlobals.testGlobalForDestructuring) ... ok testGlobalGeneratorExpr (tests.definitions.TestGlobals.testGlobalGeneratorExpr) ... ok testGlobalImport (tests.definitions.TestGlobals.testGlobalImport) ... ok testGlobalImportAs (tests.definitions.TestGlobals.testGlobalImportAs) ... ok testGlobalImportFrom (tests.definitions.TestGlobals.testGlobalImportFrom) ... ok testGlobalImportFromAs (tests.definitions.TestGlobals.testGlobalImportFromAs) ... ok testGlobalImportFromStar (tests.definitions.TestGlobals.testGlobalImportFromStar) ... ok testGlobalImportFromStarRedefine (tests.definitions.TestGlobals.testGlobalImportFromStarRedefine) ... ok testGlobalImportSubModule (tests.definitions.TestGlobals.testGlobalImportSubModule) ... ok testGlobalImportSubModuleAs (tests.definitions.TestGlobals.testGlobalImportSubModuleAs) ... ok testGlobalImports (tests.definitions.TestGlobals.testGlobalImports) ... ok testGlobalImportsAs (tests.definitions.TestGlobals.testGlobalImportsAs) ... ok testGlobalImportsFrom (tests.definitions.TestGlobals.testGlobalImportsFrom) ... ok testGlobalImportsFromAs (tests.definitions.TestGlobals.testGlobalImportsFromAs) ... ok testGlobalInFor (tests.definitions.TestGlobals.testGlobalInFor) ... ok testGlobalInIfBothBranch (tests.definitions.TestGlobals.testGlobalInIfBothBranch) ... ok testGlobalInIfBothBranchDifferent (tests.definitions.TestGlobals.testGlobalInIfBothBranchDifferent) ... ok testGlobalInIfFalseBranch (tests.definitions.TestGlobals.testGlobalInIfFalseBranch) ... ok testGlobalInIfTrueBranch (tests.definitions.TestGlobals.testGlobalInIfTrueBranch) ... ok testGlobalInWhile (tests.definitions.TestGlobals.testGlobalInWhile) ... ok testGlobalLambda (tests.definitions.TestGlobals.testGlobalLambda) ... ok testGlobalListComp (tests.definitions.TestGlobals.testGlobalListComp) ... ok testGlobalNestedFor (tests.definitions.TestGlobals.testGlobalNestedFor) ... ok testGlobalSetComp (tests.definitions.TestGlobals.testGlobalSetComp) ... ok testGlobalThroughKeyword (tests.definitions.TestGlobals.testGlobalThroughKeyword) ... ok testGlobalThroughKeywords (tests.definitions.TestGlobals.testGlobalThroughKeywords) ... ok testGlobalThroughMultipleKeyword (tests.definitions.TestGlobals.testGlobalThroughMultipleKeyword) ... ok testGlobalTry (tests.definitions.TestGlobals.testGlobalTry) ... ok testGlobalTryExcept (tests.definitions.TestGlobals.testGlobalTryExcept) ... ok testGlobalTryExceptFinally (tests.definitions.TestGlobals.testGlobalTryExceptFinally) ... ok testGlobalWith (tests.definitions.TestGlobals.testGlobalWith) ... ok testGlobalsAfterKeyword (tests.definitions.TestGlobals.testGlobalsAfterKeyword) ... ok testGlobalsBeforeKeyword (tests.definitions.TestGlobals.testGlobalsBeforeKeyword) ... ok testMultipleClassDef (tests.definitions.TestGlobals.testMultipleClassDef) ... ok testMultipleGlobalDef (tests.definitions.TestGlobals.testMultipleGlobalDef) ... ok testNestedClassDef (tests.definitions.TestGlobals.testNestedClassDef) ... ok test_MultipleFunctionDef (tests.definitions.TestGlobals.test_MultipleFunctionDef) ... ok test_SingleFunctionDef (tests.definitions.TestGlobals.test_SingleFunctionDef) ... ok testLocalFunctionDef (tests.definitions.TestLocals.testLocalFunctionDef) ... ok testLocalFunctionDefArgsDefault (tests.definitions.TestLocals.testLocalFunctionDefArgsDefault) ... ok testLocalFunctionDefKwArgs (tests.definitions.TestLocals.testLocalFunctionDefKwArgs) ... ok testLocalFunctionDefKwOnly (tests.definitions.TestLocals.testLocalFunctionDefKwOnly) ... ok testLocalFunctionDefOneArg (tests.definitions.TestLocals.testLocalFunctionDefOneArg) ... ok testLocalFunctionDefOneArgDefault (tests.definitions.TestLocals.testLocalFunctionDefOneArgDefault) ... ok testLocalFunctionDefStarArgs (tests.definitions.TestLocals.testLocalFunctionDefStarArgs) ... ok test_AugAssignInLoop (tests.definitions.TestLocals.test_AugAssignInLoop) ... ok test_IfInWhile (tests.definitions.TestLocals.test_IfInWhile) ... ok test_ListCompInLoop (tests.definitions.TestLocals.test_ListCompInLoop) ... ok test_LocalAssign (tests.definitions.TestLocals.test_LocalAssign) ... ok test_LocalAssignRedef (tests.definitions.TestLocals.test_LocalAssignRedef) ... ok test_LocalGlobal (tests.definitions.TestLocals.test_LocalGlobal) ... ok test_LocalNestedFun (tests.definitions.TestLocals.test_LocalNestedFun) ... ok test_LocalNonLocalAfter (tests.definitions.TestLocals.test_LocalNonLocalAfter) ... ok test_LocalNonLocalBefore (tests.definitions.TestLocals.test_LocalNonLocalBefore) ... ok test_beniget_documentation (tests.doc.TestDoctest.test_beniget_documentation) ... ok test_beniget_readme (tests.doc.TestDoctest.test_beniget_readme) ... Trying: import gast as ast Expecting nothing ok Trying: code = 'def foo(x): return x + 1' Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: from beniget import Ancestors Expecting nothing ok Trying: ancestors = Ancestors() Expecting nothing ok Trying: ancestors.visit(module) Expecting nothing ok Trying: binop = module.body[0].body[0].value Expecting nothing ok Trying: for n in ancestors.parents(binop): print(type(n)) Expecting: ok Trying: import gast as ast Expecting nothing ok Trying: module = ast.parse("from b import c, d; c()") Expecting nothing ok Trying: duc = DefUseChains() Expecting nothing ok Trying: duc.visit(module) Expecting nothing ok Trying: for head in duc.locals[module]: print("{}: {}".format(head.name(), len(head.users()))) Expecting: c: 1 d: 0 ok Trying: alias_def = duc.chains[module.body[0].names[0]] Expecting nothing ok Trying: print(alias_def) Expecting: c -> (c -> (Call -> ())) ok 94 items had no tests: beniget.beniget beniget.beniget.Ancestors.__init__ beniget.beniget.Ancestors.generic_visit beniget.beniget.Ancestors.parent beniget.beniget.Ancestors.parentFunction beniget.beniget.Ancestors.parentInstance beniget.beniget.Ancestors.parentStmt beniget.beniget.Ancestors.parents beniget.beniget.CollectGlobals beniget.beniget.CollectGlobals.__init__ beniget.beniget.CollectGlobals.visit_Global beniget.beniget.Def beniget.beniget.Def.__init__ beniget.beniget.Def.__repr__ beniget.beniget.Def.__str__ beniget.beniget.Def._repr beniget.beniget.Def._str beniget.beniget.Def.add_user beniget.beniget.Def.name beniget.beniget.Def.users beniget.beniget.DefUseChains.CompDefinitionContext beniget.beniget.DefUseChains.DefinitionContext beniget.beniget.DefUseChains.__init__ beniget.beniget.DefUseChains.add_to_definition beniget.beniget.DefUseChains.defs beniget.beniget.DefUseChains.dump_chains beniget.beniget.DefUseChains.dump_definitions beniget.beniget.DefUseChains.extend_definition beniget.beniget.DefUseChains.lookup_identifier beniget.beniget.DefUseChains.process_body beniget.beniget.DefUseChains.process_undefs beniget.beniget.DefUseChains.set_definition beniget.beniget.DefUseChains.unbound_identifier beniget.beniget.DefUseChains.visit_AnnAssign beniget.beniget.DefUseChains.visit_Assert beniget.beniget.DefUseChains.visit_Assign beniget.beniget.DefUseChains.visit_AugAssign beniget.beniget.DefUseChains.visit_Await beniget.beniget.DefUseChains.visit_BinOp beniget.beniget.DefUseChains.visit_BoolOp beniget.beniget.DefUseChains.visit_Break beniget.beniget.DefUseChains.visit_Call beniget.beniget.DefUseChains.visit_ClassDef beniget.beniget.DefUseChains.visit_Compare beniget.beniget.DefUseChains.visit_Constant beniget.beniget.DefUseChains.visit_Continue beniget.beniget.DefUseChains.visit_Delete beniget.beniget.DefUseChains.visit_Destructured beniget.beniget.DefUseChains.visit_Dict beniget.beniget.DefUseChains.visit_DictComp beniget.beniget.DefUseChains.visit_Exec beniget.beniget.DefUseChains.visit_Expr beniget.beniget.DefUseChains.visit_For beniget.beniget.DefUseChains.visit_FormattedValue beniget.beniget.DefUseChains.visit_FunctionDef beniget.beniget.DefUseChains.visit_Global beniget.beniget.DefUseChains.visit_If beniget.beniget.DefUseChains.visit_IfExp beniget.beniget.DefUseChains.visit_Import beniget.beniget.DefUseChains.visit_ImportFrom beniget.beniget.DefUseChains.visit_JoinedStr beniget.beniget.DefUseChains.visit_Lambda beniget.beniget.DefUseChains.visit_List beniget.beniget.DefUseChains.visit_ListComp beniget.beniget.DefUseChains.visit_Module beniget.beniget.DefUseChains.visit_Name beniget.beniget.DefUseChains.visit_NamedExpr beniget.beniget.DefUseChains.visit_Nonlocal beniget.beniget.DefUseChains.visit_Print beniget.beniget.DefUseChains.visit_Raise beniget.beniget.DefUseChains.visit_Return beniget.beniget.DefUseChains.visit_Set beniget.beniget.DefUseChains.visit_Slice beniget.beniget.DefUseChains.visit_Subscript beniget.beniget.DefUseChains.visit_Try beniget.beniget.DefUseChains.visit_UnaryOp beniget.beniget.DefUseChains.visit_While beniget.beniget.DefUseChains.visit_With beniget.beniget.DefUseChains.visit_Yield beniget.beniget.DefUseChains.visit_arguments beniget.beniget.DefUseChains.visit_comprehension beniget.beniget.DefUseChains.visit_excepthandler beniget.beniget.DefUseChains.visit_withitem beniget.beniget.UseDefChains beniget.beniget.UseDefChains.__init__ beniget.beniget.UseDefChains.__str__ beniget.beniget.ordered_set beniget.beniget.ordered_set.__add__ beniget.beniget.ordered_set.__contains__ beniget.beniget.ordered_set.__init__ beniget.beniget.ordered_set.__iter__ beniget.beniget.ordered_set.__len__ beniget.beniget.ordered_set.add beniget.beniget.ordered_set.update 2 items passed all tests: 8 tests in beniget.beniget.Ancestors 7 tests in beniget.beniget.DefUseChains 15 tests in 96 items. 15 passed and 0 failed. Test passed. Trying: import beniget, gast as ast Expecting nothing ok Trying: code = "from math import cos, sin; print(cos(3))" Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: duc = beniget.DefUseChains() Expecting nothing ok Trying: duc.visit(module) Expecting nothing ok Trying: imported = module.body[0].names Expecting nothing ok Trying: for name in imported: ud = duc.chains[name] if not ud.users(): print("Unused import: {}".format(ud.name())) Expecting: Unused import: sin ok Trying: code = """ nice = lambda x: x @nice def aw(): pass def some(): pass""" Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: duc = beniget.DefUseChains() Expecting nothing ok Trying: duc.visit(module) Expecting nothing ok Trying: ancestors = beniget.Ancestors() Expecting nothing ok Trying: ancestors.visit(module) Expecting nothing ok Trying: nice = [d for d in duc.locals[module] if d.name() == "nice"][0] Expecting nothing ok Trying: for use in nice.users(): # we're interested in the parent of the decorator parents = ancestors.parents(use.node) # direct parent of the decorator is the function fdef = parents[-1] print(fdef.name) Expecting: aw ok Trying: import gast as ast Expecting nothing ok Trying: import beniget Expecting nothing ok Trying: class Attributes(ast.NodeVisitor): def __init__(self, module_node): # compute the def-use of the module self.chains = beniget.DefUseChains() self.chains.visit(module_node) self.users = set() # all users of `self` self.attributes = set() # attributes of current class def visit_ClassDef(self, node): # walk methods and fill users of `self` for stmt in node.body: if isinstance(stmt, ast.FunctionDef): self_def = self.chains.chains[stmt.args.args[0]] self.users.update(use.node for use in self_def.users()) self.generic_visit(node) def visit_Attribute(self, node): # any attribute of `self` is registered if node.value in self.users: self.attributes.add(node.attr) Expecting nothing ok Trying: code = "class My(object):\n def __init__(self, x): self.x = x" Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: classdef = module.body[0] Expecting nothing ok Trying: attr = Attributes(module) Expecting nothing ok Trying: attr.visit(classdef) Expecting nothing ok Trying: list(attr.attributes) Expecting: ['x'] ok ok ---------------------------------------------------------------------- Ran 145 tests in 0.234s OK Trying: import gast as ast Expecting nothing ok Trying: import beniget Expecting nothing ok Trying: class Capture(ast.NodeVisitor): def __init__(self, module_node): # initialize def-use chains self.chains = beniget.DefUseChains() self.chains.visit(module_node) self.users = set() # users of local definitions self.captured = set() # identifiers that don't belong to local users def visit_FunctionDef(self, node): # initialize the set of node using a local variable for def_ in self.chains.locals[node]: self.users.update(use.node for use in def_.users()) self.generic_visit(node) def visit_Name(self, node): # register load of identifiers not locally definied if isinstance(node.ctx, ast.Load): if node not in self.users: self.captured.add(node.id) Expecting nothing ok Trying: code = 'def foo(x):\n def bar(): return x\n return bar' Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: inner_function = module.body[0].body[0] Expecting nothing ok Trying: capture = Capture(module) Expecting nothing ok Trying: capture.visit(inner_function) Expecting nothing ok Trying: list(capture.captured) Expecting: ['x'] ok Trying: import gast as ast Expecting nothing ok Trying: import beniget Expecting nothing ok Trying: class CaptureX(ast.NodeVisitor): def __init__(self, module_node, fun): self.fun = fun # initialize use-def chains du = beniget.DefUseChains() du.visit(module_node) self.chains = beniget.UseDefChains(du) self.ancestors = beniget.Ancestors() self.ancestors.visit(module_node) self.external = list() self.visited_external = set() def visit_Name(self, node): # register load of identifiers not locally defined if isinstance(node.ctx, ast.Load): uses = self.chains.chains[node] for use in uses: try: parents = self.ancestors.parents(use.node) except KeyError: return # a builtin if self.fun not in parents: parent = self.ancestors.parentStmt(use.node) if parent not in self.visited_external: self.visited_external.add(parent) self.external.append(parent) self.rec(parent) def rec(self, node): "walk definitions to find their operands's def" if isinstance(node, ast.Assign): self.visit(node.value) # TODO: implement this for AugAssign etc Expecting nothing ok Trying: code = 'a = 1; b = [a, a]; c = len(b)\ndef foo():\n return c' Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: function = module.body[3] Expecting nothing ok Trying: capturex = CaptureX(module, function) Expecting nothing ok Trying: capturex.visit(function) Expecting nothing ok Trying: list(map(type, capturex.external)) Expecting: [, , ] ok 1 items passed all tests: 42 tests in README.rst 42 tests in 1 items. 42 passed and 0 failed. Test passed. test_no_attribute (tests.attributes.TestAttributes.test_no_attribute) ... ok test_non_standard_self (tests.attributes.TestAttributes.test_non_standard_self) ... ok test_self_redefinition (tests.attributes.TestAttributes.test_self_redefinition) ... ok test_self_redefinition_in_args (tests.attributes.TestAttributes.test_self_redefinition_in_args) ... ok test_self_redefinition_in_both_branch (tests.attributes.TestAttributes.test_self_redefinition_in_both_branch) ... ok test_self_redefinition_in_branch_false (tests.attributes.TestAttributes.test_self_redefinition_in_branch_false) ... ok test_self_redefinition_in_branch_true (tests.attributes.TestAttributes.test_self_redefinition_in_branch_true) ... ok test_simple_attribute (tests.attributes.TestAttributes.test_simple_attribute) ... ok test_no_capture (tests.capture.TestCapture.test_no_capture) ... ok test_simple_capture (tests.capture.TestCapture.test_simple_capture) ... ok test_assign_in_loop (tests.chains.TestDefUseChains.test_assign_in_loop) ... ok test_assign_in_loop_in_conditional (tests.chains.TestDefUseChains.test_assign_in_loop_in_conditional) ... ok test_assign_in_while_in_conditional (tests.chains.TestDefUseChains.test_assign_in_while_in_conditional) ... ok test_attr (tests.chains.TestDefUseChains.test_attr) ... ok test_augassign (tests.chains.TestDefUseChains.test_augassign) ... ok test_augassign_in_loop (tests.chains.TestDefUseChains.test_augassign_in_loop) ... ok test_break_in_loop (tests.chains.TestDefUseChains.test_break_in_loop) ... ok test_class_annotation (tests.chains.TestDefUseChains.test_class_annotation) ... ok test_class_decorator (tests.chains.TestDefUseChains.test_class_decorator) ... ok test_complex_for_orelse (tests.chains.TestDefUseChains.test_complex_for_orelse) ... ok test_complex_while_orelse (tests.chains.TestDefUseChains.test_complex_while_orelse) ... ok test_continue_in_loop (tests.chains.TestDefUseChains.test_continue_in_loop) ... ok test_expanded_augassign (tests.chains.TestDefUseChains.test_expanded_augassign) ... ok test_expression_chain (tests.chains.TestDefUseChains.test_expression_chain) ... ok test_for_break (tests.chains.TestDefUseChains.test_for_break) ... ok test_for_pass (tests.chains.TestDefUseChains.test_for_pass) ... ok test_functiondef_returns (tests.chains.TestDefUseChains.test_functiondef_returns) ... ok test_if_both_branch (tests.chains.TestDefUseChains.test_if_both_branch) ... ok test_if_false_branch (tests.chains.TestDefUseChains.test_if_false_branch) ... ok test_if_in_loop (tests.chains.TestDefUseChains.test_if_in_loop) ... ok test_if_true_branch (tests.chains.TestDefUseChains.test_if_true_branch) ... ok test_ifexp_chain (tests.chains.TestDefUseChains.test_ifexp_chain) ... ok test_import_from (tests.chains.TestDefUseChains.test_import_from) ... ok test_import_from_as (tests.chains.TestDefUseChains.test_import_from_as) ... ok test_method_function_conflict (tests.chains.TestDefUseChains.test_method_function_conflict) ... ok test_multiple_import_as (tests.chains.TestDefUseChains.test_multiple_import_as) ... ok test_multiple_import_from_as (tests.chains.TestDefUseChains.test_multiple_import_from_as) ... ok test_named_expr_complex (tests.chains.TestDefUseChains.test_named_expr_complex) ... ok test_named_expr_simple (tests.chains.TestDefUseChains.test_named_expr_simple) ... ok test_named_expr_with_rename (tests.chains.TestDefUseChains.test_named_expr_with_rename) ... ok test_nested_if (tests.chains.TestDefUseChains.test_nested_if) ... ok test_nested_if_else (tests.chains.TestDefUseChains.test_nested_if_else) ... ok test_nested_while (tests.chains.TestDefUseChains.test_nested_while) ... ok test_reassign_in_loop (tests.chains.TestDefUseChains.test_reassign_in_loop) ... ok test_redef_try_except (tests.chains.TestDefUseChains.test_redef_try_except) ... ok test_simple_except (tests.chains.TestDefUseChains.test_simple_except) ... ok test_simple_expression (tests.chains.TestDefUseChains.test_simple_expression) ... ok test_simple_for (tests.chains.TestDefUseChains.test_simple_for) ... ok test_simple_for_orelse (tests.chains.TestDefUseChains.test_simple_for_orelse) ... ok test_simple_import (tests.chains.TestDefUseChains.test_simple_import) ... ok test_simple_import_as (tests.chains.TestDefUseChains.test_simple_import_as) ... ok test_simple_print (tests.chains.TestDefUseChains.test_simple_print) ... ok test_simple_redefinition (tests.chains.TestDefUseChains.test_simple_redefinition) ... ok test_simple_try (tests.chains.TestDefUseChains.test_simple_try) ... ok test_simple_try_except (tests.chains.TestDefUseChains.test_simple_try_except) ... ok test_simple_while (tests.chains.TestDefUseChains.test_simple_while) ... ok test_star_import_with_conditional_redef (tests.chains.TestDefUseChains.test_star_import_with_conditional_redef) ... ok test_try_except (tests.chains.TestDefUseChains.test_try_except) ... ok test_type_destructuring_for (tests.chains.TestDefUseChains.test_type_destructuring_for) ... ok test_type_destructuring_list (tests.chains.TestDefUseChains.test_type_destructuring_list) ... ok test_type_destructuring_tuple (tests.chains.TestDefUseChains.test_type_destructuring_tuple) ... ok test_unbound_identifier_message_format (tests.chains.TestDefUseChains.test_unbound_identifier_message_format) ... ok test_while_break (tests.chains.TestDefUseChains.test_while_break) ... ok test_while_cond_break (tests.chains.TestDefUseChains.test_while_cond_break) ... ok test_while_cond_continue (tests.chains.TestDefUseChains.test_while_cond_continue) ... ok test_while_nested_break (tests.chains.TestDefUseChains.test_while_nested_break) ... ok test_while_orelse_break (tests.chains.TestDefUseChains.test_while_orelse_break) ... ok test_with_handler (tests.chains.TestDefUseChains.test_with_handler) ... ok test_call (tests.chains.TestUseDefChains.test_call) ... ok test_simple_expression (tests.chains.TestUseDefChains.test_simple_expression) ... ok test_class_method_assign (tests.definitions.TestClasses.test_class_method_assign) ... ok testAsyncFunctionDef (tests.definitions.TestGlobals.testAsyncFunctionDef) ... ok testClassDef (tests.definitions.TestGlobals.testClassDef) ... ok testClassMethodDef (tests.definitions.TestGlobals.testClassMethodDef) ... ok testClassRedefinition (tests.definitions.TestGlobals.testClassRedefinition) ... ok testDelClassDef (tests.definitions.TestGlobals.testDelClassDef) ... ok testDelClassDefReDef (tests.definitions.TestGlobals.testDelClassDefReDef) ... ok testFuntionNested (tests.definitions.TestGlobals.testFuntionNested) ... ok testFuntionRedefinion (tests.definitions.TestGlobals.testFuntionRedefinion) ... ok testGlobalAfterKeyword (tests.definitions.TestGlobals.testGlobalAfterKeyword) ... ok testGlobalAnnotatedDef (tests.definitions.TestGlobals.testGlobalAnnotatedDef) ... ok testGlobalAsyncFor (tests.definitions.TestGlobals.testGlobalAsyncFor) ... ok testGlobalAsyncWith (tests.definitions.TestGlobals.testGlobalAsyncWith) ... ok testGlobalAugAssign (tests.definitions.TestGlobals.testGlobalAugAssign) ... ok testGlobalBeforeKeyword (tests.definitions.TestGlobals.testGlobalBeforeKeyword) ... ok testGlobalDef (tests.definitions.TestGlobals.testGlobalDef) ... ok testGlobalDestructuring (tests.definitions.TestGlobals.testGlobalDestructuring) ... ok testGlobalDictComp (tests.definitions.TestGlobals.testGlobalDictComp) ... ok testGlobalFor (tests.definitions.TestGlobals.testGlobalFor) ... ok testGlobalForDestructuring (tests.definitions.TestGlobals.testGlobalForDestructuring) ... ok testGlobalGeneratorExpr (tests.definitions.TestGlobals.testGlobalGeneratorExpr) ... ok testGlobalImport (tests.definitions.TestGlobals.testGlobalImport) ... ok testGlobalImportAs (tests.definitions.TestGlobals.testGlobalImportAs) ... ok testGlobalImportFrom (tests.definitions.TestGlobals.testGlobalImportFrom) ... ok testGlobalImportFromAs (tests.definitions.TestGlobals.testGlobalImportFromAs) ... ok testGlobalImportFromStar (tests.definitions.TestGlobals.testGlobalImportFromStar) ... ok testGlobalImportFromStarRedefine (tests.definitions.TestGlobals.testGlobalImportFromStarRedefine) ... ok testGlobalImportSubModule (tests.definitions.TestGlobals.testGlobalImportSubModule) ... ok testGlobalImportSubModuleAs (tests.definitions.TestGlobals.testGlobalImportSubModuleAs) ... ok testGlobalImports (tests.definitions.TestGlobals.testGlobalImports) ... ok testGlobalImportsAs (tests.definitions.TestGlobals.testGlobalImportsAs) ... ok testGlobalImportsFrom (tests.definitions.TestGlobals.testGlobalImportsFrom) ... ok testGlobalImportsFromAs (tests.definitions.TestGlobals.testGlobalImportsFromAs) ... ok testGlobalInFor (tests.definitions.TestGlobals.testGlobalInFor) ... ok testGlobalInIfBothBranch (tests.definitions.TestGlobals.testGlobalInIfBothBranch) ... ok testGlobalInIfBothBranchDifferent (tests.definitions.TestGlobals.testGlobalInIfBothBranchDifferent) ... ok testGlobalInIfFalseBranch (tests.definitions.TestGlobals.testGlobalInIfFalseBranch) ... ok testGlobalInIfTrueBranch (tests.definitions.TestGlobals.testGlobalInIfTrueBranch) ... ok testGlobalInWhile (tests.definitions.TestGlobals.testGlobalInWhile) ... ok testGlobalLambda (tests.definitions.TestGlobals.testGlobalLambda) ... ok testGlobalListComp (tests.definitions.TestGlobals.testGlobalListComp) ... ok testGlobalNestedFor (tests.definitions.TestGlobals.testGlobalNestedFor) ... ok testGlobalSetComp (tests.definitions.TestGlobals.testGlobalSetComp) ... ok testGlobalThroughKeyword (tests.definitions.TestGlobals.testGlobalThroughKeyword) ... ok testGlobalThroughKeywords (tests.definitions.TestGlobals.testGlobalThroughKeywords) ... ok testGlobalThroughMultipleKeyword (tests.definitions.TestGlobals.testGlobalThroughMultipleKeyword) ... ok testGlobalTry (tests.definitions.TestGlobals.testGlobalTry) ... ok testGlobalTryExcept (tests.definitions.TestGlobals.testGlobalTryExcept) ... ok testGlobalTryExceptFinally (tests.definitions.TestGlobals.testGlobalTryExceptFinally) ... ok testGlobalWith (tests.definitions.TestGlobals.testGlobalWith) ... ok testGlobalsAfterKeyword (tests.definitions.TestGlobals.testGlobalsAfterKeyword) ... ok testGlobalsBeforeKeyword (tests.definitions.TestGlobals.testGlobalsBeforeKeyword) ... ok testMultipleClassDef (tests.definitions.TestGlobals.testMultipleClassDef) ... ok testMultipleGlobalDef (tests.definitions.TestGlobals.testMultipleGlobalDef) ... ok testNestedClassDef (tests.definitions.TestGlobals.testNestedClassDef) ... ok test_MultipleFunctionDef (tests.definitions.TestGlobals.test_MultipleFunctionDef) ... ok test_SingleFunctionDef (tests.definitions.TestGlobals.test_SingleFunctionDef) ... ok testLocalFunctionDef (tests.definitions.TestLocals.testLocalFunctionDef) ... ok testLocalFunctionDefArgsDefault (tests.definitions.TestLocals.testLocalFunctionDefArgsDefault) ... ok testLocalFunctionDefKwArgs (tests.definitions.TestLocals.testLocalFunctionDefKwArgs) ... ok testLocalFunctionDefKwOnly (tests.definitions.TestLocals.testLocalFunctionDefKwOnly) ... ok testLocalFunctionDefOneArg (tests.definitions.TestLocals.testLocalFunctionDefOneArg) ... ok testLocalFunctionDefOneArgDefault (tests.definitions.TestLocals.testLocalFunctionDefOneArgDefault) ... ok testLocalFunctionDefStarArgs (tests.definitions.TestLocals.testLocalFunctionDefStarArgs) ... ok test_AugAssignInLoop (tests.definitions.TestLocals.test_AugAssignInLoop) ... ok test_IfInWhile (tests.definitions.TestLocals.test_IfInWhile) ... ok test_ListCompInLoop (tests.definitions.TestLocals.test_ListCompInLoop) ... ok test_LocalAssign (tests.definitions.TestLocals.test_LocalAssign) ... ok test_LocalAssignRedef (tests.definitions.TestLocals.test_LocalAssignRedef) ... ok test_LocalGlobal (tests.definitions.TestLocals.test_LocalGlobal) ... ok test_LocalNestedFun (tests.definitions.TestLocals.test_LocalNestedFun) ... ok test_LocalNonLocalAfter (tests.definitions.TestLocals.test_LocalNonLocalAfter) ... ok test_LocalNonLocalBefore (tests.definitions.TestLocals.test_LocalNonLocalBefore) ... ok test_beniget_documentation (tests.doc.TestDoctest.test_beniget_documentation) ... ok test_beniget_readme (tests.doc.TestDoctest.test_beniget_readme) ... Trying: import gast as ast Expecting nothing ok Trying: code = 'def foo(x): return x + 1' Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: from beniget import Ancestors Expecting nothing ok Trying: ancestors = Ancestors() Expecting nothing ok Trying: ancestors.visit(module) Expecting nothing ok Trying: binop = module.body[0].body[0].value Expecting nothing ok Trying: for n in ancestors.parents(binop): print(type(n)) Expecting: ok Trying: import gast as ast Expecting nothing ok Trying: module = ast.parse("from b import c, d; c()") Expecting nothing ok Trying: duc = DefUseChains() Expecting nothing ok Trying: duc.visit(module) Expecting nothing ok Trying: for head in duc.locals[module]: print("{}: {}".format(head.name(), len(head.users()))) Expecting: c: 1 d: 0 ok Trying: alias_def = duc.chains[module.body[0].names[0]] Expecting nothing ok Trying: print(alias_def) Expecting: c -> (c -> (Call -> ())) ok 94 items had no tests: beniget.beniget beniget.beniget.Ancestors.__init__ beniget.beniget.Ancestors.generic_visit beniget.beniget.Ancestors.parent beniget.beniget.Ancestors.parentFunction beniget.beniget.Ancestors.parentInstance beniget.beniget.Ancestors.parentStmt beniget.beniget.Ancestors.parents beniget.beniget.CollectGlobals beniget.beniget.CollectGlobals.__init__ beniget.beniget.CollectGlobals.visit_Global beniget.beniget.Def beniget.beniget.Def.__init__ beniget.beniget.Def.__repr__ beniget.beniget.Def.__str__ beniget.beniget.Def._repr beniget.beniget.Def._str beniget.beniget.Def.add_user beniget.beniget.Def.name beniget.beniget.Def.users beniget.beniget.DefUseChains.CompDefinitionContext beniget.beniget.DefUseChains.DefinitionContext beniget.beniget.DefUseChains.__init__ beniget.beniget.DefUseChains.add_to_definition beniget.beniget.DefUseChains.defs beniget.beniget.DefUseChains.dump_chains beniget.beniget.DefUseChains.dump_definitions beniget.beniget.DefUseChains.extend_definition beniget.beniget.DefUseChains.lookup_identifier beniget.beniget.DefUseChains.process_body beniget.beniget.DefUseChains.process_undefs beniget.beniget.DefUseChains.set_definition beniget.beniget.DefUseChains.unbound_identifier beniget.beniget.DefUseChains.visit_AnnAssign beniget.beniget.DefUseChains.visit_Assert beniget.beniget.DefUseChains.visit_Assign beniget.beniget.DefUseChains.visit_AugAssign beniget.beniget.DefUseChains.visit_Await beniget.beniget.DefUseChains.visit_BinOp beniget.beniget.DefUseChains.visit_BoolOp beniget.beniget.DefUseChains.visit_Break beniget.beniget.DefUseChains.visit_Call beniget.beniget.DefUseChains.visit_ClassDef beniget.beniget.DefUseChains.visit_Compare beniget.beniget.DefUseChains.visit_Constant beniget.beniget.DefUseChains.visit_Continue beniget.beniget.DefUseChains.visit_Delete beniget.beniget.DefUseChains.visit_Destructured beniget.beniget.DefUseChains.visit_Dict beniget.beniget.DefUseChains.visit_DictComp beniget.beniget.DefUseChains.visit_Exec beniget.beniget.DefUseChains.visit_Expr beniget.beniget.DefUseChains.visit_For beniget.beniget.DefUseChains.visit_FormattedValue beniget.beniget.DefUseChains.visit_FunctionDef beniget.beniget.DefUseChains.visit_Global beniget.beniget.DefUseChains.visit_If beniget.beniget.DefUseChains.visit_IfExp beniget.beniget.DefUseChains.visit_Import beniget.beniget.DefUseChains.visit_ImportFrom beniget.beniget.DefUseChains.visit_JoinedStr beniget.beniget.DefUseChains.visit_Lambda beniget.beniget.DefUseChains.visit_List beniget.beniget.DefUseChains.visit_ListComp beniget.beniget.DefUseChains.visit_Module beniget.beniget.DefUseChains.visit_Name beniget.beniget.DefUseChains.visit_NamedExpr beniget.beniget.DefUseChains.visit_Nonlocal beniget.beniget.DefUseChains.visit_Print beniget.beniget.DefUseChains.visit_Raise beniget.beniget.DefUseChains.visit_Return beniget.beniget.DefUseChains.visit_Set beniget.beniget.DefUseChains.visit_Slice beniget.beniget.DefUseChains.visit_Subscript beniget.beniget.DefUseChains.visit_Try beniget.beniget.DefUseChains.visit_UnaryOp beniget.beniget.DefUseChains.visit_While beniget.beniget.DefUseChains.visit_With beniget.beniget.DefUseChains.visit_Yield beniget.beniget.DefUseChains.visit_arguments beniget.beniget.DefUseChains.visit_comprehension beniget.beniget.DefUseChains.visit_excepthandler beniget.beniget.DefUseChains.visit_withitem beniget.beniget.UseDefChains beniget.beniget.UseDefChains.__init__ beniget.beniget.UseDefChains.__str__ beniget.beniget.ordered_set beniget.beniget.ordered_set.__add__ beniget.beniget.ordered_set.__contains__ beniget.beniget.ordered_set.__init__ beniget.beniget.ordered_set.__iter__ beniget.beniget.ordered_set.__len__ beniget.beniget.ordered_set.add beniget.beniget.ordered_set.update 2 items passed all tests: 8 tests in beniget.beniget.Ancestors 7 tests in beniget.beniget.DefUseChains 15 tests in 96 items. 15 passed and 0 failed. Test passed. Trying: import beniget, gast as ast Expecting nothing ok Trying: code = "from math import cos, sin; print(cos(3))" Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: duc = beniget.DefUseChains() Expecting nothing ok Trying: duc.visit(module) Expecting nothing ok Trying: imported = module.body[0].names Expecting nothing ok Trying: for name in imported: ud = duc.chains[name] if not ud.users(): print("Unused import: {}".format(ud.name())) Expecting: Unused import: sin ok Trying: code = """ nice = lambda x: x @nice def aw(): pass def some(): pass""" Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: duc = beniget.DefUseChains() Expecting nothing ok Trying: duc.visit(module) Expecting nothing ok Trying: ancestors = beniget.Ancestors() Expecting nothing ok Trying: ancestors.visit(module) Expecting nothing ok Trying: nice = [d for d in duc.locals[module] if d.name() == "nice"][0] Expecting nothing ok Trying: for use in nice.users(): # we're interested in the parent of the decorator parents = ancestors.parents(use.node) # direct parent of the decorator is the function fdef = parents[-1] print(fdef.name) Expecting: aw ok Trying: import gast as ast Expecting nothing ok Trying: import beniget Expecting nothing ok Trying: class Attributes(ast.NodeVisitor): def __init__(self, module_node): # compute the def-use of the module self.chains = beniget.DefUseChains() self.chains.visit(module_node) self.users = set() # all users of `self` self.attributes = set() # attributes of current class def visit_ClassDef(self, node): # walk methods and fill users of `self` for stmt in node.body: if isinstance(stmt, ast.FunctionDef): self_def = self.chains.chains[stmt.args.args[0]] self.users.update(use.node for use in self_def.users()) self.generic_visit(node) def visit_Attribute(self, node): # any attribute of `self` is registered if node.value in self.users: self.attributes.add(node.attr) Expecting nothing ok Trying: code = "class My(object):\n def __init__(self, x): self.x = x" Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: classdef = module.body[0] Expecting nothing ok Trying: attr = Attributes(module) Expecting nothing ok Trying: attr.visit(classdef) Expecting nothing ok Trying: list(attr.attributes) Expecting: ['x'] ok ok ---------------------------------------------------------------------- Ran 145 tests in 0.263s OK Trying: import gast as ast Expecting nothing ok Trying: import beniget Expecting nothing ok Trying: class Capture(ast.NodeVisitor): def __init__(self, module_node): # initialize def-use chains self.chains = beniget.DefUseChains() self.chains.visit(module_node) self.users = set() # users of local definitions self.captured = set() # identifiers that don't belong to local users def visit_FunctionDef(self, node): # initialize the set of node using a local variable for def_ in self.chains.locals[node]: self.users.update(use.node for use in def_.users()) self.generic_visit(node) def visit_Name(self, node): # register load of identifiers not locally definied if isinstance(node.ctx, ast.Load): if node not in self.users: self.captured.add(node.id) Expecting nothing ok Trying: code = 'def foo(x):\n def bar(): return x\n return bar' Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: inner_function = module.body[0].body[0] Expecting nothing ok Trying: capture = Capture(module) Expecting nothing ok Trying: capture.visit(inner_function) Expecting nothing ok Trying: list(capture.captured) Expecting: ['x'] ok Trying: import gast as ast Expecting nothing ok Trying: import beniget Expecting nothing ok Trying: class CaptureX(ast.NodeVisitor): def __init__(self, module_node, fun): self.fun = fun # initialize use-def chains du = beniget.DefUseChains() du.visit(module_node) self.chains = beniget.UseDefChains(du) self.ancestors = beniget.Ancestors() self.ancestors.visit(module_node) self.external = list() self.visited_external = set() def visit_Name(self, node): # register load of identifiers not locally defined if isinstance(node.ctx, ast.Load): uses = self.chains.chains[node] for use in uses: try: parents = self.ancestors.parents(use.node) except KeyError: return # a builtin if self.fun not in parents: parent = self.ancestors.parentStmt(use.node) if parent not in self.visited_external: self.visited_external.add(parent) self.external.append(parent) self.rec(parent) def rec(self, node): "walk definitions to find their operands's def" if isinstance(node, ast.Assign): self.visit(node.value) # TODO: implement this for AugAssign etc Expecting nothing ok Trying: code = 'a = 1; b = [a, a]; c = len(b)\ndef foo():\n return c' Expecting nothing ok Trying: module = ast.parse(code) Expecting nothing ok Trying: function = module.body[3] Expecting nothing ok Trying: capturex = CaptureX(module, function) Expecting nothing ok Trying: capturex.visit(function) Expecting nothing ok Trying: list(map(type, capturex.external)) Expecting: [, , ] ok 1 items passed all tests: 42 tests in README.rst 42 tests in 1 items. 42 passed and 0 failed. Test passed. make[1]: Leaving directory '/build/reproducible-path/python-beniget-0.4.1' create-stamp debian/debhelper-build-stamp dh_testroot -O--buildsystem=pybuild dh_prep -O--buildsystem=pybuild dh_auto_install --destdir=debian/python3-beniget/ -O--buildsystem=pybuild I: pybuild base:311: /usr/bin/python3.12 setup.py install --root /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget running install /usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! self.initialize_options() running build running build_py running install_lib creating /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr creating /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib creating /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.12 creating /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.12/dist-packages creating /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.12/dist-packages/beniget copying /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.12_python-beniget/build/beniget/beniget.py -> /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.12/dist-packages/beniget copying /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.12_python-beniget/build/beniget/__init__.py -> /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.12/dist-packages/beniget byte-compiling /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.12/dist-packages/beniget/beniget.py to beniget.cpython-312.pyc byte-compiling /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.12/dist-packages/beniget/__init__.py to __init__.cpython-312.pyc running install_egg_info running egg_info creating beniget.egg-info writing beniget.egg-info/PKG-INFO writing dependency_links to beniget.egg-info/dependency_links.txt writing requirements to beniget.egg-info/requires.txt writing top-level names to beniget.egg-info/top_level.txt writing manifest file 'beniget.egg-info/SOURCES.txt' reading manifest file 'beniget.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'beniget.egg-info/SOURCES.txt' Copying beniget.egg-info to /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.12/dist-packages/beniget-0.4.1.egg-info Skipping SOURCES.txt running install_scripts I: pybuild base:311: /usr/bin/python3 setup.py install --root /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget running install /usr/lib/python3/dist-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated. !! ******************************************************************************** Please avoid running ``setup.py`` directly. Instead, use pypa/build, pypa/installer or other standards-based tools. See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details. ******************************************************************************** !! self.initialize_options() running build running build_py running install_lib creating /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.11 creating /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.11/dist-packages creating /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.11/dist-packages/beniget copying /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.11_python-beniget/build/beniget/beniget.py -> /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.11/dist-packages/beniget copying /build/reproducible-path/python-beniget-0.4.1/.pybuild/cpython3_3.11_python-beniget/build/beniget/__init__.py -> /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.11/dist-packages/beniget byte-compiling /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.11/dist-packages/beniget/beniget.py to beniget.cpython-311.pyc byte-compiling /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.11/dist-packages/beniget/__init__.py to __init__.cpython-311.pyc running install_egg_info running egg_info writing beniget.egg-info/PKG-INFO writing dependency_links to beniget.egg-info/dependency_links.txt writing requirements to beniget.egg-info/requires.txt writing top-level names to beniget.egg-info/top_level.txt reading manifest file 'beniget.egg-info/SOURCES.txt' reading manifest template 'MANIFEST.in' adding license file 'LICENSE' writing manifest file 'beniget.egg-info/SOURCES.txt' Copying beniget.egg-info to /build/reproducible-path/python-beniget-0.4.1/debian/python3-beniget/usr/lib/python3.11/dist-packages/beniget-0.4.1.egg-info Skipping SOURCES.txt running install_scripts dh_installdocs -O--buildsystem=pybuild dh_installchangelogs -O--buildsystem=pybuild dh_python3 -O--buildsystem=pybuild dh_installsystemduser -O--buildsystem=pybuild dh_perl -O--buildsystem=pybuild dh_link -O--buildsystem=pybuild dh_strip_nondeterminism -O--buildsystem=pybuild dh_compress -O--buildsystem=pybuild dh_fixperms -O--buildsystem=pybuild dh_missing -O--buildsystem=pybuild dh_installdeb -O--buildsystem=pybuild dh_gencontrol -O--buildsystem=pybuild dh_md5sums -O--buildsystem=pybuild dh_builddeb -O--buildsystem=pybuild dpkg-deb: building package 'python3-beniget' in '../python3-beniget_0.4.1-3_all.deb'. dpkg-genbuildinfo --build=binary -O../python-beniget_0.4.1-3_i386.buildinfo dpkg-genchanges --build=binary -O../python-beniget_0.4.1-3_i386.changes dpkg-genchanges: info: binary-only upload (no source code included) dpkg-source --after-build . dpkg-buildpackage: info: binary-only upload (no source included) dpkg-genchanges: info: not including original source code in upload I: copying local configuration I: user script /srv/workspace/pbuilder/6182/tmp/hooks/B01_cleanup starting I: user script /srv/workspace/pbuilder/6182/tmp/hooks/B01_cleanup finished I: unmounting dev/ptmx filesystem I: unmounting dev/pts filesystem I: unmounting dev/shm filesystem I: unmounting proc filesystem I: unmounting sys filesystem I: cleaning the build env I: removing directory /srv/workspace/pbuilder/6182 and its subdirectories I: Current time: Wed Apr 17 14:42:09 +14 2024 I: pbuilder-time-stamp: 1713314529