Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
- "3.14"
tox-post-environments:
- "py3.9-mindeps"
- "py3.9-orjson"
- "py3.14-orjson"
- "py3.11-sphinxext"
- "coverage_report"

Expand All @@ -53,6 +55,7 @@ jobs:
- "3.11"
tox-post-environments:
- "py3.11-sphinxext"
- "py3.14-orjson"
- "coverage_report"

- name: "Windows"
Expand All @@ -62,6 +65,7 @@ jobs:
- "3.11"
tox-post-environments:
- "py3.9-mindeps"
- "py3.14-orjson"
- "py3.11-sphinxext"
- "coverage_report"

Expand Down
30 changes: 30 additions & 0 deletions changelog.d/20260501_170758_sirosen_define_orjson_encoder.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Added
-----

- The SDK now supports use of ``orjson`` as an alternative JSON encoder and decoder.
When ``GLOBUS_SDK_USE_ORJSON=1`` is set, request sending and response decoding
will use ``orjson``. (:pr:`NUMBER`)

- Use of ``orjson`` is optional, but if the variable is set and ``orjson``
is not installed, errors will be emitted.

- The setting can also be configured on transport objects with the init
option, ``use_orjson=True``.

- In a future major version of the SDK, use of ``orjson`` will default to
true when it is available.

- ``RequestsTransport`` objects are now visible via
``RequestsTransport.get_current_transport()``, a staticmethod, while the
transport is sending a request or being used to handle a response. This
method raises a ``LookupError`` if there is no currently active transport.
(:pr:`NUMBER`)

Deprecated
----------

