Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

9 changes: 2 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
11 changes: 3 additions & 8 deletions problemtools/run/checktestdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Comment thread
mzuenni marked this conversation as resolved.

def do_compile(self) -> tuple[bool, str | None]:
"""Syntax-check the Checktestdata script
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies = [
"PyYAML",
"plasTeX>=3.0",
"pydantic>=2.11",
"checktestdata>=2026.7.1",
]
dynamic = [ "version" ]

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ nh3
PyYAML
plasTeX>=3.0
pydantic>=2.11
checktestdata>=2026.7.1
28 changes: 0 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

import setuptools
import setuptools.command.build
import setuptools.command.sdist


class BuildSupport(setuptools.Command):
Expand All @@ -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
Expand All @@ -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,
},
)
14 changes: 2 additions & 12 deletions support/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand 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)
1 change: 0 additions & 1 deletion support/checktestdata
Submodule checktestdata deleted from 38dda2