From 3c7f69cbeb4841b43d2e340e80ec6f269b8dbdae Mon Sep 17 00:00:00 2001 From: mzuenni Date: Tue, 30 Jun 2026 13:26:42 +0200 Subject: [PATCH 1/7] use pyctd --- .gitmodules | 3 --- Makefile | 14 -------------- problemtools/run/checktestdata.py | 8 ++++---- requirements.txt | 1 + setup.py | 28 ---------------------------- support/Makefile | 14 ++------------ support/checktestdata | 1 - 7 files changed, 7 insertions(+), 62 deletions(-) delete mode 100644 .gitmodules delete mode 100644 Makefile delete mode 160000 support/checktestdata diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 078706c2..00000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "checktestdata"] - path = support/checktestdata - url = https://github.com/DOMjudge/checktestdata diff --git a/Makefile b/Makefile deleted file mode 100644 index bd3337bf..00000000 --- a/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -all: checktestdata - make -C support - -builddeb: checktestdata - dpkg-buildpackage -us -uc -tc -b - -checktestdata: support/checktestdata/bootstrap - -support/checktestdata/bootstrap: - git submodule update --init - -clean: - make -C support clean - rm -rf problemtools.egg-info build diff --git a/problemtools/run/checktestdata.py b/problemtools/run/checktestdata.py index 939c1e30..6b838989 100644 --- a/problemtools/run/checktestdata.py +++ b/problemtools/run/checktestdata.py @@ -3,6 +3,7 @@ """ import os +import shutil from .executable import Executable from .errors import ProgramError from .tools import get_tool_path @@ -11,17 +12,16 @@ class Checktestdata(Executable): """Wrapper class for running Checktestdata scripts.""" - _CTD_PATH = get_tool_path('checktestdata') - def __init__(self, path): """Create a Checktestdata wrapper. Args: path (str): path to .ctd source file """ - if Checktestdata._CTD_PATH is None: + pyctd = shutil.which("pyctd") + if pyctd is None: raise ProgramError('Could not locate the Checktestdata program to run %s' % path) - super().__init__(Checktestdata._CTD_PATH, args=[path]) + super().__init__(pyctd, args=[path]) def __str__(self) -> str: """String representation""" diff --git a/requirements.txt b/requirements.txt index 6e73c8a7..8ad36bad 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ nh3 PyYAML plasTeX>=3.0 pydantic>=2.11 +checktestdata>=2026.4.5 diff --git a/setup.py b/setup.py index 5cda9d11..d94164ed 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,6 @@ import setuptools import setuptools.command.build -import setuptools.command.sdist class BuildSupport(setuptools.Command): @@ -27,22 +26,6 @@ def run(self): subprocess.check_call(command) -class CheckoutChecktestdata(setuptools.Command): - """A custom command to build the support programs.""" - - description = 'checkout the git submodule for checktestdata (via make)' - - def initialize_options(self) -> None: - pass - - def finalize_options(self) -> None: - pass - - def run(self): - command = ['make', 'checktestdata'] - subprocess.check_call(command) - - # It's *very* unclear from setuptools' documentation what the best way to do this is. # # I think that the ideal way would be to insert BuildSupport as a SubCommand @@ -55,20 +38,9 @@ def run(self): super().run() -# To make python -m build work from a fresh checkout, we also need to hook sdist to -# do a git submodule checkout so that the source code for checktestdata is included -# in the sdist (an alternative approach would be to include .git in the sdist (eww). -class sdist(setuptools.command.sdist.sdist): - def run(self): - self.run_command('checkout_checktestdata') - super().run() - - setuptools.setup( cmdclass={ 'build_support': BuildSupport, 'build': build, - 'checkout_checktestdata': CheckoutChecktestdata, - 'sdist': sdist, }, ) diff --git a/support/Makefile b/support/Makefile index d90a363b..d1ad9368 100644 --- a/support/Makefile +++ b/support/Makefile @@ -1,8 +1,7 @@ PACKAGE=problemtools -CONF=checktestdata/config.mk -PROGRAMS=checktestdata default_validator interactive +PROGRAMS=default_validator interactive -all: $(CONF) +all: $(foreach prog,$(PROGRAMS),$(MAKE) -C $(prog) &&) true install: all @@ -12,14 +11,5 @@ install: all cp viva/viva.jar $(DESTDIR) install viva/viva.sh $(DESTDIR) -$(CONF): checktestdata/bootstrap - cd checktestdata && ./bootstrap - -checktestdata/bootstrap: - git submodule update --init - clean: $(foreach prog,$(PROGRAMS),$(MAKE) -C $(prog) clean;) - -distclean: clean - rm -f $(CONF) diff --git a/support/checktestdata b/support/checktestdata deleted file mode 160000 index 38dda218..00000000 --- a/support/checktestdata +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 38dda218dff402a13319c552f363bbf7444ac1a1 From 14776a577e8fac3abfb284cd27467a51ebe8c28a Mon Sep 17 00:00:00 2001 From: mzuenni Date: Tue, 30 Jun 2026 13:40:43 +0200 Subject: [PATCH 2/7] reformat --- problemtools/run/checktestdata.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/problemtools/run/checktestdata.py b/problemtools/run/checktestdata.py index 6b838989..2f5dd5eb 100644 --- a/problemtools/run/checktestdata.py +++ b/problemtools/run/checktestdata.py @@ -6,7 +6,6 @@ import shutil from .executable import Executable from .errors import ProgramError -from .tools import get_tool_path class Checktestdata(Executable): @@ -18,7 +17,7 @@ def __init__(self, path): Args: path (str): path to .ctd source file """ - pyctd = shutil.which("pyctd") + pyctd = shutil.which('pyctd') if pyctd is None: raise ProgramError('Could not locate the Checktestdata program to run %s' % path) super().__init__(pyctd, args=[path]) From f15afa06637ed4c6c06b790cd48d2fad70d9b29a Mon Sep 17 00:00:00 2001 From: mzuenni Date: Tue, 30 Jun 2026 13:46:22 +0200 Subject: [PATCH 3/7] fix makefile --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..b1f84773 --- /dev/null +++ b/Makefile @@ -0,0 +1,9 @@ +all: + make -C support + +builddeb: + dpkg-buildpackage -us -uc -tc -b + +clean: + make -C support clean + rm -rf problemtools.egg-info build From 40ed80b937845fc5c067f8d4049c7856236b2f71 Mon Sep 17 00:00:00 2001 From: mzuenni Date: Tue, 30 Jun 2026 14:12:58 +0200 Subject: [PATCH 4/7] remove checktestdata --- .github/workflows/pypi.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index d89ab404..61a8b690 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -23,8 +23,6 @@ jobs: fetch-depth: 0 # We need full history for setuptools_scm to figure out version - name: Set safe directory (work around checkout not doing that properly for containers) run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - - name: Install build dependencies for checktestdata - run: yum -y install boost-devel gmp-devel - name: Build sdist (and broken wheel) run: /opt/python/cp311-cp311/bin/python -m build - name: Repair wheel From 2106046386f6952a290d5abf923e1fde08e043c6 Mon Sep 17 00:00:00 2001 From: mzuenni Date: Tue, 30 Jun 2026 14:38:54 +0200 Subject: [PATCH 5/7] add missing dependency --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 3a99cedc..e22054ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ dependencies = [ "PyYAML", "plasTeX>=3.0", "pydantic>=2.11", + "checktestdata>=2026.4.5", ] dynamic = [ "version" ] From 710f23915797d7907f293988ce46640f5fca2225 Mon Sep 17 00:00:00 2001 From: mzuenni Date: Tue, 30 Jun 2026 22:23:02 +0200 Subject: [PATCH 6/7] change checktestdata invocation --- problemtools/run/checktestdata.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/problemtools/run/checktestdata.py b/problemtools/run/checktestdata.py index 2f5dd5eb..a8a65fd2 100644 --- a/problemtools/run/checktestdata.py +++ b/problemtools/run/checktestdata.py @@ -3,9 +3,8 @@ """ import os -import shutil +import sys from .executable import Executable -from .errors import ProgramError class Checktestdata(Executable): @@ -17,14 +16,11 @@ def __init__(self, path): Args: path (str): path to .ctd source file """ - pyctd = shutil.which('pyctd') - if pyctd is None: - raise ProgramError('Could not locate the Checktestdata program to run %s' % path) - super().__init__(pyctd, args=[path]) + super().__init__(sys.executable, args=['-m', 'checktestdata', path]) def __str__(self) -> str: """String representation""" - return '%s' % (self.args[0]) + return '%s' % (self.args[-1]) def do_compile(self) -> tuple[bool, str | None]: """Syntax-check the Checktestdata script From eaff7186e0f1e0add61cc5862106f1196176118f Mon Sep 17 00:00:00 2001 From: mzuenni Date: Wed, 1 Jul 2026 23:03:04 +0200 Subject: [PATCH 7/7] bump pyctd version --- pyproject.toml | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e22054ad..4e3f4a43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ dependencies = [ "PyYAML", "plasTeX>=3.0", "pydantic>=2.11", - "checktestdata>=2026.4.5", + "checktestdata>=2026.7.1", ] dynamic = [ "version" ] diff --git a/requirements.txt b/requirements.txt index 8ad36bad..563e3133 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ nh3 PyYAML plasTeX>=3.0 pydantic>=2.11 -checktestdata>=2026.4.5 +checktestdata>=2026.7.1