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 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 index bd3337bf..b1f84773 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,9 @@ -all: checktestdata +all: make -C support -builddeb: checktestdata +builddeb: 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..a8a65fd2 100644 --- a/problemtools/run/checktestdata.py +++ b/problemtools/run/checktestdata.py @@ -3,29 +3,24 @@ """ import os +import sys from .executable import Executable -from .errors import ProgramError -from .tools import get_tool_path 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: - raise ProgramError('Could not locate the Checktestdata program to run %s' % path) - super().__init__(Checktestdata._CTD_PATH, 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 diff --git a/pyproject.toml b/pyproject.toml index 3a99cedc..4e3f4a43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,6 +19,7 @@ dependencies = [ "PyYAML", "plasTeX>=3.0", "pydantic>=2.11", + "checktestdata>=2026.7.1", ] dynamic = [ "version" ] diff --git a/requirements.txt b/requirements.txt index 6e73c8a7..563e3133 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,4 @@ nh3 PyYAML plasTeX>=3.0 pydantic>=2.11 +checktestdata>=2026.7.1 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