Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
409 commits
Select commit Hold shift + click to select a range
d745f6e
Another escape
Matistjati Apr 8, 2025
d4e27a2
More careful with images
Matistjati Apr 8, 2025
fdde1a4
Make samplexss more focused
Matistjati Apr 8, 2025
4c0cc40
Merge pull request #293 from gkreitz/fix_mypy_errors
pehrsoderman Apr 8, 2025
3ded4a4
Experimentally reuse normal LaTeX rendering
Matistjati Apr 9, 2025
9134f30
Merge remote-tracking branch 'problemtools/develop' into pandoc
Matistjati Apr 9, 2025
79b5a5d
Use problemtools problem2pdf to handle md -> pdf
Matistjati Apr 9, 2025
fcda106
Cleanup
Matistjati Apr 9, 2025
47bda29
librsvg out of focus for this PR
Matistjati Apr 9, 2025
054448e
Ensure nh3
Matistjati Apr 9, 2025
ecdb6c4
Remove ghostscript sanitization. If it wasn't used before, it probabl…
Matistjati Apr 9, 2025
690215f
Add nh3 to deb build
Matistjati Apr 13, 2025
77cb2c9
Linting
Matistjati Apr 13, 2025
2e7653f
Add back ghostscript sanitization
Matistjati Apr 13, 2025
51f5539
Remove unnecessary test
Matistjati Apr 13, 2025
72f7697
Add make clean to clean up support and the mess left by setuptools
gkreitz Apr 22, 2025
277e05b
Change debian packaging to dh_virtualenv
gkreitz Apr 22, 2025
07081b7
Update readme, adjusting installation instructions so we can use pip …
gkreitz Apr 22, 2025
ba36802
Convert from setup.py to pyproject.toml (and use setuptools-scm for v…
gkreitz Apr 24, 2025
6d14502
Hook sdist to make python -m build work on a clean checkout
gkreitz Apr 24, 2025
530f6d7
Update wrapper scripts and README
gkreitz Apr 24, 2025
a072f3d
Update CI workflow to match readme for build requirements (plus build…
gkreitz Apr 24, 2025
900106c
Force dh_virtualenv to use builtin venv (debugging CI crash)
gkreitz Apr 24, 2025
dc3b704
Restructure CI/CD to separate deb building from python unit tests
gkreitz Apr 24, 2025
461da03
Stop exposing __version__, users should use importlib.metadata.versio…
gkreitz Apr 24, 2025
d99b67e
Hardcode path to python, as dh_virtualenv fails to discover it in CI
gkreitz Apr 24, 2025
5355115
Merge pull request #298 from gkreitz/297_modernize_build
gkreitz Apr 24, 2025
8c5993a
Clean up version parsing. Accept 2023-07-draft and 2023-07 version st…
gkreitz May 6, 2025
b3fcb6d
Add pydantic models for parsing problem.yaml
gkreitz May 6, 2025
23034c6
Limit problem.yaml config to only system defaults
gkreitz May 7, 2025
a1a389e
Use new metadata parsing mechanism, and start parsing config for 2023…
gkreitz May 7, 2025
18df5da
Bump python version to 3.11
gkreitz May 7, 2025
fb2dd8a
Merge pull request #300 from gkreitz/support_2023_07_config
pehrsoderman May 7, 2025
486ebcf
Move tests to outside of the package
gkreitz May 9, 2025
71620dc
Update manifest to include tests support files in sdist, and remove s…
gkreitz May 9, 2025
1679a71
Merge pull request #301 from gkreitz/move_tests_from_package
gkreitz May 9, 2025
56f302e
Remove old hack for plasTeX argument (we require >= 3.0 now)
gkreitz May 9, 2025
4c85afc
Clean up incompletely removed plastex_escape hack. Remove unused vari…
gkreitz May 9, 2025
1ccce9a
Clean up unused variables, old io import, and multiple commands on lines
gkreitz May 9, 2025
553487e
Clean up unused import and comparison with None
gkreitz May 9, 2025
c1a36e0
Ruff format
gkreitz May 9, 2025
0bafa01
Clean up imports
gkreitz May 9, 2025
db3990f
Fix minor things flagged by ruff
gkreitz May 9, 2025
d73c7e3
Remove unused variables in tests
gkreitz May 9, 2025
b765de6
Add ruff configuration
gkreitz May 9, 2025
53eb05c
Merge pull request #303 from gkreitz/ruff_and_other_misc_fixes
pehrsoderman May 9, 2025
0a607b0
Apply ruff formatting
gkreitz May 10, 2025
a5377a7
Merge pull request #304 from gkreitz/ruff_format_files
pehrsoderman May 12, 2025
bc67549
Add ruff pre-commit hook
gkreitz May 12, 2025
8d95ec5
Replace flake8 with ruff (both linting and formatting)
gkreitz May 12, 2025
915164f
Merge pull request #305 from gkreitz/ruff_precommit_and_ci
gkreitz May 12, 2025
d3e6222
Fix incorrect formatting of pydantic errors
gkreitz May 12, 2025
0a7be8d
Move is_interactive and is_scoring to be read from problem metadata d…
gkreitz May 12, 2025
28d4ab7
Let Problem read and store problem format information. Warn about inc…
gkreitz May 12, 2025
39c1f03
Fix validator discovery for 2023-07. Run through all validation for 2…
gkreitz May 12, 2025
733f88a
Merge pull request #306 from gkreitz/verify_2023_hello_world
pehrsoderman May 12, 2025
898a786
Merged with developed
Matistjati May 12, 2025
63fd2e8
Add nh3 as dependency
Matistjati May 12, 2025
5f96852
Fix test import path
Matistjati May 12, 2025
754f468
Apply ruff formatting
Matistjati May 12, 2025
cf5441c
Suggest a new uuid when uuid is missing from config
gkreitz May 13, 2025
513c39d
Merge pull request #307 from gkreitz/be_more_helpful_when_uuid_is_mis…
pehrsoderman May 13, 2025
3063cb0
More robust footnote finding
Matistjati May 12, 2025
a6be656
Don't double-escape HTML in samples
Matistjati May 14, 2025
14e0c84
Ghostscript fixes and tests
Matistjati May 14, 2025
4d49ebe
Merge pull request #274 from Matistjati/pandoc
gkreitz May 14, 2025
897d0a8
Fix loading a problem with empty problem.yaml and with no statements
gkreitz May 15, 2025
c197977
Add utility method to load problem metadata, including names from sta…
gkreitz May 15, 2025
926aea3
Use load_metadata in verifyproblem. Add temporary fallback conf to fi…
gkreitz May 15, 2025
a9ecb43
Use load_metadata in statement_util
gkreitz May 15, 2025
5fa0a30
Add apt-get update in workflow to unbreak CI
gkreitz May 15, 2025
040e8cd
Convert some example problems to 2023-07-draft
Matistjati May 15, 2025
c071025
Add uuid to guess and oddecho
Matistjati May 15, 2025
4c41c4e
Better formatting and error for output_validators
Matistjati May 15, 2025
5af2297
Merge pull request #308 from gkreitz/refactor_metadata_loading
pehrsoderman May 16, 2025
333ff15
Add missing build requirements to debian build
pehrsoderman May 16, 2025
0981a0b
Update pyproject
pehrsoderman May 16, 2025
b31e742
Merge pull request #313 from pehrsoderman/add-missing-dependencies-venv
gkreitz May 16, 2025
3b18530
Merge remote-tracking branch 'upstream/develop' into update-problems
Matistjati May 16, 2025
6371df6
Remove now-duplicated import
Matistjati May 16, 2025
1e27789
Merge pull request #309 from Matistjati/update-problems
gkreitz May 16, 2025
4284587
Remove (AFAICT, broken) support for ancient tex statements (0.1)
gkreitz May 15, 2025
621497b
Fix bug where we complained about missing show_test_data_groups for n…
gkreitz May 15, 2025
13cea0b
Default language to en. Remove unused --format-version
gkreitz May 15, 2025
6dbb762
Pass Template a filename to render, and pass that through to the late…
gkreitz May 15, 2025
d3bf5b6
Rename problem.md to problem.en.md in tests to follow 2023-07-draft
gkreitz May 15, 2025
a2c1b52
Refactor of rendering: unify statement finding code, and use Path more
gkreitz May 15, 2025
5739668
Use statement_util to find statements. Add more checks. Try rendering…
gkreitz May 15, 2025
6bb9e58
Make mypy more picky, also checking PlasTeX usage
gkreitz May 15, 2025
949d966
Simplify temporary file usage in markdown -> pdf flow
gkreitz May 16, 2025
5184cc8
Fix bug where problem2html cd:s to bad directory, crashing validation…
gkreitz May 16, 2025
2c0f7ba
Update link to kattis controlled domain.
pehrsoderman May 16, 2025
6e9add7
Merge pull request #311 from gkreitz/refactor_statement_handling
gkreitz May 16, 2025
773424b
Merge pull request #314 from pehrsoderman/update-pyproject
gkreitz May 16, 2025
450d453
Replace formatversion.FormatData with a StrEnum
gkreitz May 16, 2025
27e1397
Add some documentation in the readme regarding current state of forma…
gkreitz May 16, 2025
98290cf
Merge pull request #316 from gkreitz/update_readme_re_format_versions
pehrsoderman May 16, 2025
bd92eee
Merge pull request #315 from gkreitz/refactor_formatversion
gkreitz May 16, 2025
81970c0
Add colorlog to get colors for warnings and errors #312
gkreitz May 16, 2025
af94d62
Add Swedish problem names
gkreitz May 16, 2025
b19db2a
Fix the logging plasTeX destroys
gkreitz May 16, 2025
e0410d3
Remove accidental commit
gkreitz May 16, 2025
f4d674c
Fix misleading error when missing problem statemetns
gkreitz May 16, 2025
1234a05
Merge pull request #317 from gkreitz/colorlog_and_small_fixes
pehrsoderman May 16, 2025
75204d7
Improve image handling in markdown statements
gkreitz May 19, 2025
f136b8e
Change URL to one that passes filename suffix filter
gkreitz May 19, 2025
7add20a
Restructure error counters. Fix errors happening prior to check being…
gkreitz May 20, 2025
dd46488
Fix --bail_on_error and --werror being ignored before check
gkreitz May 20, 2025
35609c9
Refactor problem loading so we can do fatal errors in setup
gkreitz May 20, 2025
ab87513
Check file and directory names per standard
gkreitz May 20, 2025
f3a21ff
Make missing/compilation failure in grader/output validator fatal
gkreitz May 20, 2025
6d43e60
Merge pull request #318 from gkreitz/markdown_image_fixes
pehrsoderman May 21, 2025
1103a28
Merge pull request #319 from gkreitz/restructure_setup_error_handling
pehrsoderman May 21, 2025
705fae1
Restore old API for accessing parts of a problem. Simplify part setup
gkreitz May 21, 2025
9f80544
Change type of attachments.attachments from list[str] to list[Path]
gkreitz May 21, 2025
269e667
Convert Problem.metadata to a property to align better with other naming
gkreitz May 21, 2025
0ffad3e
Expose computed timelim
gkreitz May 22, 2025
a6b4813
Add back problemtools.run.get_tool_path to API
gkreitz May 22, 2025
36134ca
Merge pull request #320 from gkreitz/restore_old_problem_api
gkreitz May 22, 2025
1f5a96c
Large restructure of how our docker images are built.
gkreitz May 23, 2025
d86f384
Remove old Dockerfile in root, unused afaict
gkreitz May 23, 2025
b31c25e
Add marker to let mypy use our type annotations
gkreitz May 23, 2025
6e80dc6
Replace authors with Kattis AB (pypi only shows one). Set required py…
gkreitz May 23, 2025
8418e70
Add script to build packages for pypi
gkreitz May 23, 2025
c972705
Fix incorrect error when verifying different. Add helpful hint when d…
gkreitz May 23, 2025
5b039f1
Merge pull request #324 from gkreitz/fix_incorrect_error
gkreitz May 23, 2025
cae4199
Merge pull request #323 from gkreitz/pypi_preparation
pehrsoderman May 23, 2025
6f70615
Merge pull request #321 from gkreitz/restructure_docker_build
pehrsoderman May 23, 2025
c90ad52
Use problemtools/githubci image in workflow. Run verifyproblem on all…
gkreitz May 27, 2025
e4fcb63
Merge pull request #326 from gkreitz/run_veriyproblem_in_ci
gkreitz May 27, 2025
df305e1
Check for incompatible types. Warn for unimplemented types
gkreitz May 27, 2025
8dec935
Check format of interaction samples. #277 Don't warn about empty samp…
gkreitz May 27, 2025
266caa3
Add type methods for all types. Add convenience methods on Problem fo…
gkreitz May 27, 2025
b5cb10c
Improve warning for non-standard output validator languages #258
gkreitz May 27, 2025
7237bfc
Merge pull request #327 from gkreitz/statement_and_type_checks
pehrsoderman May 27, 2025
bd5eacc
Remove generatedata (never made it into the standard)
gkreitz May 28, 2025
a611a38
Fix pytest dropping a guess.pdf in working directory. Check PDF magic…
gkreitz May 28, 2025
1169583
Merge pull request #328 from gkreitz/remove_generatedata
pehrsoderman May 28, 2025
a3e59a8
Add -d flag to update_docker to allow easier testing locally
gkreitz May 28, 2025
176458b
Fix broken git clone command (`${TAG}` expanded to empty string)
gkreitz May 28, 2025
b7b769e
Fix silly error in docker file, causing apt-get update not to run
gkreitz May 28, 2025
115e0a3
Merge pull request #329 from gkreitz/fix_docker_build
pehrsoderman May 28, 2025
4d51f8f
Add -d option to allow building in a dirty rep (to facilitate develop…
gkreitz Jun 4, 2025
100d993
Workflow that builds and pushes a package to testpypi
gkreitz Jun 4, 2025
5900179
Merge pull request #332 from gkreitz/322_pypi_github_action
gkreitz Jun 4, 2025
5b8d8a1
Fix version computation when we build pypi packages
gkreitz Jun 4, 2025
a8d0982
Merge pull request #333 from gkreitz/322_fix_version_in_pypi
gkreitz Jun 4, 2025
5db5535
Fix syntax error in github workflow file
gkreitz Jun 4, 2025
e651249
Merge pull request #334 from gkreitz/322_fix_version_in_pypi_take_2
gkreitz Jun 4, 2025
bf24a9f
Fix bug where we crashed if we attempted to load/check twice
gkreitz Jun 3, 2025
41ad547
Error if problem name exits in a language without a statement
gkreitz Jun 3, 2025
c571d56
Add utility function uses_default_validator for output validation. Wa…
gkreitz Jun 3, 2025
ab1a2da
Fix new mypy error in mypy 1.16
gkreitz Jun 3, 2025
42ec59d
Fix missing support for imgbasedir in md2html
gkreitz Jun 4, 2025
a8e80b1
Fix typo in Dockerfile.full causing it to lack a lot of languages
gkreitz Jun 4, 2025
85db18e
Merge pull request #330 from gkreitz/misc_small_fixes
pehrsoderman Jun 4, 2025
75d3887
Remove year from license - IANAL, but AFAICT it's not needed
gkreitz Jun 5, 2025
f18ddf2
Add warning to pypi package script pointing to the github action now …
gkreitz Jun 5, 2025
a817d2d
Change update_docker to default to building from master (but keep :de…
gkreitz Jun 5, 2025
1667f71
Add convenient way to run docker. Document need to install languages.
gkreitz Jun 5, 2025
6aa5706
Add script with new release procedure
gkreitz Jun 5, 2025
4674e2a
Update debian changelog for release 1.20250605
gkreitz Jun 5, 2025
1f9fee7
Merge pull request #337 from gkreitz/release_fix
gkreitz Jun 5, 2025
da34401
Merge pull request #338 from Kattis/develop
gkreitz Jun 5, 2025
2cebe8d
Fix sample missing from rendered problem statements
gkreitz Jun 6, 2025
fd25ff2
Merge pull request #339 from gkreitz/fix_missing_sample_from_statements
gkreitz Jun 6, 2025
4214455
Update debian changelog for release 1.20250606
gkreitz Jun 6, 2025
babb11d
Merge pull request #340 from gkreitz/rel_1_20250605
gkreitz Jun 6, 2025
f7dbdc9
Fix multithreading crash
Matistjati Jun 12, 2025
3be768f
Merge pull request #342 from Matistjati/fix-multithreading
gkreitz Jun 12, 2025
2923b1e
Better message if judge answer file gets judge error
Matistjati Jun 16, 2025
d01efc0
Robuster finding judge error tc path
Matistjati Jun 16, 2025
758a7bc
Cleaner testcase path extraction
Matistjati Jun 16, 2025
94d37f3
Merge pull request #343 from Matistjati/better-judge-ans-je-message
gkreitz Jun 16, 2025
5f93af3
Fuzz input validators for spaces at end of lines
Matistjati Aug 16, 2025
626400f
Merge pull request #347 from Matistjati/fuzz-extra-spaces
gkreitz Aug 17, 2025
ff934d5
Slow fuzzing of output vals
Matistjati Aug 17, 2025
bc4a1bf
Only fuzz on samples
Matistjati Aug 19, 2025
4bc085c
Merge branch 'Kattis:master' into fuzz-output-validators
Matistjati Aug 19, 2025
f951d07
Fix type hint
Matistjati Aug 19, 2025
a48a387
More crash cases and limit if using python
Matistjati Aug 20, 2025
3f2c5f2
Fix type error
Matistjati Aug 20, 2025
81844c4
Merge pull request #348 from Matistjati/fuzz-output-validators
gkreitz Aug 20, 2025
85f9cf8
Multipass validation works
Matistjati Aug 20, 2025
c723ba4
Fix mypy error
Matistjati Aug 20, 2025
80d6592
Fix scoring rules and multipass samples
Matistjati Aug 20, 2025
c835245
Remove empty samples warning for multipass
Matistjati Aug 20, 2025
8cfd076
Multiple output validator fix
Matistjati Aug 20, 2025
29e62c6
Handle multipass samples for md -> html
Matistjati Aug 20, 2025
5e43d6a
Merge pull request #350 from Matistjati/multipass3
gkreitz Aug 21, 2025
6371f43
More deterministic input fuzzing
Matistjati Aug 21, 2025
ee22aa9
Merge pull request #351 from Matistjati/deterministic-input-fuzzing-2
gkreitz Aug 25, 2025
8d07cc7
Sanity check the parsed author names
Matistjati Sep 4, 2025
2066fcd
Merge pull request #355 from Matistjati/sanity-check-author-name
gkreitz Sep 10, 2025
322f228
Make oddecho worth 100 points
Matistjati Aug 29, 2025
af779de
Reuse testcases using symlinks in oddecho
Matistjati Aug 29, 2025
b7a7317
Merge pull request #353 from Matistjati/oddecho_100
gkreitz Sep 10, 2025
56968a1
Rewrite latex template handling to not require write access to parent…
gkreitz Nov 5, 2025
c21517c
Let Template.get_file_name() return a Path
gkreitz Nov 5, 2025
f5abd4a
Allow .timelimit, .git, and .gitignore files in problem packages #354
gkreitz Nov 6, 2025
cfc716e
Add --version flag to command line tools
gkreitz Nov 6, 2025
1db9892
Merge pull request #362 from gkreitz/354_allow_a_few_dotfiles
pehrsoderman Nov 6, 2025
4543608
Repair plainproblemname functionality in legacy format (and add a test)
gkreitz Nov 6, 2025
8ec14a4
Add a warning for what looks like latex in problem name
gkreitz Nov 6, 2025
5518a20
Merge pull request #361 from gkreitz/add_version_flag
pehrsoderman Nov 6, 2025
b6a161f
Merge pull request #360 from gkreitz/356_repair_plainproblemname
pehrsoderman Nov 6, 2025
56660db
Merge pull request #359 from gkreitz/dont_write_to_parent_dir_when_re…
pehrsoderman Nov 6, 2025
20f15b0
Replace pdflatex with lualatex. Support emojis.
gkreitz Nov 6, 2025
665c3d6
Temporarily install new dependencies (to be removed when PR is merged…
gkreitz Nov 13, 2025
e3a8acd
Merge pull request #363 from gkreitz/lualatex_and_emojis
pehrsoderman Nov 13, 2025
5018cf7
Add test coverage of default_validator
gkreitz Nov 13, 2025
0cb8303
Deal with binary user output and messages in default_validator tests
gkreitz Nov 17, 2025
0790fd1
Merge pull request #365 from gkreitz/default_validator_tests
gkreitz Nov 17, 2025
3a8e701
Truncate long tokens in default_validator's judge message. #346 Add m…
gkreitz Nov 17, 2025
16dd35d
Merge pull request #366 from gkreitz/346_default_validator_message_tr…
pehrsoderman Nov 17, 2025
9ebafbf
Load language config from parent of problem dir, if present #178
gkreitz Nov 17, 2025
bbfcf33
Merge pull request #367 from gkreitz/178_repository_local_languages_yaml
pehrsoderman Nov 17, 2025
cd88e6a
Add translations for strings related to sample I/O in Swedish and Ice…
gkreitz Nov 17, 2025
d9d2563
Fix interactive problem time limit handling #302
gkreitz Nov 18, 2025
69357b2
Support time limits being float (in supporting functions, we still ca…
gkreitz Nov 18, 2025
f7862b9
Implement 2023-07 time limit computation (but hard coded to use accep…
gkreitz Nov 18, 2025
56de805
Refactor time limit computation, making it a bit easier to find and f…
gkreitz Nov 18, 2025
ebbdc75
Merge pull request #369 from gkreitz/220_conservative_timelim
pehrsoderman Nov 18, 2025
5b8e1ba
Merge pull request #368 from gkreitz/150_i18n_for_sample_strings
pehrsoderman Nov 18, 2025
7f00aea
Use updated, more permissive, regex for file and directory names
gkreitz Nov 28, 2025
f05b18d
Merge pull request #371 from gkreitz/update_filename_regex
gkreitz Nov 28, 2025
5d00ffb
Let make_release print git commands for pushing the changelog for a r…
gkreitz Nov 28, 2025
be29b62
Update debian changelog for release 1.20251128
gkreitz Nov 28, 2025
c490856
Merge pull request #372 from gkreitz/release_1.20251128
gkreitz Nov 28, 2025
35f4ca0
Improve release instructions a bit
gkreitz Nov 28, 2025
1211d75
Remove lualatex installation from workflow, as githubci docker image …
gkreitz Nov 28, 2025
83246a7
Merge pull request #373 from gkreitz/post_release_cleanup
pehrsoderman Nov 30, 2025
5f7c123
Improve README based on feedback in #374
gkreitz Dec 3, 2025
91f4a50
Merge pull request #375 from gkreitz/clarify_readme_on_running_direct…
pehrsoderman Dec 4, 2025
32a59c1
Better grader error display
Matistjati Dec 6, 2025
93b18d7
Minor fixes
Matistjati Dec 6, 2025
800f344
Check if there are incorrect submission directories
Matistjati Dec 6, 2025
7938046
Add TODO to parse submissions.yaml
Matistjati Dec 7, 2025
1a0bddf
Remove support for multiple graders
Matistjati Dec 7, 2025
0044160
Use f-string
Matistjati Dec 7, 2025
f3dd242
Rewrite some if:s to be more DRY
Matistjati Dec 7, 2025
01a3865
Better error message for compile error
Matistjati Dec 8, 2025
8e7148e
Merge pull request #376 from Matistjati/grader_error_handling
gkreitz Dec 11, 2025
50d9b40
Merge pull request #377 from Matistjati/typo-checking
gkreitz Dec 11, 2025
9008d00
Fix missing header
Jan 5, 2026
c17a364
Only compile multithread compile submissions actually used by -s
Matistjati Jan 10, 2026
5316f11
Merge pull request #385 from evouga/defaultvalidator-fix
gkreitz Jan 15, 2026
77128aa
Add back multithreaded output validator compilation
Matistjati Jan 16, 2026
7c38dc1
Merge pull request #386 from Matistjati/only-compile-used-submissions
gkreitz Jan 16, 2026
a4abe64
Merge remote-tracking branch 'upstream/master' into sync_with_upstream
simeneilevstjonn Feb 28, 2026
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
88 changes: 88 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: Publish python distribution to PyPI and TestPyPI

on:
workflow_dispatch:
inputs:
pushTestPyPi:
description: 'Push package to TestPyPi'
required: true
type: boolean
pushPyPi:
description: 'Push package to PyPi'
required: true
type: boolean

jobs:
build-pypi:
runs-on: ubuntu-latest
container:
image: quay.io/pypa/manylinux_2_28_x86_64
steps:
- uses: actions/checkout@v4
with:
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
run: auditwheel repair dist/problemtools-*.whl
- name: Replace broken wheel with repaired wheel
run: |
rm -f dist/*.whl
cp wheelhouse/*.whl dist
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-testpypi:
name: Publish Python distribution to TestPyPI
needs:
- build-pypi
runs-on: ubuntu-latest
if: ${{ inputs.pushTestPyPi }}

environment:
name: testpypi
url: https://test.pypi.org/p/problemtools

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

publish-to-pypi:
name: Publish Python distribution to PyPI
needs:
- build-pypi
runs-on: ubuntu-latest
if: ${{ inputs.pushPyPi }}

environment:
name: pypi
url: https://pypi.org/p/problemtools

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
62 changes: 62 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# This workflow will install Python dependencies, run tests and lint
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python tests

on:
push:
branches: [ "master", "develop" ]
pull_request:
branches: [ "master", "develop" ]

permissions:
contents: read

jobs:
pythontests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"] # 3.11 is the lowest we support, since we want StrEnum
container:
image: problemtools/githubci:latest
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m venv venv
venv/bin/python --version
venv/bin/pip install mypy ruff pytest
if [ -f requirements.txt ]; then venv/bin/pip install -r requirements.txt; fi
- name: Lint with ruff
run: venv/bin/ruff check --output-format=github
- name: Check ruff formatting
run: venv/bin/ruff format --check --diff
- name: Test with pytest
run: venv/bin/pytest
- name: Run mypy
run: |
venv/bin/mypy --non-interactive --config-file mypy.ini -p problemtools

packages: # Use a separate job to test debian packaging to speed things up (no need to test this for every python version above)
runs-on: ubuntu-latest
container:
image: problemtools/githubci:latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build debian packages
run: |
make builddeb
- name: Install debian package
run: dpkg -i ../kattis-problemtools_*.deb
- name: Verify examples
run: |
shopt -s extglob
verifyproblem examples/!(README.md)
shell: bash
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
*.pyc
*~
*.swp
/.cache/
/problemtools.egg-info/
/support/default_validator/default_validator
/support/interactive/interactive
build/
/problemtools/_version.py

venv/
.pytest_cache/
.mypy_cache/
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.8
hooks:
- id: ruff
- id: ruff-format
5 changes: 0 additions & 5 deletions .travis.yml

This file was deleted.

29 changes: 0 additions & 29 deletions Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2010-2019 Kattis and all respective contributors
Copyright (c) Kattis and all respective contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
recursive-include problemtools/config *
recursive-include problemtools/templates *
recursive-include problemtools/tests *
recursive-include examples *
recursive-include support *
recursive-include tests *
global-exclude */__pycache__/*
global-exclude *.pyc
recursive-exclude .github *
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ checktestdata: support/checktestdata/bootstrap

support/checktestdata/bootstrap:
git submodule update --init

clean:
make -C support clean
rm -rf problemtools.egg-info build
Loading
Loading