Skip to content

Commit

Permalink
Made the C extension mandatory when CBOR2_BUILD_C_EXTENSION=1
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Jan 14, 2024
1 parent 70aae50 commit faf035f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/versionhistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ This library adheres to `Semantic Versioning <http://semver.org/>`_.

- Added the ``cbor2`` command line tool (for ``pipx run cbor2``)
- Added support for native date encoding (bschoenmaeckers)
- Made the C extension mandatory when the environment variable ``CBOR2_BUILD_C_EXTENSION`` is set
to ``1``.
- Fixed ``SystemError`` in the C extension when decoding a ``Fractional`` with a bad
number of arguments
- Fixed ``SystemError`` in the C extension when the decoder object hook raises an
Expand All @@ -22,6 +24,10 @@ This library adheres to `Semantic Versioning <http://semver.org/>`_.
``CBORDecodeValueError``
- Fixed ``TypeError`` or ``ZeroDivisionError`` from a failed decoding of ``Fraction`` not being
wrapped as ``CBORDecodeValueError``
- Fixed ``TypeError`` or ``ValueError`` from a failed decoding of ``UUID`` not being wrapped as
``CBORDecodeValueError``
- Fixed ``TypeError`` from a failed decoding of ``MIMEMessage`` not being wrapped as
``CBORDecodeValueError``

**5.5.1** (2023-11-02)

Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ def check_libc():
cpython = platform.python_implementation() == "CPython"
windows = sys.platform.startswith("win")
use_c_ext = os.environ.get("CBOR2_BUILD_C_EXTENSION", None)
optional = True
if use_c_ext == "1":
build_c_ext = True
optional = False
elif use_c_ext == "0":
build_c_ext = False
else:
Expand All @@ -57,7 +59,7 @@ def check_libc():
"source/tags.c",
"source/halffloat.c",
],
# optional=True,
optional=optional,
)
kwargs = {"ext_modules": [_cbor2]}
else:
Expand Down

0 comments on commit faf035f

Please sign in to comment.