Skip to content

Commit abcf10b

Browse files
authored
Merge pull request #46 from mts-ai/feature/custom-view-body-dependencies
context var for current atomic operation
2 parents 3c4a444 + c7be86b commit abcf10b

32 files changed

+1218
-267
lines changed

.github/workflows/documentation.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
- name: Install dependencies
2121
run: |
2222
pip install sphinx sphinx_rtd_theme
23+
pip install -r docs/requirements.txt
2324
- name: Sphinx build
2425
run: |
2526
sphinx-build docs _build

.readthedocs.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ formats:
3131
# Optional but recommended, declare the Python requirements required
3232
# to build your documentation
3333
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
34-
# python:
35-
# install:
36-
# - requirements: docs/requirements.txt
34+
python:
35+
install:
36+
- requirements: docs/requirements.txt

docs/atomic_operations.rst

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,12 @@ Notes
259259

260260

261261
.. note::
262-
See `examples for SQLAlchemy <SQLA_examples>`_ in the repo, all examples are based on it.
262+
See `examples for SQLAlchemy`_ in the repo, all examples are based on it.
263+
264+
265+
.. note::
266+
Atomic Operations provide ``current_atomic_operation`` context variable.
267+
Usage example can be found in tests `test_current_atomic_operation`_.
263268

264269

265270
.. warning::
@@ -271,4 +276,5 @@ Notes
271276

272277
Includes in the response body are not supported (and not planned, until you PR it)
273278

274-
.. _SQLA_examples: https://github.com/mts-ai/FastAPI-JSONAPI/tree/main/examples/api_for_sqlalchemy
279+
.. _`examples for SQLAlchemy`: https://github.com/mts-ai/FastAPI-JSONAPI/tree/main/examples/api_for_sqlalchemy
280+
.. _`test_current_atomic_operation`: https://github.com/mts-ai/FastAPI-JSONAPI/blob/main/tests/test_atomic/test_current_atomic_operation.py

docs/changelog.rst

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
Changelog
22
#########
33

4+
5+
**2.3.0**
6+
*********
7+
8+
Current Atomic Operation context var
9+
====================================
10+
11+
* create context var for current atomic operation `#46 <https://github.com/mts-ai/FastAPI-JSONAPI/pull/46>`_
12+
* create example and coverage for universal dependency both for generic views and atomic operations
13+
* tests refactoring
14+
15+
Authors
16+
"""""""
17+
18+
19+
* `@mahenzon`_
20+
421
**2.2.2**
522
*********
623

@@ -14,6 +31,7 @@ Authors
1431

1532
* `@mahenzon`_
1633

34+
1735
**2.2.1**
1836
*********
1937

@@ -63,8 +81,8 @@ Authors
6381
Generic views, process relationships
6482
====================================
6583

66-
Backward-incompatible changes
67-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
84+
.. note::
85+
Backward-incompatible changes
6886

6987
* Automatically create all CRUD views based on schemas (see :ref:`example <minimal_api_example>`)
7088
* Allow to pass Client-Generated IDs (see :ref:`example <client_generated_id>`, `JSON:API doc <https://jsonapi.org/format/#crud-creating-client-ids>`_)

docs/conf.py

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,16 @@
6464
# built documents.
6565
#
6666
# The short X.Y version.
67-
version = "2.2"
67+
version = "2.3"
6868
# The full version, including alpha/beta/rc tags.
69-
release = "2.2.2"
69+
release = "2.3.0"
7070

7171
# The language for content autogenerated by Sphinx. Refer to documentation
7272
# for a list of supported languages.
7373
#
7474
# This is also used if you do content translation via gettext catalogs.
7575
# Usually you set "language" from the command line for these cases.
76-
language = None
76+
language = "en"
7777

7878
# There are two options for replacing |today|: either, you set today to some
7979
# non-false value, then it is used:
@@ -133,15 +133,9 @@
133133
# documentation.
134134
#
135135
html_theme_options = {
136-
"github_user": "mts-ai",
137-
"github_repo": "FastAPI-JSONAPI",
138-
"github_banner": True,
139-
"show_related": True,
140-
"page_width": "1080px",
141-
"fixed_sidebar": True,
142-
"code_font_size": "0.8em",
143-
"show_nav_level": 2,
144-
"navigation_depth": 2,
136+
"display_version": True,
137+
"sticky_navigation": True,
138+
"navigation_depth": 4,
145139
}
146140

147141
# Add any paths that contain custom themes here, relative to this directory.
@@ -170,7 +164,7 @@
170164
# Add any paths that contain custom static files (such as style sheets) here,
171165
# relative to this directory. They are copied after the builtin static files,
172166
# so a file named "default.css" will overwrite the builtin "default.css".
173-
html_static_path = ["_static"]
167+
# html_static_path = ["_static"]
174168

175169
# Add any extra paths that contain custom files (such as robots.txt or
176170
# .htaccess) here, relative to this directory. These files are copied

docs/fastapi-jsonapi.rst

Lines changed: 19 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
fastapi_jsonapi package
2-
==========================
1+
Package fastapi_jsonapi index
2+
=============================
33

44
fastapi_jsonapi.data_layers.fields.enum module
5-
-------------------------------------------------------
5+
----------------------------------------------
66

77
.. automodule:: fastapi_jsonapi.data_layers.fields.enum
88
:members:
99
:undoc-members:
1010
:show-inheritance:
1111

1212
fastapi_jsonapi.data_layers.fields.mixins module
13-
-------------------------------------------------------
13+
------------------------------------------------
1414

1515
.. automodule:: fastapi_jsonapi.data_layers.fields.mixins
1616
:members:
@@ -26,23 +26,23 @@ fastapi_jsonapi.data_layers.filtering.sqlalchemy module
2626
:show-inheritance:
2727

