From 16d3f27c43c5ca44812e776325d0633f62e8b5bb Mon Sep 17 00:00:00 2001 From: John Sirois Date: Mon, 13 Jan 2025 14:47:51 -0800 Subject: [PATCH] Fix `ptex` being included in all scies. Only include it when needed. --- CHANGES.md | 6 ++++++ science/__init__.py | 2 +- science/dataclass/deserializer.py | 2 ++ uv.lock | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index af1c101..4b7a804 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,11 @@ # Release Notes +## 0.11.2 + +This release fixes a bug introduced in the 0.11.0 release whereby a `ptex` binary was always +included in each built scie even when the scie did not use `ptex`. This was functionally harmless +but did bloat the size of the resulting scie binary by ~5MB. + ## 0.11.1 This release brings two fixes for `science` on Windows: diff --git a/science/__init__.py b/science/__init__.py index 28c292a..38f28ae 100644 --- a/science/__init__.py +++ b/science/__init__.py @@ -3,6 +3,6 @@ from packaging.version import Version -__version__ = "0.11.1" +__version__ = "0.11.2" VERSION = Version(__version__) diff --git a/science/dataclass/deserializer.py b/science/dataclass/deserializer.py index da240ef..d6816b7 100644 --- a/science/dataclass/deserializer.py +++ b/science/dataclass/deserializer.py @@ -41,6 +41,8 @@ def _parse_field( ), ), ) + if not data_value and default is None: + return cast(_F, None) return cast(_F, parse(data_value, dataclass_type, custom_parsers=custom_parsers)) if type_.istype(int): diff --git a/uv.lock b/uv.lock index cce1f6d..22c51fd 100644 --- a/uv.lock +++ b/uv.lock @@ -517,7 +517,7 @@ wheels = [ [[package]] name = "science" -version = "0.11.1" +version = "0.11.2" source = { editable = "." } dependencies = [ { name = "appdirs" },