[med-svn] [Git][python-team/packages/mypy][master] 2 commits: Run autopkgtests using pybuild, just like at build-time.
Michael R. Crusoe (@crusoe)
gitlab at salsa.debian.org
Tue Mar 17 14:04:11 GMT 2026
Michael R. Crusoe pushed to branch master at Debian Python Team / packages / mypy
Commits:
2efb0851 by Michael R. Crusoe at 2026-03-16T19:05:52+01:00
Run autopkgtests using pybuild, just like at build-time.
- - - - -
b96537c8 by Michael R. Crusoe at 2026-03-17T14:53:20+01:00
d/rules: simplified test configuration
- - - - -
10 changed files:
- debian/changelog
- debian/control
- + debian/patches/clear-cflags
- + debian/patches/lib-rt-tests
- debian/patches/series
- + debian/pybuild.testfiles
- − debian/python3-mypy.install
- debian/rules
- − debian/tests/control
- − debian/tests/run-unit-test
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+mypy (1.19.1-7) UNRELEASED; urgency=medium
+
+ * Run autopkgtests using pybuild, just like at build-time.
+ * d/rules: simplified test configuration
+
+ -- Michael R. Crusoe <crusoe at debian.org> Mon, 16 Mar 2026 19:05:45 +0100
+
mypy (1.19.1-6) unstable; urgency=medium
* Revert python3-orjson for i386, and skipping of a test for i386. It
=====================================
debian/control
=====================================
@@ -2,7 +2,7 @@ Source: mypy
Maintainer: Debian Python Team <team+python at tracker.debian.org>
Uploaders: Michael R. Crusoe <crusoe at debian.org>
Section: utils
-Testsuite: autopkgtest-pkg-python
+Testsuite: autopkgtest-pkg-pybuild
Priority: optional
Build-Depends: debhelper-compat (= 13),
dh-sequence-python3,
=====================================
debian/patches/clear-cflags
=====================================
@@ -0,0 +1,50 @@
+From: Michael R. Crusoe <crusoe at debian.org>
+Subject: clear out CFLAGS from the environement
+
+While packaging from Debian we set
+
+CFLAGS=-g -O2 -Werror=implicit-function-declaration -ffile-prefix-map=/build/package/package=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection
+
+This causes the following test failures:
+
+FAILED mypyc/test/test_run.py::TestRun::run-i64.test::testI64GlueMethodsAndInheritance - data: /build/package/package/mypyc/test-data/run-i64.test:1338:
+FAILED mypyc/test/test_run.py::TestRun::run-bools.test::testBoolOps - data: /build/package/package/mypyc/test-data/run-bools.test:17:
+FAILED mypyc/test/test_run.py::TestRun::run-i64.test::testI64ErrorValuesAndUndefined - data: /build/package/package/mypyc/test-data/run-i64.test:519:
+FAILED mypyc/test/test_run.py::TestRun::run-i64.test::testI64BasicOps - data: /build/package/package/mypyc/test-data/run-i64.test:1:
+FAILED mypyc/test/test_run.py::TestRun::run-i64.test::testI64DefaultArgValues - data: /build/package/package/mypyc/test-data/run-i64.test:906:
+
+All with the same underlying error:
+python3.13: /usr/include/python3.13/object.h:352: Py_SIZE: Assertion `ob->ob_type != &PyLong_Type' failed.
+--- mypy.orig/mypyc/test/test_run.py
++++ mypy/mypyc/test/test_run.py
+@@ -35,6 +35,7 @@
+ show_c,
+ use_custom_builtins,
+ )
++import pytest
+
+ files = [
+ "run-async.test",
+@@ -151,13 +152,15 @@
+ strict_dunder_typing = False
+
+ def run_case(self, testcase: DataDrivenTestCase) -> None:
+- # setup.py wants to be run from the root directory of the package, which we accommodate
+- # by chdiring into tmp/
+- with (
+- use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase),
+- chdir_manager("tmp"),
+- ):
+- self.run_case_inner(testcase)
++ with pytest.MonkeyPatch.context() as mp:
++ mp.delenv("CFLAGS", raising=False)
++ # setup.py wants to be run from the root directory of the package, which we accommodate
++ # by chdiring into tmp/
++ with (
++ use_custom_builtins(os.path.join(self.data_prefix, ICODE_GEN_BUILTINS), testcase),
++ chdir_manager("tmp"),
++ ):
++ self.run_case_inner(testcase)
+
+ def run_case_inner(self, testcase: DataDrivenTestCase) -> None:
+ if not os.path.isdir(WORKDIR): # (one test puts something in build...)
=====================================
debian/patches/lib-rt-tests
=====================================
@@ -0,0 +1,22 @@
+From: Michael R. Crusoe <crusoe at debian.org>
+Subject: discover lib-rt source more flexibly
+--- mypy.orig/mypyc/test/test_external.py
++++ mypy/mypyc/test/test_external.py
+@@ -8,7 +8,7 @@
+ import tempfile
+ import unittest
+
+-base_dir = os.path.join(os.path.dirname(__file__), "..", "..")
++from .config import PREFIX
+
+
+ class TestExternal(unittest.TestCase):
+@@ -37,7 +37,7 @@
+ "--run-capi-tests",
+ ],
+ env=env,
+- cwd=os.path.join(base_dir, "mypyc", "lib-rt"),
++ cwd=os.path.join(PREFIX, "mypyc", "lib-rt"),
+ )
+ # Run C unit tests.
+ env = os.environ.copy()
=====================================
debian/patches/series
=====================================
@@ -1,3 +1,5 @@
+clear-cflags
+lib-rt-tests
hint-typeshed-package
verbose
intersphinx
=====================================
debian/pybuild.testfiles
=====================================
@@ -0,0 +1,4 @@
+mypy_self_check.ini
+pyproject.toml
+setup.cfg
+conftest.py
=====================================
debian/python3-mypy.install deleted
=====================================
@@ -1,3 +0,0 @@
-mypyc/lib-rt/setup.py usr/lib/python3/dist-packages/mypyc/lib-rt
-mypyc/lib-rt/*.cc usr/lib/python3/dist-packages/mypyc/lib-rt
-mypyc/external/googletest usr/lib/python3/dist-packages/mypyc/external
=====================================
debian/rules
=====================================
@@ -1,28 +1,31 @@
#!/usr/bin/make -f
-export DH_VERBOSE=1
+#export DH_VERBOSE=1
export PYBUILD_DESTDIR_python3=debian/python3-mypy
export PYBUILD_NAME=mypy
-PY3VERS=$(shell py3versions -vs)
include /usr/share/dpkg/default.mk
-
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
+export DEB_CFLAGS_MAINT_APPEND += -Wno-misleading-indentation
ifneq (,$(filter $(DEB_HOST_ARCH),armel armhf mips64el hppa riscv64 mipsel alpha ia64 m68k powerpc sh4 sparc64 hurd-i386 i386 x32 hurd-amd64))
export MYPYC_MULTI_FILE=1
endif
-
ifneq ($(filter pkg.mypy.multifile,$(DEB_BUILD_PROFILES)),)
export MYPYC_MULTI_FILE=1
endif
-
-export DEB_CFLAGS_MAINT_APPEND += -Wno-misleading-indentation
-
export MYPYC_DEBUG_LEVEL=2
-
ifneq ($(filter pkg.mypy.o1,$(DEB_BUILD_PROFILES)),)
export MYPYC_OPT_LEVEL=1
endif
+export MYPY_TEST_PREFIX=$(CURDIR)
+export TEST_MYPYC=1
+export PYBUILD_TEST_ARGS=$(DEB_BUILD_OPTION_PARALLEL:%=-n%) \
+ -o python_files=test*.py \
+ -k 'not (testCustomTypeshedDirWithRelativePathDoesNotCrash or testNoPython3StubAvailable or testIgnoreImportIfNoPython3StubAvailable or PEP561Suite or testDaemonStatusKillRestartRecheck)' \
+ -o python_classes= -o python_functions= --pyargs mypy.test mypyc.test
+# testIgnoreImportIfNoPython3StubAvailable fails due to scribe not being installed (it isn't packaged for Debian)
+# testNoPython3StubAvailable no longer work because python3-typeshed includes docutils types, which it isn't expecting
+# PEP561Suite due to needing internet access to pypi.org
%:
dh $@ --buildsystem=pybuild
@@ -76,9 +79,8 @@ execute_after_dh_auto_install:
execute_after_dh_python3:
rm -rf debian/python3-mypy/usr/lib/python3/dist-packages/mypyc/doc/
-override_dh_auto_test-arch:
+execute_before_dh_auto_test-arch:
ifeq (,$(filter nocheck,$(DEB_BUILD_PROFILES)))
- export TEST_MYPYC=1
PYBUILD_SYSTEM=custom \
PYBUILD_TEST_ARGS="{interpreter} -m mypy \
--config-file {dir}/mypy_self_check.ini -p mypy" dh_auto_test
@@ -88,15 +90,6 @@ ifeq (,$(filter nocheck,$(DEB_BUILD_PROFILES)))
PYBUILD_SYSTEM=custom \
PYBUILD_TEST_ARGS="{interpreter} -m mypy \
--config-file {dir}/mypy_self_check.ini setup.py" dh_auto_test
- dh_auto_install
- set -e; for v in $(PY3VERS); do \
- env -u CFLAGS PYTHONPATH=$$(pybuild --print build_dir --pyver $$v | awk '{ print $$3 }') PATH=$$PATH:$(CURDIR)/debian/python3-mypy/usr/bin/ python$$v -m pytest $(DEB_BUILD_OPTION_PARALLEL:%=-n%) \
- -o testpaths="mypy/test mypyc/test" -o python_files=test*.py -k 'not (testCustomTypeshedDirWithRelativePathDoesNotCrash or testNoPython3StubAvailable or testIgnoreImportIfNoPython3StubAvailable or PEP561Suite or testDaemonStatusKillRestartRecheck)' \
- -o python_classes= -o python_functions= ; \
- done
- # testIgnoreImportIfNoPython3StubAvailable fails due to scribe not being installed (it isn't packaged for Debian)
- # testNoPython3StubAvailable no longer work because python3-typeshed includes docutils types, which it isn't expecting
- # PEP561Suite due to needing internet access to pypi.org
endif
override_dh_auto_test-indep:
=====================================
debian/tests/control deleted
=====================================
@@ -1,15 +0,0 @@
-Tests: run-unit-test
-Depends: gcc, g++,
- @,
- python3-all-dev,
- python3-attr,
- python3-lxml,
- python3-pytest (>= 8.1.0),
- python3-pytest-xdist,
- python3-setuptools,
- python3-tomli,
- python3-orjson [!i386 !alpha !hppa !m68k !sh4 !x32],
- python3-typeshed (>= 0.0~git20221107.4f381af),
- python3-virtualenv,
- python3-all-venv
-Restrictions: allow-stderr
=====================================
debian/tests/run-unit-test deleted
=====================================
@@ -1,49 +0,0 @@
-#!/bin/bash
-set -ex
-
-pkg=mypy
-
-START="$(dirname "$(dirname "$(dirname "$(readlink -fm "$0")")")")"
-
-if [ "$AUTOPKGTEST_TMP" = "" ] ; then
- AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
- trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
-fi
-
-cd "$AUTOPKGTEST_TMP"
-
-mypy --help
-mypyc --help
-stubgen --help
-stubtest --help
-
-export TEST_MYPYC=1
-
-rm -Rf mypy mypyc
-
-cp -r /usr/lib/python3/dist-packages/mypy ./
-cp -r /usr/lib/python3/dist-packages/mypyc ./
-cp ${START}/conftest.py ./
-cp -r ${START}/mypyc/test-data ./mypyc/
-cp -r ${START}/test-data ./
-
-export DEB_BUILD_MAINT_OPTIONS=hardening=+all
-export MYPYC_DEBUG_LEVEL=2
-export TEST_MYPYC=1
-
-set -e; for v in $(py3versions -vs) ; do
-python${v} -m pytest -n $(nproc) -v -o testpaths="mypy/test mypyc/test" -o python_files=test*.py -o python_classes= -o python_functions= -k "not (test_bad_eq_version_check or test_bad_ge_version_check or test_parse_invalid_case or test_parse_invalid_section or test_update_data or testDaemonStatusKillRestartRecheck or testErrorCodeMissingModule or testErrorFromGoogleCloud or testCustomTypeshedDirWithRelativePathDoesNotCrash or testLibraryStubsNotInstalled or testIgnoreImportIfNoPython3StubAvailable or testNoPython3StubAvailable or testAttrsClass_semanal or testRunAsyncMiscTypesInEnvironment)"
-done
-
-# testErrorCodeMissingModule: different error message on Debian
-# testErrorFromGoogleCloud: different error message on Debian
-# testCustomTypeshedDirWithRelativePathDoesNotCrash: ???
-# testLibraryStubsNotInstalled: different error message on Debian
-# testIgnoreImportIfNoPython3StubAvailable: package 'scribe' in not yet available in Debian
-# testNoPython3StubAvailable: different error message on Debian
-# testAttrsClass_semanal: ???
-# testRunAsyncMiscTypesInEnvironment: ???
-
-rm -Rf mypy/typeshed
-/usr/bin/mypy --config-file ${START}/mypy_self_check.ini -p mypy
-/usr/bin/mypy --config-file ${START}/mypy_self_check.ini -p mypyc
View it on GitLab: https://salsa.debian.org/python-team/packages/mypy/-/compare/3581c326ce8ec38b08f41e3a8ec0cf863bd9eef1...b96537c8e6ef2e0ec1007ca37292935aba3129ff
--
View it on GitLab: https://salsa.debian.org/python-team/packages/mypy/-/compare/3581c326ce8ec38b08f41e3a8ec0cf863bd9eef1...b96537c8e6ef2e0ec1007ca37292935aba3129ff
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260317/4b1a2fa2/attachment-0001.htm>
More information about the debian-med-commit
mailing list