2828
fastapi_jsonapi.data_layers.filtering.tortoise_operation module
29-
-------------------------------------------------------
29+
---------------------------------------------------------------
3030

3131
.. automodule:: fastapi_jsonapi.data_layers.filtering.tortoise_operation
3232
:members:
3333
:undoc-members:
3434
:show-inheritance:
3535

3636
fastapi_jsonapi.data_layers.filtering.tortoise_orm module
37-
-------------------------------------------------------
37+
---------------------------------------------------------
3838

3939
.. automodule:: fastapi_jsonapi.data_layers.filtering.tortoise_orm
4040
:members:
4141
:undoc-members:
4242
:show-inheritance:
4343

4444
fastapi_jsonapi.data_layers.sorting.sqlalchemy module
45-
-------------------------------------------------------
45+
-----------------------------------------------------
4646

4747
.. automodule:: fastapi_jsonapi.data_layers.sorting.sqlalchemy
4848
:members:
@@ -58,135 +58,95 @@ fastapi_jsonapi.data_layers.sorting.tortoise_orm module
5858
:show-inheritance:
5959

6060
fastapi_jsonapi.data_layers.base module
61-
-------------------------------------------------------
61+
---------------------------------------
6262

6363
.. automodule:: fastapi_jsonapi.data_layers.base
6464
:members:
6565
:undoc-members:
6666
:show-inheritance:
6767

6868
fastapi_jsonapi.data_typing module
69-
-------------------------------------------------------
69+
----------------------------------
7070

7171
.. automodule:: fastapi_jsonapi.data_typing
7272
:members:
7373
:undoc-members:
7474
:show-inheritance:
7575

7676
fastapi_jsonapi.data_layers.orm module
77-
-------------------------------------------------------
77+
--------------------------------------
7878

7979
.. automodule:: fastapi_jsonapi.data_layers.orm
8080
:members:
8181
:undoc-members:
8282
:show-inheritance:
8383

8484
fastapi_jsonapi.data_layers.shared module
85-
-------------------------------------------------------
85+
-----------------------------------------
8686

8787
.. automodule:: fastapi_jsonapi.data_layers.shared
8888
:members:
8989
:undoc-members:
9090
:show-inheritance:
9191

9292
fastapi_jsonapi.data_layers.sqla_orm module
93-
-------------------------------------------------------
93+
-------------------------------------------
9494

9595
.. automodule:: fastapi_jsonapi.data_layers.sqla_orm
9696
:members:
9797
:undoc-members:
9898
:show-inheritance:
9999

100100
fastapi_jsonapi.data_layers.tortoise_orm module
101-
-------------------------------------------------------
101+
-----------------------------------------------
102102

103103
.. automodule:: fastapi_jsonapi.data_layers.tortoise_orm
104104
:members:
105105
:undoc-members:
106106
:show-inheritance:
107107

108-
fastapi_jsonapi.exception.base module
109-
-------------------------------------------------------
110-
111-
.. automodule:: fastapi_jsonapi.exception.base
112-
:members:
113-
:undoc-members:
114-
:show-inheritance:
115-
116-
fastapi_jsonapi.exception.json_api module
117-
-------------------------------------------------------
118-
119-
.. automodule:: fastapi_jsonapi.exception.json_api
120-
:members:
121-
:undoc-members:
122-
:show-inheritance:
123-
124-
fastapi_jsonapi.exception.base module
125-
-------------------------------------------------------
126-
127-
.. automodule:: fastapi_jsonapi.exception.base
128-
:members:
129-
:undoc-members:
130-
:show-inheritance:
131-
132108
fastapi_jsonapi.api module
133-
-------------------------------------------------------
109+
--------------------------
134110

135111
.. automodule:: fastapi_jsonapi.api
136112
:members:
137113
:undoc-members:
138114
:show-inheritance:
139115

140116
fastapi_jsonapi.jsonapi_typing module
141-
-------------------------------------------------------
117+
-------------------------------------
142118

143119
.. automodule:: fastapi_jsonapi.jsonapi_typing
144120
:members:
145121
:undoc-members:
146122
:show-inheritance:
147123

148-
fastapi_jsonapi.methods module
149-
-------------------------------------------------------
150-
151-
.. automodule:: fastapi_jsonapi.methods
152-
:members:
153-
:undoc-members:
154-
:show-inheritance:
155-
156-
fastapi_jsonapi.openapi module
157-
-------------------------------------------------------
158-
159-
.. automodule:: fastapi_jsonapi.openapi
160-
:members:
161-
:undoc-members:
162-
:show-inheritance:
163-
164124
fastapi_jsonapi.querystring module
165-
-------------------------------------------------------
125+
----------------------------------
166126

167127
.. automodule:: fastapi_jsonapi.querystring
168128
:members:
169129
:undoc-members:
170130
:show-inheritance:
171131

172132
fastapi_jsonapi.schema module
173-
-------------------------------------------------------
133+
-----------------------------
174134

175135
.. automodule:: fastapi_jsonapi.schema
176136
:members:
177137
:undoc-members:
178138
:show-inheritance:
179139

180140
fastapi_jsonapi.signature module
181-
-------------------------------------------------------
141+
--------------------------------
182142

183143
.. automodule:: fastapi_jsonapi.signature
184144
:members:
185145
:undoc-members:
186146
:show-inheritance:
187147

188148
fastapi_jsonapi.splitter module
189-
-------------------------------------------------------
149+
-------------------------------
190150

191151
.. automodule:: fastapi_jsonapi.splitter
192152
:members:

0 commit comments

Comments
 (0)