Skip to content

Commit dbfd716

Browse files
committed
Add mocked imports for requests and pydantic to avoid installation in docs env. Remove tables from docstrings.
1 parent 026b9b1 commit dbfd716

File tree

5 files changed

+37
-33
lines changed

5 files changed

+37
-33
lines changed

docs/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
sphinx-rtd-theme==3.0.2
1+
sphinx-rtd-theme==3.0.2
2+
sphinx-autodoc-typehints==2.3.0

docs/source/api_index.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ Submission Module
1616

1717
.. automodule:: judge0.submission
1818
:members:
19-
:undoc-members:
19+
:member-order: groupwise
20+
21+
Clients Module
22+
-----------------
23+
24+
.. automodule:: judge0.clients
25+
:members:
26+
:member-order: groupwise

docs/source/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"sphinx.ext.autodoc",
2323
"sphinx.ext.napoleon",
2424
"sphinx.ext.autosummary",
25+
"sphinx_autodoc_typehints",
2526
]
2627

2728
templates_path = ["_templates"]
@@ -52,5 +53,6 @@
5253
"special-members": False,
5354
"inherited-members": False,
5455
}
56+
autodoc_mock_imports = ["requests", "pydantic"]
5557

5658
napoleon_google_docstring = False

docs/source/index.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Judge0 Python SDK documentation
22
===============================
33

4+
.. note::
5+
6+
This project is under active development.
7+
48
.. toctree::
59
:maxdepth: 2
610
:caption: Contents

src/judge0/api.py

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,25 @@ def wait(
188188
def create_submissions_from_test_cases(
189189
submissions: Union[Submission, Submissions],
190190
test_cases: Optional[Union[TestCaseType, TestCases]] = None,
191-
):
191+
) -> Union[Submission, list[Submission]]:
192192
"""Create submissions from the (submission, test_case) pairs.
193193
194-
The following table contains the return type based on the types of
195-
`submissions` and `test_cases` arguments:
194+
This function always returns a deep copy so make sure you are using the
195+
returned submission(s).
196196
197-
| submissions | test_cases | returns |
198-
|:------------|:-----------|:------------|
199-
| Submission | TestCase | Submission |
200-
| Submission | TestCases | Submissions |
201-
| Submissions | TestCase | Submissions |
202-
| Submissions | TestCases | Submissions |
197+
Parameters
198+
----------
199+
submissions : Submission or Submissions
200+
Base submission(s) that need to be expanded with test cases.
201+
test_cases: TestCaseType or TestCases
202+
Test cases.
203203
204+
Returns
205+
-------
206+
Submissions or Submissions
207+
A single submission if submissions arguments is of type Submission or
208+
source_code argument is provided, and test_cases argument is of type
209+
TestCase. Otherwise returns a list of submissions.
204210
"""
205211
if isinstance(submissions, Submission):
206212
submissions_list = [submissions]
@@ -275,16 +281,6 @@ def async_execute(
275281
276282
Aliases: `async_run`.
277283
278-
The following table contains the return type based on the types of
279-
`submissions` (or `source_code`) and `test_cases` arguments:
280-
281-
| submissions | test_cases | returns |
282-
|:------------|:-----------|:------------|
283-
| Submission | TestCase | Submission |
284-
| Submission | TestCases | Submissions |
285-
| Submissions | TestCase | Submissions |
286-
| Submissions | TestCases | Submissions |
287-
288284
Parameters
289285
----------
290286
client : Client or Flavor, optional
@@ -300,7 +296,9 @@ def async_execute(
300296
Returns
301297
-------
302298
Submission or Submissions
303-
A single submission or a list of submissions.
299+
A single submission if submissions arguments is of type Submission or
300+
source_code argument is provided, and test_cases argument is of type
301+
TestCase. Otherwise returns a list of submissions.
304302
305303
Raises
306304
------
@@ -331,16 +329,6 @@ def sync_execute(
331329
332330
Aliases: `execute`, `run`, `sync_run`.
333331
334-
The following table contains the return type based on the types of
335-
`submissions` (or `source_code`) and `test_cases` arguments:
336-
337-
| submissions | test_cases | returns |
338-
|:------------|:-----------|:------------|
339-
| Submission | TestCase | Submission |
340-
| Submission | TestCases | Submissions |
341-
| Submissions | TestCase | Submissions |
342-
| Submissions | TestCases | Submissions |
343-
344332
Parameters
345333
----------
346334
client : Client or Flavor, optional
@@ -356,7 +344,9 @@ def sync_execute(
356344
Returns
357345
-------
358346
Submission or Submissions
359-
A single submission or a list of submissions.
347+
A single submission if submissions arguments is of type Submission or
348+
source_code argument is provided, and test_cases argument is of type
349+
TestCase. Otherwise returns a list of submissions.
360350
361351
Raises
362352
------

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy