From 3e4d088a966ab968cb6f15f85db91df735ffdfc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Karlo=20Do=C5=A1ilovi=C4=87?= Date: Sun, 9 Nov 2025 21:59:51 +0100 Subject: [PATCH 1/6] Update to new minor release. --- pyproject.toml | 2 +- src/judge0/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 58a84aaa..8595aac9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "judge0" -version = "0.0.6" +version = "0.1.0.dev0" description = "The official Python SDK for Judge0." readme = "README.md" requires-python = ">=3.10" diff --git a/src/judge0/__init__.py b/src/judge0/__init__.py index ae62b15f..b74df46e 100644 --- a/src/judge0/__init__.py +++ b/src/judge0/__init__.py @@ -30,7 +30,7 @@ from .retry import MaxRetries, MaxWaitTime, RegularPeriodRetry from .submission import Submission -__version__ = "0.0.6" +__version__ = "0.1.0.dev0" __all__ = [ "ATD", From fa3c86f074577cbb60757b76d1e5f34a74257c84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herman=20Zvonimir=20Do=C5=A1ilovi=C4=87?= Date: Mon, 10 Nov 2025 00:45:26 +0100 Subject: [PATCH 2/6] Add Custom Judge0 Client example --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 08de5602..aee1b648 100644 --- a/README.md +++ b/README.md @@ -349,3 +349,25 @@ result = judge0.run(submissions=submission) print(result.stdout) print(result.post_execution_filesystem.find("./my_dir2/my_file2.txt")) ``` + +### Custom Judge0 Client + +This example shows how to use Judge0 Python SDK with your own Judge0 instance. + +```python +import judge0 + +client = judge0.Client(endpoint="http://127.0.0.1:2358", auth_headers=None) + +source_code = """ +#include + +int main() { + printf("hello, world\\n"); + return 0; +} +""" + +result = judge0.run(client=client, source_code=source_code, language=judge0.C) +print(result.stdout) +``` From 3c8efcc23836f800d6f46262d61a714c9ebb9c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herman=20Zvonimir=20Do=C5=A1ilovi=C4=87?= Date: Mon, 10 Nov 2025 00:58:11 +0100 Subject: [PATCH 3/6] Simplify custom client example --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aee1b648..db853f01 100644 --- a/README.md +++ b/README.md @@ -357,7 +357,7 @@ This example shows how to use Judge0 Python SDK with your own Judge0 instance. ```python import judge0 -client = judge0.Client(endpoint="http://127.0.0.1:2358", auth_headers=None) +client = judge0.Client("http://127.0.0.1:2358", None) source_code = """ #include From 0955d857ac2ec5715cfc886cf3b0c61ca2c7b87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herman=20Zvonimir=20Do=C5=A1ilovi=C4=87?= Date: Mon, 10 Nov 2025 01:00:34 +0100 Subject: [PATCH 4/6] Don't require auth_headers in judge0.Client --- README.md | 2 +- src/judge0/clients.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index db853f01..c2dc8ae7 100644 --- a/README.md +++ b/README.md @@ -357,7 +357,7 @@ This example shows how to use Judge0 Python SDK with your own Judge0 instance. ```python import judge0 -client = judge0.Client("http://127.0.0.1:2358", None) +client = judge0.Client("http://127.0.0.1:2358") source_code = """ #include diff --git a/src/judge0/clients.py b/src/judge0/clients.py index 49d1ac61..7b50047c 100644 --- a/src/judge0/clients.py +++ b/src/judge0/clients.py @@ -33,7 +33,7 @@ class Client: def __init__( self, endpoint, - auth_headers, + auth_headers=None, *, retry_strategy: Optional[RetryStrategy] = None, ) -> None: From fd2ab3c80e7c6bd48d952ae63c14a817d68b8ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herman=20Zvonimir=20Do=C5=A1ilovi=C4=87?= Date: Mon, 10 Nov 2025 21:27:04 +0100 Subject: [PATCH 5/6] Fix bug in suppressing preview warning message. --- src/judge0/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/judge0/__init__.py b/src/judge0/__init__.py index b74df46e..069c96ca 100644 --- a/src/judge0/__init__.py +++ b/src/judge0/__init__.py @@ -65,9 +65,9 @@ JUDGE0_IMPLICIT_CE_CLIENT = None JUDGE0_IMPLICIT_EXTRA_CE_CLIENT = None -SUPPRESS_PREVIEW_WARNING = os.getenv("JUDGE0_SUPPRESS_PREVIEW_WARNING") logger = logging.getLogger(__name__) +suppress_preview_warning = os.getenv("JUDGE0_SUPPRESS_PREVIEW_WARNING") is not None def _get_implicit_client(flavor: Flavor) -> Client: @@ -107,7 +107,7 @@ def _get_implicit_client(flavor: Flavor) -> Client: def _get_preview_client(flavor: Flavor) -> Union[Judge0CloudCE, Judge0CloudExtraCE]: - if SUPPRESS_PREVIEW_WARNING is not None: + if not suppress_preview_warning: logger.warning( "You are using a preview version of the client which is not recommended" " for production.\n" From 61324c3d602ebaed1b8f95b3fc9dc9dfc1196aa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herman=20Zvonimir=20Do=C5=A1ilovi=C4=87?= Date: Mon, 10 Nov 2025 21:30:15 +0100 Subject: [PATCH 6/6] Bump to version 0.0.7 --- pyproject.toml | 2 +- src/judge0/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8595aac9..e0f27ab2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "judge0" -version = "0.1.0.dev0" +version = "0.0.7" description = "The official Python SDK for Judge0." readme = "README.md" requires-python = ">=3.10" diff --git a/src/judge0/__init__.py b/src/judge0/__init__.py index 069c96ca..28a89f41 100644 --- a/src/judge0/__init__.py +++ b/src/judge0/__init__.py @@ -30,7 +30,7 @@ from .retry import MaxRetries, MaxWaitTime, RegularPeriodRetry from .submission import Submission -__version__ = "0.1.0.dev0" +__version__ = "0.0.7" __all__ = [ "ATD",