diff --git a/.env.template b/.env.template new file mode 100644 index 00000000..84f0e034 --- /dev/null +++ b/.env.template @@ -0,0 +1,22 @@ +# Rapid API Key. Get yours at https://rapidapi.com/developer/apps +# Subscribe here: https://rapidapi.com/organization/judge0 +JUDGE0_RAPID_API_KEY= + +# ATD API Key. Get yours at https://www.allthingsdev.co/account/apps +# Subscribe here: https://www.allthingsdev.co/publisher/profile/Herman%20Zvonimir%20Došilović +JUDGE0_ATD_API_KEY= + +# Auth headers for Judge0 Cloud. +# Contact us to get your credentials. +JUDGE0_CLOUD_CE_AUTH_HEADERS= +JUDGE0_CLOUD_EXTRA_CE_AUTH_HEADERS= + +# Endpoint and auth headers for custom Judge0 CE instance. +# Use to connect to your own Judge0 CE server. +JUDGE0_CE_ENDPOINT= +JUDGE0_CE_AUTH_HEADERS= # Use "{}" for no auth headers. + +# Endpoint and auth headers for custom Judge0 Extra CE instance. +# Use to connect to your own Judge0 Extra CE server. +JUDGE0_EXTRA_CE_ENDPOINT= +JUDGE0_EXTRA_CE_AUTH_HEADERS= # Use "{}" for no auth headers. diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 11d9d8e3..b8e06c26 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -24,7 +24,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a4e3e38..0ab3dff3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.10 # Install build and twine - name: Install Build Tools diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2beadbd3..31c375ad 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,10 +18,10 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v3 with: - python-version: "3.9" + python-version: "3.10" - name: Install dependencies run: | python -m venv venv @@ -32,11 +32,12 @@ jobs: env: # Add necessary api keys as env variables. JUDGE0_ATD_API_KEY: ${{ secrets.JUDGE0_ATD_API_KEY }} JUDGE0_RAPID_API_KEY: ${{ secrets.JUDGE0_RAPID_API_KEY }} - JUDGE0_SULU_API_KEY: ${{ secrets.JUDGE0_SULU_API_KEY }} JUDGE0_CE_AUTH_HEADERS: ${{ secrets.JUDGE0_CE_AUTH_HEADERS }} JUDGE0_EXTRA_CE_AUTH_HEADERS: ${{ secrets.JUDGE0_EXTRA_CE_AUTH_HEADERS }} JUDGE0_CE_ENDPOINT: ${{ secrets.JUDGE0_CE_ENDPOINT }} JUDGE0_EXTRA_CE_ENDPOINT: ${{ secrets.JUDGE0_EXTRA_CE_ENDPOINT }} + JUDGE0_CLOUD_CE_AUTH_HEADERS: ${{ secrets.JUDGE0_CLOUD_CE_AUTH_HEADERS }} + JUDGE0_CLOUD_EXTRA_CE_AUTH_HEADERS: ${{ secrets.JUDGE0_CLOUD_EXTRA_CE_AUTH_HEADERS }} run: | source venv/bin/activate pytest tests diff --git a/README.md b/README.md index 722a0c55..a9eb6005 100644 --- a/README.md +++ b/README.md @@ -26,19 +26,17 @@ pip install judge0 ### Requirements -- Python 3.9+ +- Python 3.10+ ## Quick Start ### Getting The API Key -Get your API key from [Sulu](https://platform.sulu.sh/apis/judge0), [Rapid](https://rapidapi.com/organization/judge0), or [ATD](https://www.allthingsdev.co/publisher/profile/Herman%20Zvonimir%20Do%C5%A1ilovi%C4%87). +Get your API key from [Rapid](https://rapidapi.com/organization/judge0), or [ATD](https://www.allthingsdev.co/publisher/profile/Herman%20Zvonimir%20Do%C5%A1ilovi%C4%87). #### Notes -* [**Recommended**] Choose Sulu if you need pay-as-you-go (pey-per-use) pricing. -* Choose Rapid or ATD if you need a quota-based (volume-based) plan. -* Judge0 has two flavors: Judge0 CE and Judge0 Extra CE, and their difference is just in the languages they support. When choosing Sulu, your API key will work for both flavors, but for Rapid and ATD you will need to explicitly subscribe to both flavors if you want to use both. +* Judge0 has two flavors: Judge0 CE and Judge0 Extra CE, and their difference is just in the languages they support. When choosing Rapid and ATD you will need to explicitly subscribe to both flavors if you want to use both. ### Using Your API Key @@ -48,7 +46,7 @@ Explicitly create a client object with your API key and pass it to Judge0 Python ```python import judge0 -client = judge0.SuluJudge0CE(api_key="xxx") +client = judge0.RapidJudge0CE(api_key="xxx") result = judge0.run(client=client, source_code="print('hello, world')") print(result.stdout) ``` @@ -56,13 +54,12 @@ print(result.stdout) Other options include: - `judge0.RapidJudge0CE` - `judge0.ATDJudge0CE` -- `judge0.SuluJudge0ExtraCE` - `judge0.RapidJudge0ExtraCE` - `judge0.ATDJudge0ExtraCE` #### Option 2: Implicit Client Object -Put your API key in one of the following environment variables, respectable to the provider that issued you the API key: `JUDGE0_SULU_API_KEY`, `JUDGE0_RAPID_API_KEY`, or `JUDGE0_ATD_API_KEY`. +Put your API key in one of the following environment variables, respectable to the provider that issued you the API key: `JUDGE0_RAPID_API_KEY`, or `JUDGE0_ATD_API_KEY`. Judge0 Python SDK will automatically detect the environment variable and use it to create a client object that will be used for all API calls if you do not explicitly pass a client object. diff --git a/docs/assets/logo.png b/docs/assets/logo.png index 9661bbb3..2b591203 100644 Binary files a/docs/assets/logo.png and b/docs/assets/logo.png differ diff --git a/docs/source/api/clients.rst b/docs/source/api/clients.rst index b4d15c94..29e7e45a 100644 --- a/docs/source/api/clients.rst +++ b/docs/source/api/clients.rst @@ -35,12 +35,3 @@ Clients Module .. autoclass:: judge0.clients.RapidJudge0ExtraCE :show-inheritance: - -.. autoclass:: judge0.clients.Sulu - :show-inheritance: - -.. autoclass:: judge0.clients.SuluJudge0CE - :show-inheritance: - -.. autoclass:: judge0.clients.SuluJudge0ExtraCE - :show-inheritance: \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index ea153536..f4c02c87 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -13,7 +13,7 @@ from sphinxawesome_theme.postprocess import Icons project = "Judge0 Python SDK" -copyright = "2024, Judge0" +copyright = "2025, Judge0" author = "Judge0" release = "" diff --git a/docs/source/contributors_guide/contributing.rst b/docs/source/contributors_guide/contributing.rst index 867f3f14..237bab67 100644 --- a/docs/source/contributors_guide/contributing.rst +++ b/docs/source/contributors_guide/contributing.rst @@ -4,20 +4,20 @@ Contributing Preparing the development setup ------------------------------- -1. Install Python 3.9 +1. Install Python 3.10 .. code-block:: console $ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt update - $ sudo apt install python3.9 python3.9-venv + $ sudo apt install python3.10 python3.10-venv 2. Clone the repo, create and activate a new virtual environment .. code-block:: console $ cd judge0-python - $ python3.9 -m venv venv + $ python3.10 -m venv venv $ . venv/bin/activate 3. Install the library and development dependencies @@ -52,8 +52,8 @@ Testing .. warning:: If you are implementing features or fixing bugs, you are expected to have - all of the three API keys (ATD, Sulu, and RapidAPI) setup and set in you - environment variables - ``JUDGE0_SULU_API_KEY``, ``JUDGE0_RAPID_API_KEY``, + all API keys (RapidAPI and ATD) setup and set in you + environment variables - ``JUDGE0_RAPID_API_KEY``, and ``JUDGE0_ATD_API_KEY``. Every bug fix or new feature should have tests for it. The tests are located in diff --git a/docs/source/contributors_guide/release_notes.rst b/docs/source/contributors_guide/release_notes.rst index da50b25b..af4e92ab 100644 --- a/docs/source/contributors_guide/release_notes.rst +++ b/docs/source/contributors_guide/release_notes.rst @@ -18,6 +18,7 @@ Creating a release is a simple process that involves a few steps: #. Release title should be ``Judge0 Python SDK vX.Y.Z``. #. Release notes should include a changes from the previous release to the newest release. #. Use the `template `_ from the repo to organize the changes. + #. Click the `Generate release notes` button and use only `Full Changelog` section. #. Create the release. ("Set as a pre-release" should NOT be checked.) #. **Release on PyPI**: #. Use the `GitHub Actions workflow `_ to create a release on PyPI. @@ -29,4 +30,4 @@ that updates the working version in ``judge0/__init__.py`` and ``judge0/pyproje to the minor version. Merge the pull request and you're done! For example, if the new release was ``1.2.2``, the working version should be updated to ``1.3.0.dev0``. -You've successfully created a release! Congratulations! 🎉 \ No newline at end of file +You've successfully created a release! Congratulations! 🎉 diff --git a/examples/sulu_clients.py b/examples/sulu_clients.py deleted file mode 100644 index b9c60874..00000000 --- a/examples/sulu_clients.py +++ /dev/null @@ -1,22 +0,0 @@ -import os - -import judge0 -from dotenv import load_dotenv - -load_dotenv() - -api_key = os.getenv("JUDGE0_SULU_API_KEY") - -client_ce = judge0.SuluJudge0CE(api_key=api_key) -print(client_ce.get_about()) -print(client_ce.get_config_info()) -print(client_ce.get_statuses()) -print(client_ce.get_languages()) -print(client_ce.get_language(language_id=42)) - -client_extra_ce = judge0.SuluJudge0ExtraCE(api_key=api_key) -print(client_extra_ce.get_about()) -print(client_extra_ce.get_config_info()) -print(client_extra_ce.get_statuses()) -print(client_extra_ce.get_languages()) -print(client_extra_ce.get_language(language_id=24)) diff --git a/examples/sulu_submission.py b/examples/sulu_submission.py deleted file mode 100644 index ef744927..00000000 --- a/examples/sulu_submission.py +++ /dev/null @@ -1,32 +0,0 @@ -import os - -import judge0 - -from dotenv import load_dotenv - -load_dotenv() - -api_key = os.getenv("JUDGE0_SULU_API_KEY") - - -def run_example(client_class, language_id): - client = client_class(api_key=api_key) - submission = judge0.Submission( - source_code="print('Hello Judge0')", - language=language_id, - expected_output="Hello Judge0", - ) - - judge0.execute(client=client, submissions=submission) - - print(f"{submission.status=}") - print(f"{submission.stdout=}") - - -def main(): - run_example(judge0.SuluJudge0CE, 100) - run_example(judge0.SuluJudge0ExtraCE, 25) - - -if __name__ == "__main__": - main() diff --git a/examples/sulu_submissions.py b/examples/sulu_submissions.py deleted file mode 100644 index b7088701..00000000 --- a/examples/sulu_submissions.py +++ /dev/null @@ -1,39 +0,0 @@ -import os - -import judge0 - -from dotenv import load_dotenv - -load_dotenv() - -api_key = os.getenv("JUDGE0_SULU_API_KEY") - - -def run_example(client_class, lang_id_python, lang_id_c): - client = client_class(api_key=api_key) - submission1 = judge0.Submission( - source_code="print('Hello Judge0')", - language=lang_id_python, - expected_output="Hello Judge0", - ) - submission2 = judge0.Submission( - source_code='#include \n\nint main() {\n printf("Hello World!");\n return 0;\n}', - language=lang_id_c, - expected_output="Hello World!", - ) - - submissions = [submission1, submission2] - judge0.execute(client=client, submissions=submissions) - - for submission in submissions: - print(f"{submission.status=}") - print(f"{submission.stdout=}") - - -def main(): - run_example(judge0.SuluJudge0CE, 100, 50) - run_example(judge0.SuluJudge0ExtraCE, 25, 1) - - -if __name__ == "__main__": - main() diff --git a/pyproject.toml b/pyproject.toml index 665f9ac2..53718b3d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [project] name = "judge0" -version = "0.0.4" +version = "0.0.5" description = "The official Python SDK for Judge0." readme = "README.md" -requires-python = ">=3.9" +requires-python = ">=3.10" authors = [{ name = "Judge0", email = "contact@judge0.com" }] classifiers = [ "Intended Audience :: Developers", @@ -11,7 +11,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", @@ -46,7 +45,7 @@ test = [ "flake8-docstrings==1.7.0", ] docs = [ - "sphinx==7.4.7", + "sphinx==8.1.3", "sphinxawesome-theme==5.3.2", "sphinx-autodoc-typehints==2.3.0", "sphinx-multiversion==0.2.4", diff --git a/src/judge0/__init__.py b/src/judge0/__init__.py index 6e569c40..387b651f 100644 --- a/src/judge0/__init__.py +++ b/src/judge0/__init__.py @@ -1,3 +1,4 @@ +import logging import os from typing import Union @@ -18,18 +19,18 @@ ATDJudge0CE, ATDJudge0ExtraCE, Client, + Judge0Cloud, + Judge0CloudCE, + Judge0CloudExtraCE, Rapid, RapidJudge0CE, RapidJudge0ExtraCE, - Sulu, - SuluJudge0CE, - SuluJudge0ExtraCE, ) from .filesystem import File, Filesystem from .retry import MaxRetries, MaxWaitTime, RegularPeriodRetry from .submission import Submission -__version__ = "0.0.4" +__version__ = "0.0.5" __all__ = [ "ATD", @@ -38,6 +39,9 @@ "Client", "File", "Filesystem", + "Judge0Cloud", + "Judge0CloudCE", + "Judge0CloudExtraCE", "Language", "LanguageAlias", "MaxRetries", @@ -48,23 +52,22 @@ "RegularPeriodRetry", "Status", "Submission", - "Sulu", - "SuluJudge0CE", - "SuluJudge0ExtraCE", "TestCase", "async_execute", + "async_run", "execute", "get_client", - "async_run", - "sync_run", "run", "sync_execute", + "sync_run", "wait", ] JUDGE0_IMPLICIT_CE_CLIENT = None JUDGE0_IMPLICIT_EXTRA_CE_CLIENT = None +logger = logging.getLogger(__name__) + def _get_implicit_client(flavor: Flavor) -> Client: global JUDGE0_IMPLICIT_CE_CLIENT, JUDGE0_IMPLICIT_EXTRA_CE_CLIENT @@ -85,13 +88,12 @@ def _get_implicit_client(flavor: Flavor) -> Client: # Let's check if we can find a self-hosted client. client = _get_custom_client(flavor) - # Try to find one of the API keys JUDGE0_{SULU,RAPID,ATD}_API_KEY - # for hub clients. + # Try to find one of the API keys for hub clients. if client is None: client = _get_hub_client(flavor) # If we didn't find any of the possible keys, initialize - # the preview Sulu client based on the flavor. + # the preview client based on the flavor. if client is None: client = _get_preview_client(flavor) @@ -103,11 +105,17 @@ def _get_implicit_client(flavor: Flavor) -> Client: return client -def _get_preview_client(flavor: Flavor) -> Union[SuluJudge0CE, SuluJudge0ExtraCE]: +def _get_preview_client(flavor: Flavor) -> Union[Judge0CloudCE, Judge0CloudExtraCE]: + logger.warning( + "You are using a preview version of the client which is not recommended" + " for production.\n" + "For production, please specify your API key in the environment variable." + ) + if flavor == Flavor.CE: - return SuluJudge0CE(retry_strategy=RegularPeriodRetry(0.5)) + return Judge0CloudCE() else: - return SuluJudge0ExtraCE(retry_strategy=RegularPeriodRetry(0.5)) + return Judge0CloudExtraCE() def _get_custom_client(flavor: Flavor) -> Union[Client, None]: diff --git a/src/judge0/clients.py b/src/judge0/clients.py index 2d8366a9..49d1ac61 100644 --- a/src/judge0/clients.py +++ b/src/judge0/clients.py @@ -23,11 +23,11 @@ class Client: ---------- API_KEY_ENV : str Environment variable where judge0-python should look for API key for - the client. Set to default values for ATD, RapidAPI, and Sulu clients. + the client. Set to default values for RapidAPI and ATD clients. """ # Environment variable where judge0-python should look for API key for - # the client. Set to default values for ATD, RapidAPI, and Sulu clients. + # the client. Set to default values for RapidAPI and ATD clients. API_KEY_ENV: ClassVar[str] = None def __init__( @@ -649,71 +649,77 @@ def __init__(self, api_key, **kwargs): ) -class Sulu(Client): - """Base class for all Sulu clients. +class Judge0Cloud(Client): + """Base class for all Judge0 Cloud clients. Parameters ---------- endpoint : str Default request endpoint. - api_key : str, optional - Sulu API key. + auth_headers : str or dict + Judge0 Cloud authentication headers, either as a JSON string or a dictionary. **kwargs : dict Additional keyword arguments for the base Client. """ - API_KEY_ENV: ClassVar[str] = "JUDGE0_SULU_API_KEY" + def __init__(self, endpoint, auth_headers=None, **kwargs): + if isinstance(auth_headers, str): + from json import loads + + auth_headers = loads(auth_headers) - def __init__(self, endpoint, api_key=None, **kwargs): - self.api_key = api_key super().__init__( endpoint, - {"Authorization": f"Bearer {api_key}"} if api_key else None, + auth_headers, **kwargs, ) -class SuluJudge0CE(Sulu): - """Sulu client for CE flavor. +class Judge0CloudCE(Judge0Cloud): + """Judge0 Cloud client for CE flavor. Parameters ---------- - api_key : str, optional - Sulu API key. + endpoint : str + Default request endpoint. + auth_headers : str or dict + Judge0 Cloud authentication headers, either as a JSON string or a dictionary. **kwargs : dict Additional keyword arguments for the base Client. """ - DEFAULT_ENDPOINT: ClassVar[str] = "https://judge0-ce.p.sulu.sh" - HOME_URL: ClassVar[str] = "https://sparkhub.sulu.sh/apis/judge0/judge0-ce/readme" + DEFAULT_ENDPOINT: ClassVar[str] = "https://ce.judge0.com" + HOME_URL: ClassVar[str] = "https://ce.judge0.com" + API_KEY_ENV: ClassVar[str] = "JUDGE0_CLOUD_CE_AUTH_HEADERS" - def __init__(self, api_key=None, **kwargs): + def __init__(self, auth_headers=None, **kwargs): super().__init__( self.DEFAULT_ENDPOINT, - api_key, + auth_headers, **kwargs, ) -class SuluJudge0ExtraCE(Sulu): - """Sulu client for Extra CE flavor. +class Judge0CloudExtraCE(Judge0Cloud): + """Judge0 Cloud client for Extra CE flavor. Parameters ---------- - api_key : str - Sulu API key. + endpoint : str + Default request endpoint. + auth_headers : str or dict + Judge0 Cloud authentication headers, either as a JSON string or a dictionary. **kwargs : dict Additional keyword arguments for the base Client. """ - DEFAULT_ENDPOINT: ClassVar[str] = "https://judge0-extra-ce.p.sulu.sh" - HOME_URL: ClassVar[str] = ( - "https://sparkhub.sulu.sh/apis/judge0/judge0-extra-ce/readme" - ) + DEFAULT_ENDPOINT: ClassVar[str] = "https://extra-ce.judge0.com" + HOME_URL: ClassVar[str] = "https://extra-ce.judge0.com" + API_KEY_ENV: ClassVar[str] = "JUDGE0_CLOUD_EXTRA_CE_AUTH_HEADERS" - def __init__(self, api_key=None, **kwargs): - super().__init__(self.DEFAULT_ENDPOINT, api_key, **kwargs) + def __init__(self, auth_headers=None, **kwargs): + super().__init__(self.DEFAULT_ENDPOINT, auth_headers, **kwargs) -CE = (SuluJudge0CE, RapidJudge0CE, ATDJudge0CE) -EXTRA_CE = (SuluJudge0ExtraCE, RapidJudge0ExtraCE, ATDJudge0ExtraCE) +CE = (Judge0CloudCE, RapidJudge0CE, ATDJudge0CE) +EXTRA_CE = (Judge0CloudExtraCE, RapidJudge0ExtraCE, ATDJudge0ExtraCE) diff --git a/src/judge0/data.py b/src/judge0/data.py index ff4ed9ef..5182e7a5 100644 --- a/src/judge0/data.py +++ b/src/judge0/data.py @@ -126,7 +126,7 @@ LanguageAlias.R: 99, LanguageAlias.RUBY: 72, LanguageAlias.RUST: 108, - LanguageAlias.SCALA: 81, + LanguageAlias.SCALA: 112, LanguageAlias.SQLITE: 82, LanguageAlias.SWIFT: 83, LanguageAlias.TYPESCRIPT: 101, diff --git a/src/judge0/utils.py b/src/judge0/utils.py index e38b41f5..94eb5efc 100644 --- a/src/judge0/utils.py +++ b/src/judge0/utils.py @@ -23,14 +23,14 @@ def wrapper(*args, **kwargs): return func(*args, **kwargs) except HTTPError as err: if is_http_too_many_requests_error(exception=err): - # If the raised exception is inside the one of the Sulu clients + # If the raised exception is inside the one of the Judge0 Cloud clients # let's check if we are dealing with the implicit client. if args: instance = args[0] class_name = instance.__class__.__name__ # Check if we are using a preview version of the client. if ( - class_name in ("SuluJudge0CE", "SuluJudge0ExtraCE") + class_name in ("Judge0CloudCE", "Judge0CloudExtraCE") and instance.api_key is None ): raise PreviewClientLimitError( diff --git a/tests/conftest.py b/tests/conftest.py index 4e1547c5..38a85732 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -72,47 +72,47 @@ def rapid_extra_ce_client(): @pytest.fixture(scope="session") -def sulu_ce_client(): - api_key = os.getenv("JUDGE0_SULU_API_KEY") +def judge0_cloud_ce_client(): + auth_headers = os.getenv("JUDGE0_CLOUD_CE_AUTH_HEADERS") - if api_key is None: + if auth_headers is None: return None else: - return clients.SuluJudge0CE(api_key) + return clients.Judge0CloudCE(auth_headers) @pytest.fixture(scope="session") -def sulu_extra_ce_client(): - api_key = os.getenv("JUDGE0_SULU_API_KEY") +def judge0_cloud_extra_ce_client(): + auth_headers = os.getenv("JUDGE0_CLOUD_EXTRA_CE_AUTH_HEADERS") - if api_key is None: + if auth_headers is None: return None else: - return clients.SuluJudge0ExtraCE(api_key) + return clients.Judge0CloudExtraCE(auth_headers) @pytest.fixture(scope="session") -def preview_ce_client() -> clients.SuluJudge0CE: - return clients.SuluJudge0CE(retry_strategy=RegularPeriodRetry(0.5)) +def preview_ce_client() -> clients.Judge0CloudCE: + return clients.Judge0CloudCE(retry_strategy=RegularPeriodRetry(0.5)) @pytest.fixture(scope="session") -def preview_extra_ce_client() -> clients.SuluJudge0ExtraCE: - return clients.SuluJudge0ExtraCE(retry_strategy=RegularPeriodRetry(0.5)) +def preview_extra_ce_client() -> clients.Judge0CloudExtraCE: + return clients.Judge0CloudExtraCE(retry_strategy=RegularPeriodRetry(0.5)) @pytest.fixture(scope="session") def ce_client( custom_ce_client, - sulu_ce_client, + judge0_cloud_ce_client, rapid_ce_client, atd_ce_client, preview_ce_client, ): if custom_ce_client is not None: return custom_ce_client - if sulu_ce_client is not None: - return sulu_ce_client + if judge0_cloud_ce_client is not None: + return judge0_cloud_ce_client if rapid_ce_client is not None: return rapid_ce_client if atd_ce_client is not None: @@ -126,15 +126,15 @@ def ce_client( @pytest.fixture(scope="session") def extra_ce_client( custom_extra_ce_client, - sulu_extra_ce_client, + judge0_cloud_extra_ce_client, rapid_extra_ce_client, atd_extra_ce_client, preview_extra_ce_client, ): if custom_extra_ce_client is not None: return custom_extra_ce_client - if sulu_extra_ce_client is not None: - return sulu_extra_ce_client + if judge0_cloud_extra_ce_client is not None: + return judge0_cloud_extra_ce_client if rapid_extra_ce_client is not None: return rapid_extra_ce_client if atd_extra_ce_client is not None: diff --git a/tests/test_api.py b/tests/test_api.py index 3ba95267..b58aa24e 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -9,8 +9,8 @@ "atd_extra_ce_client", "rapid_ce_client", "rapid_extra_ce_client", - "sulu_ce_client", - "sulu_extra_ce_client", + "judge0_cloud_ce_client", + "judge0_cloud_extra_ce_client", ) diff --git a/tests/test_clients.py b/tests/test_clients.py index c22c9dca..98eb45e4 100644 --- a/tests/test_clients.py +++ b/tests/test_clients.py @@ -5,8 +5,8 @@ "atd_extra_ce_client", "rapid_ce_client", "rapid_extra_ce_client", - "sulu_ce_client", - "sulu_extra_ce_client", + "judge0_cloud_ce_client", + "judge0_cloud_extra_ce_client", )