- The ``RequestsTransport`` class supports configuration of request encoding
via a class-variable mapping, ``encoders``. This limits the ability of the
SDK to apply per-object customizations, as in the case of ``orjson``
support. The class variable ``encoders`` is deprecated, and users should
leverage the new ``encoder_map`` instance variable instead.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ docs = [
"scriv",
]
coverage = ["coverage[toml]"]
orjson = ["orjson>=3"]
test = [
{include-group = "coverage"},
"pytest", "pytest-xdist", "pytest-randomly", "flaky",
Expand All @@ -83,6 +84,8 @@ typing = [
"responses",
# similarly, sphinx is needed to type-check our sphinx extension
"sphinx",
# include any optional test deps
{include-group = "orjson"},
]
typing-mindeps = [
{include-group = "typing"},
Expand Down
55 changes: 55 additions & 0 deletions requirements/py3.10/test-orjson.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# tox p -m freezedeps
#
certifi==2026.4.22
# via requests
charset-normalizer==3.4.7
# via requests
coverage==7.13.5
# via -r .test.in
exceptiongroup==1.3.1
# via pytest
execnet==2.1.2
# via pytest-xdist
flaky==3.8.1
# via -r .test.in
idna==3.13
# via requests
iniconfig==2.3.0
# via pytest
orjson==3.11.8
# via -r .orjson.in
packaging==26.2
# via pytest
pluggy==1.6.0
# via pytest
pygments==2.20.0
# via pytest
pytest==9.0.3
# via
# -r .test.in
# pytest-randomly
# pytest-xdist
pytest-randomly==4.1.0
# via -r .test.in
pytest-xdist==3.8.0
# via -r .test.in
pyyaml==6.0.3
# via responses
requests==2.33.1
# via responses
responses==0.26.0
# via -r .test.in
tomli==2.4.1
# via
# coverage
# pytest
typing-extensions==4.15.0
# via exceptiongroup
urllib3==2.6.3
# via
# requests
# responses
34 changes: 19 additions & 15 deletions requirements/py3.10/typing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,43 @@
#
alabaster==1.0.0
# via sphinx
babel==2.17.0
babel==2.18.0
# via sphinx
certifi==2025.11.12
certifi==2026.4.22
# via requests
charset-normalizer==3.4.4
charset-normalizer==3.4.7
# via requests
docutils==0.21.2
# via sphinx
idna==3.11
idna==3.13
# via requests
imagesize==1.4.1
imagesize==2.0.0
# via sphinx
jinja2==3.1.6
# via sphinx
librt==0.9.0
# via mypy
markupsafe==3.0.3
# via jinja2
mypy==1.18.2
mypy==1.20.2
# via -r .typing.in
mypy-extensions==1.1.0
# via mypy
packaging==25.0
orjson==3.11.8
# via -r .typing.in
packaging==26.2
# via sphinx
pathspec==0.12.1
pathspec==1.1.1
# via mypy
pygments==2.19.2
pygments==2.20.0
# via sphinx
pyyaml==6.0.3
# via responses
requests==2.32.5
requests==2.33.1
# via
# responses
# sphinx
responses==0.25.8
responses==0.26.0
# via -r .typing.in
snowballstemmer==3.0.1
# via sphinx
Expand All @@ -56,23 +60,23 @@ sphinxcontrib-qthelp==2.0.0
# via sphinx
sphinxcontrib-serializinghtml==2.0.0
# via sphinx
tomli==2.3.0
tomli==2.4.1
# via
# mypy
# sphinx
types-cryptography==3.3.23.2
# via types-jwt
types-docutils==0.22.3.20251115
types-docutils==0.22.3.20260408
# via -r .typing.in
types-jwt==0.1.3
# via -r .typing.in
types-requests==2.32.4.20250913
types-requests==2.33.0.20260408
# via -r .typing.in
typing-extensions==4.15.0
# via
# -r .typing.in
# mypy
urllib3==2.5.0
urllib3==2.6.3
# via
# requests
# responses
Expand Down
47 changes: 47 additions & 0 deletions requirements/py3.11/test-orjson.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# tox p -m freezedeps
#
certifi==2026.4.22
# via requests
charset-normalizer==3.4.7
# via requests
coverage==7.13.5
# via -r .test.in
execnet==2.1.2
# via pytest-xdist
flaky==3.8.1
# via -r .test.in
idna==3.13
# via requests
iniconfig==2.3.0
# via pytest
orjson==3.11.8
# via -r .orjson.in
packaging==26.2
# via pytest
pluggy==1.6.0
# via pytest
pygments==2.20.0
# via pytest
pytest==9.0.3
# via
# -r .test.in
# pytest-randomly
# pytest-xdist
pytest-randomly==4.1.0
# via -r .test.in
pytest-xdist==3.8.0
# via -r .test.in
pyyaml==6.0.3
# via responses
requests==2.33.1
# via responses
responses==0.26.0
# via -r .test.in
urllib3==2.6.3
# via
# requests
# responses
38 changes: 21 additions & 17 deletions requirements/py3.11/typing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,49 @@
#
alabaster==1.0.0
# via sphinx
babel==2.17.0
babel==2.18.0
# via sphinx
certifi==2025.11.12
certifi==2026.4.22
# via requests
charset-normalizer==3.4.4
charset-normalizer==3.4.7
# via requests
docutils==0.21.2
docutils==0.22.4
# via sphinx
idna==3.11
idna==3.13
# via requests
imagesize==1.4.1
imagesize==2.0.0
# via sphinx
jinja2==3.1.6
# via sphinx
librt==0.9.0
# via mypy
markupsafe==3.0.3
# via jinja2
mypy==1.18.2
mypy==1.20.2
# via -r .typing.in
mypy-extensions==1.1.0
# via mypy
packaging==25.0
orjson==3.11.8
# via -r .typing.in
packaging==26.2
# via sphinx
pathspec==0.12.1
pathspec==1.1.1
# via mypy
pygments==2.19.2
pygments==2.20.0
# via sphinx
pyyaml==6.0.3
# via responses
requests==2.32.5
requests==2.33.1
# via
# responses
# sphinx
responses==0.25.8
responses==0.26.0
# via -r .typing.in
roman-numerals-py==3.1.0
roman-numerals==4.1.0
# via sphinx
snowballstemmer==3.0.1
# via sphinx
sphinx==8.2.3
sphinx==9.0.4
# via -r .typing.in
sphinxcontrib-applehelp==2.0.0
# via sphinx
Expand All @@ -60,17 +64,17 @@ sphinxcontrib-serializinghtml==2.0.0
# via sphinx
types-cryptography==3.3.23.2
# via types-jwt
types-docutils==0.22.3.20251115
types-docutils==0.22.3.20260408
# via -r .typing.in
types-jwt==0.1.3
# via -r .typing.in
types-requests==2.32.4.20250913
types-requests==2.33.0.20260408
# via -r .typing.in
typing-extensions==4.15.0
# via
# -r .typing.in
# mypy
urllib3==2.5.0
urllib3==2.6.3
# via
# requests
# responses
Expand Down
47 changes: 47 additions & 0 deletions requirements/py3.12/test-orjson.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# by the following command:
#
# tox p -m freezedeps
#
certifi==2026.4.22
# via requests
charset-normalizer==3.4.7
# via requests
coverage==7.13.5
# via -r .test.in
execnet==2.1.2
# via pytest-xdist
flaky==3.8.1
# via -r .test.in
idna==3.13
# via requests
iniconfig==2.3.0
# via pytest
orjson==3.11.8
# via -r .orjson.in
packaging==26.2
# via pytest
pluggy==1.6.0
# via pytest
pygments==2.20.0
# via pytest
pytest==9.0.3
# via
# -r .test.in
# pytest-randomly
# pytest-xdist
pytest-randomly==4.1.0
# via -r .test.in
pytest-xdist==3.8.0
# via -r .test.in
pyyaml==6.0.3
# via responses
requests==2.33.1
# via responses
responses==0.26.0
# via -r .test.in
urllib3==2.6.3
# via
# requests
# responses
Loading
Loading