Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
346 commits
Select commit Hold shift + click to select a range
cdd1804
Improve security by running pandoc without shell capabilities
Matistjati Aug 18, 2024
194c7b1
Refactoring
Matistjati Aug 18, 2024
554892a
Even more refactoring
Matistjati Aug 18, 2024
d8a4c3e
Remove python3-markdown dependency
Matistjati Aug 18, 2024
7390fb8
Add problem id to pdf and small fixes
Matistjati Aug 18, 2024
3fada07
Update languages.yaml
pehrsoderman Aug 18, 2024
e6a48b9
Merge pull request #275 from pehrsoderman/bump-java-version
pehrsoderman Aug 18, 2024
650fa45
Run interactive validation with submission's working directory
Tagl Sep 25, 2024
e3a4cc9
Merge pull request #278 from Tagl/interactive_work_dir
pehrsoderman Oct 3, 2024
0580055
Change Rust compilation flags
Matistjati Nov 11, 2024
eb2a746
Merge pull request #281 from Matistjati/rust-compilation
pehrsoderman Jan 16, 2025
bd70701
Remove deprecated functionality
square-cylinder Mar 3, 2025
c7b0365
add build to .gitignore
square-cylinder Mar 3, 2025
150184d
Add special case error message when user output file is empty
JoelNiemela Mar 2, 2025
71bdda4
Modify error message according to github comment
JoelNiemela Mar 3, 2025
081b5be
Merge pull request #283 from JoelNiemela/add-special-case-err-default…
pehrsoderman Mar 3, 2025
80a1768
Merge pull request #284 from square-cylinder/develop
pehrsoderman Mar 3, 2025
7524e0b
add command-line argument, begin generalizing Problem class
square-cylinder Mar 3, 2025
38e1fd1
small fix
square-cylinder Mar 4, 2025
6dcc507
abstract problems further
square-cylinder Mar 4, 2025
d4c778b
catch general exception for detecting problem-format
square-cylinder Mar 5, 2025
91b9b55
Add some documentation
square-cylinder Mar 5, 2025
26bf20c
New abstraction, ProblemPart which makes it easier to implement parts…
square-cylinder Mar 5, 2025
ce05160
Problem is no longer an abstract class
square-cylinder Mar 5, 2025
d8b9ff8
ProblemStatement now exists for old and new format
square-cylinder Mar 5, 2025
4a4152c
Add TODO for ProblemStatement
square-cylinder Mar 5, 2025
a4b9920
Fix issues with ProblemStatement
square-cylinder Mar 6, 2025
a0518b9
Add some documentation and some final fixes
square-cylinder Mar 6, 2025
bf0eaee
Small change
square-cylinder Mar 6, 2025
1d07631
Allow to give class-type for part in Problem.get
square-cylinder Mar 7, 2025
a672674
Whoops small bug crashed code
square-cylinder Mar 7, 2025
848b196
Fix bug that crashed multithreading for testcase-validation
square-cylinder Mar 7, 2025
11a9b48
Mark ProblemPart.depends_on() as staticmethod
square-cylinder Mar 7, 2025
46a7003
Disable html
Matistjati Mar 11, 2025
770d5da
Change to wikimedia example image
Matistjati Mar 12, 2025
11b6a13
Sanitize image sources
Matistjati Mar 12, 2025
bfd4703
Remove SVG dependency
Matistjati Mar 12, 2025
d935771
Better markdown styling
Matistjati Mar 12, 2025
d55df47
Better sample styling
Matistjati Mar 12, 2025
a0b3f9f
Add \nextsample and \remainingsamples
Matistjati Mar 12, 2025
cc5f26e
Better pdf error handling
Matistjati Mar 12, 2025
608fe13
Use {{nextsample}} instead of \nextsample
Matistjati Mar 13, 2025
c3dc3c9
Relax image checking (implied by global regex on filenames)
Matistjati Mar 13, 2025
6f1698e
Add svg dependency
Matistjati Mar 13, 2025
fd70ff7
Explicitly install build-essential, as deb building blows up on it no…
gkreitz Mar 17, 2025
a4cdd28
fix issues with PR
square-cylinder Mar 17, 2025
3f40bd9
Remove test of verifyproblem.generators (which has been removed)
gkreitz Mar 17, 2025
8d79ec2
Merge pull request #288 from gkreitz/add_missing_dependency
gkreitz Mar 17, 2025
e51d499
Remove bad break-statement and increase consistency in dictionary access
square-cylinder Mar 18, 2025
df7c58e
Merge branch 'Kattis:develop' into develop
square-cylinder Mar 18, 2025
65722d6
more concise regex
square-cylinder Mar 9, 2025
a3c6aad
Make Problem constructor default to legacy format
square-cylinder Mar 18, 2025
4c2748a
make tests pass
square-cylinder Mar 18, 2025
05f8379
Merge pull request #286 from square-cylinder/develop
gkreitz Mar 18, 2025
8ed3449
Add back warning/error logging
Matistjati Mar 19, 2025
acae453
Merge pull request #290 from Matistjati/logging
gkreitz Mar 19, 2025
9133ae4
Add mypy to github workflow
gkreitz Mar 24, 2025
54e187f
Change type from list to tuple, helping mypy and being clearer
gkreitz Mar 24, 2025
948db0f
Fix name of exception (old one also worked, as parser does import * f…
gkreitz Mar 24, 2025
ec4bf5d
Add type annotations and abstract class markers
gkreitz Mar 24, 2025
a31d215
Add getProblemPart for when we need to access problem.classes
gkreitz Mar 24, 2025
18a94d4
Merge pull request #292 from gkreitz/add_mypy
pehrsoderman Mar 24, 2025
54b96a4
Add python tooling files (and vim swp files) to gitignore
gkreitz Mar 25, 2025
ac114eb
Fix signatures of run in VIVA and checktestdata to match superclass
gkreitz Mar 25, 2025
e344d4b
Fix/ignore type errors to let mypy catch errors everywhere but genera…
gkreitz Mar 25, 2025
122f0bc
Make cls templates able work with either problem format
ElliotRipa Mar 18, 2025
4738fc1
Allow problem statement to use either problem format
ElliotRipa Mar 18, 2025
ab5f2b5
Make template.py detect format version instead
ElliotRipa Mar 20, 2025
60c7504
Provisional updates
ElliotRipa Mar 23, 2025
a7676d9
Add formatversion.py
ElliotRipa Mar 23, 2025
be21d6f
Minor fixes in imports
ElliotRipa Mar 23, 2025
9a9cc38
Move version specific functionality to separate file
ElliotRipa Mar 23, 2025
c531bc3
Change to flag '-v' for format-version
ElliotRipa Mar 23, 2025
d235ba0
Add missing parentheses
ElliotRipa Mar 24, 2025
4496918
Use dictionary instead of data objects for format data
ElliotRipa Mar 24, 2025
e71dbf9
Make problem2html.py use -v to specify format version
ElliotRipa Mar 24, 2025
b59ce65
Add constants for version names
ElliotRipa Mar 24, 2025
b805d01
Rollback problemset_0.1.cls
ElliotRipa Mar 24, 2025
2aa9be0
Move initialisation of FORMAT_DATA to setup
ElliotRipa Mar 24, 2025
470fbb8
Make formatversion.py use dataobjects instead of dicts
ElliotRipa Mar 27, 2025
cba93dc
Fix documentation
ElliotRipa Mar 27, 2025
f964bc3
Remove unnecessary initialisation
ElliotRipa Mar 28, 2025
b85906a
Merge pull request #289 from ElliotRipa/develop
gkreitz Mar 28, 2025
c6b57c8
Start sanitization + apply feedback
Matistjati Apr 5, 2025
cfc285c
Better sanitization + lots of tests
Matistjati Apr 7, 2025
5f5d59d
problem_statement -> statement
Matistjati Apr 8, 2025
213f9ac
Better md -> pdf sample rendering
Matistjati Apr 8, 2025
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
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