From 951d4bda4dad491c97f88d76ebf23a4d30479fb8 Mon Sep 17 00:00:00 2001 From: andressommerhoff Date: Mon, 14 Aug 2023 03:32:26 -0400 Subject: [PATCH 01/10] Fix dynamic_prefix() not doing recursively The function dynamic_prefix() was applying prefix only in the first element. The expected behavior was to do it recursively. The dog. --- dash_extensions/enrich.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dash_extensions/enrich.py b/dash_extensions/enrich.py index 6e5df24..af84307 100644 --- a/dash_extensions/enrich.py +++ b/dash_extensions/enrich.py @@ -927,7 +927,7 @@ def dynamic_prefix(app: Union[DashBlueprint, DashProxy], component: Component): if len(prefix_transforms) == 0: return prefix_transform: PrefixIdTransform = prefix_transforms[0] - prefix_component(prefix_transform.prefix, component, prefix_transform.escape) + prefix_recursively(component, prefix_transform.prefix, prefix_transform.prefix_func, prefix_transform.escape) # endregion From 27c0b6df19662b0b80ffe7bbdcb86e1b7bc5da4c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 21 Sep 2023 20:49:53 +0000 Subject: [PATCH 02/10] Bump cryptography from 41.0.2 to 41.0.4 Bumps [cryptography](https://github.com/pyca/cryptography) from 41.0.2 to 41.0.4. - [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst) - [Commits](https://github.com/pyca/cryptography/compare/41.0.2...41.0.4) --- updated-dependencies: - dependency-name: cryptography dependency-type: indirect ... Signed-off-by: dependabot[bot] --- poetry.lock | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/poetry.lock b/poetry.lock index 9b4e0d3..884b07d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -416,34 +416,34 @@ toml = ["tomli"] [[package]] name = "cryptography" -version = "41.0.2" +version = "41.0.4" description = "cryptography is a package which provides cryptographic recipes and primitives to Python developers." optional = false python-versions = ">=3.7" files = [ - {file = "cryptography-41.0.2-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:01f1d9e537f9a15b037d5d9ee442b8c22e3ae11ce65ea1f3316a41c78756b711"}, - {file = "cryptography-41.0.2-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:079347de771f9282fbfe0e0236c716686950c19dee1b76240ab09ce1624d76d7"}, - {file = "cryptography-41.0.2-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:439c3cc4c0d42fa999b83ded80a9a1fb54d53c58d6e59234cfe97f241e6c781d"}, - {file = "cryptography-41.0.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:f14ad275364c8b4e525d018f6716537ae7b6d369c094805cae45300847e0894f"}, - {file = "cryptography-41.0.2-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:84609ade00a6ec59a89729e87a503c6e36af98ddcd566d5f3be52e29ba993182"}, - {file = "cryptography-41.0.2-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:49c3222bb8f8e800aead2e376cbef687bc9e3cb9b58b29a261210456a7783d83"}, - {file = "cryptography-41.0.2-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:d73f419a56d74fef257955f51b18d046f3506270a5fd2ac5febbfa259d6c0fa5"}, - {file = "cryptography-41.0.2-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:2a034bf7d9ca894720f2ec1d8b7b5832d7e363571828037f9e0c4f18c1b58a58"}, - {file = "cryptography-41.0.2-cp37-abi3-win32.whl", hash = "sha256:d124682c7a23c9764e54ca9ab5b308b14b18eba02722b8659fb238546de83a76"}, - {file = "cryptography-41.0.2-cp37-abi3-win_amd64.whl", hash = "sha256:9c3fe6534d59d071ee82081ca3d71eed3210f76ebd0361798c74abc2bcf347d4"}, - {file = "cryptography-41.0.2-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:a719399b99377b218dac6cf547b6ec54e6ef20207b6165126a280b0ce97e0d2a"}, - {file = "cryptography-41.0.2-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:182be4171f9332b6741ee818ec27daff9fb00349f706629f5cbf417bd50e66fd"}, - {file = "cryptography-41.0.2-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:7a9a3bced53b7f09da251685224d6a260c3cb291768f54954e28f03ef14e3766"}, - {file = "cryptography-41.0.2-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:f0dc40e6f7aa37af01aba07277d3d64d5a03dc66d682097541ec4da03cc140ee"}, - {file = "cryptography-41.0.2-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:674b669d5daa64206c38e507808aae49904c988fa0a71c935e7006a3e1e83831"}, - {file = "cryptography-41.0.2-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:7af244b012711a26196450d34f483357e42aeddb04128885d95a69bd8b14b69b"}, - {file = "cryptography-41.0.2-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9b6d717393dbae53d4e52684ef4f022444fc1cce3c48c38cb74fca29e1f08eaa"}, - {file = "cryptography-41.0.2-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:192255f539d7a89f2102d07d7375b1e0a81f7478925b3bc2e0549ebf739dae0e"}, - {file = "cryptography-41.0.2-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:f772610fe364372de33d76edcd313636a25684edb94cee53fd790195f5989d14"}, - {file = "cryptography-41.0.2-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:b332cba64d99a70c1e0836902720887fb4529ea49ea7f5462cf6640e095e11d2"}, - {file = "cryptography-41.0.2-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:9a6673c1828db6270b76b22cc696f40cde9043eb90373da5c2f8f2158957f42f"}, - {file = "cryptography-41.0.2-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:342f3767e25876751e14f8459ad85e77e660537ca0a066e10e75df9c9e9099f0"}, - {file = "cryptography-41.0.2.tar.gz", hash = "sha256:7d230bf856164de164ecb615ccc14c7fc6de6906ddd5b491f3af90d3514c925c"}, + {file = "cryptography-41.0.4-cp37-abi3-macosx_10_12_universal2.whl", hash = "sha256:80907d3faa55dc5434a16579952ac6da800935cd98d14dbd62f6f042c7f5e839"}, + {file = "cryptography-41.0.4-cp37-abi3-macosx_10_12_x86_64.whl", hash = "sha256:35c00f637cd0b9d5b6c6bd11b6c3359194a8eba9c46d4e875a3660e3b400005f"}, + {file = "cryptography-41.0.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cecfefa17042941f94ab54f769c8ce0fe14beff2694e9ac684176a2535bf9714"}, + {file = "cryptography-41.0.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e40211b4923ba5a6dc9769eab704bdb3fbb58d56c5b336d30996c24fcf12aadb"}, + {file = "cryptography-41.0.4-cp37-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:23a25c09dfd0d9f28da2352503b23e086f8e78096b9fd585d1d14eca01613e13"}, + {file = "cryptography-41.0.4-cp37-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:2ed09183922d66c4ec5fdaa59b4d14e105c084dd0febd27452de8f6f74704143"}, + {file = "cryptography-41.0.4-cp37-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:5a0f09cefded00e648a127048119f77bc2b2ec61e736660b5789e638f43cc397"}, + {file = "cryptography-41.0.4-cp37-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:9eeb77214afae972a00dee47382d2591abe77bdae166bda672fb1e24702a3860"}, + {file = "cryptography-41.0.4-cp37-abi3-win32.whl", hash = "sha256:3b224890962a2d7b57cf5eeb16ccaafba6083f7b811829f00476309bce2fe0fd"}, + {file = "cryptography-41.0.4-cp37-abi3-win_amd64.whl", hash = "sha256:c880eba5175f4307129784eca96f4e70b88e57aa3f680aeba3bab0e980b0f37d"}, + {file = "cryptography-41.0.4-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:004b6ccc95943f6a9ad3142cfabcc769d7ee38a3f60fb0dddbfb431f818c3a67"}, + {file = "cryptography-41.0.4-pp310-pypy310_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:86defa8d248c3fa029da68ce61fe735432b047e32179883bdb1e79ed9bb8195e"}, + {file = "cryptography-41.0.4-pp310-pypy310_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:37480760ae08065437e6573d14be973112c9e6dcaf5f11d00147ee74f37a3829"}, + {file = "cryptography-41.0.4-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:b5f4dfe950ff0479f1f00eda09c18798d4f49b98f4e2006d644b3301682ebdca"}, + {file = "cryptography-41.0.4-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:7e53db173370dea832190870e975a1e09c86a879b613948f09eb49324218c14d"}, + {file = "cryptography-41.0.4-pp38-pypy38_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5b72205a360f3b6176485a333256b9bcd48700fc755fef51c8e7e67c4b63e3ac"}, + {file = "cryptography-41.0.4-pp38-pypy38_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:93530900d14c37a46ce3d6c9e6fd35dbe5f5601bf6b3a5c325c7bffc030344d9"}, + {file = "cryptography-41.0.4-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:efc8ad4e6fc4f1752ebfb58aefece8b4e3c4cae940b0994d43649bdfce8d0d4f"}, + {file = "cryptography-41.0.4-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:c3391bd8e6de35f6f1140e50aaeb3e2b3d6a9012536ca23ab0d9c35ec18c8a91"}, + {file = "cryptography-41.0.4-pp39-pypy39_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:0d9409894f495d465fe6fda92cb70e8323e9648af912d5b9141d616df40a87b8"}, + {file = "cryptography-41.0.4-pp39-pypy39_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:8ac4f9ead4bbd0bc8ab2d318f97d85147167a488be0e08814a37eb2f439d5cf6"}, + {file = "cryptography-41.0.4-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:047c4603aeb4bbd8db2756e38f5b8bd7e94318c047cfe4efeb5d715e08b49311"}, + {file = "cryptography-41.0.4.tar.gz", hash = "sha256:7febc3094125fc126a7f6fb1f420d0da639f3f32cb15c8ff0dc3997c4549f51a"}, ] [package.dependencies] @@ -1127,8 +1127,8 @@ files = [ [package.dependencies] numpy = [ {version = ">=1.20.3", markers = "python_version < \"3.10\""}, - {version = ">=1.21.0", markers = "python_version >= \"3.10\""}, {version = ">=1.23.2", markers = "python_version >= \"3.11\""}, + {version = ">=1.21.0", markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, ] python-dateutil = ">=2.8.2" pytz = ">=2020.1" From a9ddbaf9690b414f152106baeb90ee850c437356 Mon Sep 17 00:00:00 2001 From: Emil Haldrup Eriksen Date: Sun, 24 Sep 2023 15:46:59 +0200 Subject: [PATCH 03/10] Add dynamic components implementation --- dash_extensions/pages.py | 97 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 dash_extensions/pages.py diff --git a/dash_extensions/pages.py b/dash_extensions/pages.py new file mode 100644 index 0000000..701de93 --- /dev/null +++ b/dash_extensions/pages.py @@ -0,0 +1,97 @@ +import dash +from collections import OrderedDict +from typing import Optional +from dash import html, Input, Output, clientside_callback +from dash.development.base_component import Component + +""" +This module holds utilities related to the [Dash pages](https://dash.plotly.com/urls). +""" + +_ID_CONTENT = "_component_content" +_PATH_REGISTRY = OrderedDict() +_CONTAINER_REGISTRY = {} +_COMPONENT_CONTAINER = html.Div(id=_ID_CONTENT, disable_n_clicks=True) + +# region Monkey patch page registration function + +_original_register_page = dash.register_page + + +def _register_page(*args, components=None, **kwargs): + _original_register_page(*args, **kwargs) + if components is None: + return + module = kwargs['module'] if 'module' in kwargs else args[0] + page = dash.page_registry[module] + for component in components: + set_visible(component, page['path']) + + +dash.register_page = _register_page + + +# endregion + +# region Public interface + +def assign_container(component: Component, container: Component): + """ + By default, dynamic components are rendered into the '_COMPONENT_CONTAINER' declared above. Call this function to + specify that the component should be rendered in a different container. + :param component: the (dynamic) component in question + :param container: the container into which the component will be rendered + :return: None + """ + if component in _CONTAINER_REGISTRY: + raise ValueError("You can only register a component once.") + _CONTAINER_REGISTRY[component] = container + + +def set_visible(component: Component, path: str): + """ + Register path(s) for which a component should be visible. + :param component: the (dynamic) component in question + :param path: the (url) path for which the component should be visible + :return: None + """ + _PATH_REGISTRY.setdefault(component, []).append(path) + + +def setup_dynamic_components() -> html.Div: + """ + Initializes the dynamic components and returns the (default) container into which the components are rendered. + :return: the default container, into which dynamic components are rendered. Should be included in the layout, + unless all (dynamic) components are registered to custom containers (via 'register_component') + """ + _setup_callbacks() + return _COMPONENT_CONTAINER + + +# endregion + +# region Utils +def _prepare_container(container: Optional[Component] = None): + container = _COMPONENT_CONTAINER if container is None else container + # Make sure children is a list. + if container.children is None: + container.children = [] + if not isinstance(container.children, list): + container.children = [container.children] + return container + + +def _setup_callbacks(): + location = dash.dash._ID_LOCATION + components = list(_PATH_REGISTRY.keys()) + for component in components: + # Wrap in div to ensure 'hidden' prop exists. + wrapper = html.Div(component, disable_n_clicks=True, hidden=True) + # Add to container. + container = _prepare_container(_CONTAINER_REGISTRY.get(component, _COMPONENT_CONTAINER)) + container.children.append(wrapper) + # Setup callback. + f = f"function(x){{const paths = {_PATH_REGISTRY[component]}; return !paths.includes(x);}}" + clientside_callback(f, Output(wrapper, "hidden"), Input(location, "pathname")) + +# endregion From e48f5a6766b43a457093b3c7625b271a0a68403e Mon Sep 17 00:00:00 2001 From: Emil Haldrup Eriksen Date: Sun, 24 Sep 2023 16:12:09 +0200 Subject: [PATCH 04/10] Docstring update --- dash_extensions/pages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dash_extensions/pages.py b/dash_extensions/pages.py index 701de93..887db46 100644 --- a/dash_extensions/pages.py +++ b/dash_extensions/pages.py @@ -44,7 +44,7 @@ def assign_container(component: Component, container: Component): :return: None """ if component in _CONTAINER_REGISTRY: - raise ValueError("You can only register a component once.") + raise ValueError("You can assign a component to one container.") _CONTAINER_REGISTRY[component] = container @@ -62,7 +62,7 @@ def setup_dynamic_components() -> html.Div: """ Initializes the dynamic components and returns the (default) container into which the components are rendered. :return: the default container, into which dynamic components are rendered. Should be included in the layout, - unless all (dynamic) components are registered to custom containers (via 'register_component') + unless all (dynamic) components are assigned to custom containers (via 'assign_container') """ _setup_callbacks() return _COMPONENT_CONTAINER From 840832ad7b1c6414107eb72e972dd4100daf78d5 Mon Sep 17 00:00:00 2001 From: Emil Haldrup Eriksen Date: Sun, 24 Sep 2023 16:13:10 +0200 Subject: [PATCH 05/10] Docstring update --- dash_extensions/pages.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dash_extensions/pages.py b/dash_extensions/pages.py index 887db46..7d9c55c 100644 --- a/dash_extensions/pages.py +++ b/dash_extensions/pages.py @@ -71,6 +71,7 @@ def setup_dynamic_components() -> html.Div: # endregion # region Utils + def _prepare_container(container: Optional[Component] = None): container = _COMPONENT_CONTAINER if container is None else container # Make sure children is a list. From 0236a6f772f275e5b3cb25d8c3dc901346937ed2 Mon Sep 17 00:00:00 2001 From: Emil Haldrup Eriksen Date: Mon, 25 Sep 2023 13:09:56 +0200 Subject: [PATCH 06/10] Minor changes to dynamic components --- dash_extensions/pages.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/dash_extensions/pages.py b/dash_extensions/pages.py index 7d9c55c..61370d7 100644 --- a/dash_extensions/pages.py +++ b/dash_extensions/pages.py @@ -18,13 +18,13 @@ _original_register_page = dash.register_page -def _register_page(*args, components=None, **kwargs): +def _register_page(*args, dynamic_components=None, **kwargs): _original_register_page(*args, **kwargs) - if components is None: + if dynamic_components is None: return module = kwargs['module'] if 'module' in kwargs else args[0] page = dash.page_registry[module] - for component in components: + for component in dynamic_components: set_visible(component, page['path']) @@ -83,6 +83,7 @@ def _prepare_container(container: Optional[Component] = None): def _setup_callbacks(): + store = dash.dash._ID_STORE location = dash.dash._ID_LOCATION components = list(_PATH_REGISTRY.keys()) for component in components: @@ -92,7 +93,9 @@ def _setup_callbacks(): container = _prepare_container(_CONTAINER_REGISTRY.get(component, _COMPONENT_CONTAINER)) container.children.append(wrapper) # Setup callback. - f = f"function(x){{const paths = {_PATH_REGISTRY[component]}; return !paths.includes(x);}}" - clientside_callback(f, Output(wrapper, "hidden"), Input(location, "pathname")) + f = f"function(y, x){{const paths = {_PATH_REGISTRY[component]}; return !paths.includes(x);}}" + clientside_callback(f, Output(wrapper, "hidden"), + Input(store, "data"), + State(location, "pathname")) # endregion From cf8259e4a381dad1ee75e4128213282740fc2be9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Oct 2023 03:25:58 +0000 Subject: [PATCH 07/10] Bump urllib3 from 1.26.15 to 1.26.17 Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.15 to 1.26.17. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.26.15...1.26.17) --- updated-dependencies: - dependency-name: urllib3 dependency-type: direct:development ... Signed-off-by: dependabot[bot] --- poetry.lock | 10 +++++----- pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/poetry.lock b/poetry.lock index 884b07d..1f7ede1 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1679,13 +1679,13 @@ files = [ [[package]] name = "urllib3" -version = "1.26.15" +version = "1.26.17" description = "HTTP library with thread-safe connection pooling, file post, and more." optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" files = [ - {file = "urllib3-1.26.15-py2.py3-none-any.whl", hash = "sha256:aa751d169e23c7479ce47a0cb0da579e3ede798f994f5816a74e4f4500dcea42"}, - {file = "urllib3-1.26.15.tar.gz", hash = "sha256:8a388717b9476f934a21484e8c8e61875ab60644d29b9b39e11e4b9dc1c6b305"}, + {file = "urllib3-1.26.17-py2.py3-none-any.whl", hash = "sha256:94a757d178c9be92ef5539b8840d48dc9cf1b2709c9d6b588232a055c524458b"}, + {file = "urllib3-1.26.17.tar.gz", hash = "sha256:24d6a242c28d29af46c3fae832c36db3bbebcc533dd1bb549172cd739c82df21"}, ] [package.dependencies] @@ -1697,7 +1697,7 @@ PySocks = {version = ">=1.5.6,<1.5.7 || >1.5.7,<2.0", optional = true, markers = urllib3-secure-extra = {version = "*", optional = true, markers = "extra == \"secure\""} [package.extras] -brotli = ["brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] +brotli = ["brotli (==1.0.9)", "brotli (>=1.0.9)", "brotlicffi (>=0.8.0)", "brotlipy (>=0.6.0)"] secure = ["certifi", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "ipaddress", "pyOpenSSL (>=0.14)", "urllib3-secure-extra"] socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] @@ -1797,4 +1797,4 @@ mantine = ["dash-mantine-components"] [metadata] lock-version = "2.0" python-versions = ">=3.8,<4" -content-hash = "e38bf9254b9db42f8e89faac3a5924e27d2d02b4ab8decfca3fd5b8543e35a24" +content-hash = "f9295280d64502664a24044ade97b0a60c1afb648c8be4335eb2ea0b94ccdecb" diff --git a/pyproject.toml b/pyproject.toml index 1cd4286..3df02f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ requests = "^2.31.0" certifi = "^2023.07.22" uvicorn = "^0.20.0" sse-starlette = "^1.2.1" -urllib3 = "^1.26.9" +urllib3 = "^1.26.17" [build-system] requires = ["poetry-core>=1.0.0"] From 793e9934416fbf651d9f38a2bef9f0679f8dd3c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 19:26:41 +0000 Subject: [PATCH 08/10] Bump postcss from 8.4.13 to 8.4.31 Bumps [postcss](https://github.com/postcss/postcss) from 8.4.13 to 8.4.31. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.4.13...8.4.31) --- updated-dependencies: - dependency-name: postcss dependency-type: indirect ... Signed-off-by: dependabot[bot] --- package-lock.json | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6946e94..dd8d180 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7314,6 +7314,24 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", "dev": true }, + "node_modules/nanoid": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", + "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -11124,9 +11142,9 @@ } }, "node_modules/postcss": { - "version": "8.4.13", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.13.tgz", - "integrity": "sha512-jtL6eTBrza5MPzy8oJLFuUscHDXTV5KcLlqAWHl5q5WYRfnNRGSmOZmOZ1T6Gy7A99mOZfqungmZMpMmCVJ8ZA==", + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", "dev": true, "funding": [ { @@ -11136,10 +11154,14 @@ { "type": "tidelift", "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" } ], "dependencies": { - "nanoid": "^3.3.3", + "nanoid": "^3.3.6", "picocolors": "^1.0.0", "source-map-js": "^1.0.2" }, @@ -11225,18 +11247,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, - "node_modules/postcss/node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/prelude-ls": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", From 2b7542ec7827be8ad2f759c4ed66cc8a39ca6213 Mon Sep 17 00:00:00 2001 From: emer Date: Sat, 7 Oct 2023 12:24:04 +0200 Subject: [PATCH 09/10] Working on new pipeline --- .github/workflows/python-publish.yml | 7 ++++++- CHANGELOG.md | 15 +++++++++++++++ package.json | 2 +- poetry.lock | 4 ++-- pyproject.toml | 2 +- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index e2e05e1..d34a753 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -34,9 +34,14 @@ jobs: - run: poetry --version - name: Install dependencies run: poetry install - - name: Build and publish + - name: Build and publish to npm run: | poetry run npm install | echo "Ignore npm install error" poetry run npm run build + poetry run npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Build and publish to pypi + run: | poetry build poetry publish --username=${{ secrets.PYPI_USERNAME }} --password=${{ secrets.PYPI_PASSWORD }} diff --git a/CHANGELOG.md b/CHANGELOG.md index d698399..a42984f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to this project will be documented in this file. +## [1.0.4] - 07-10-23 + +### Added + +- Publishing to npm added to CICD pipeline. Fixes [#284](https://github.com/emilhe/dash-extensions/issues/284) + +### Changed + +- Dependencies updated +- A few bugfixes + +### Added + +- Added `SerializationTransform` and `DataclassTransform` + ## [1.0.3] - 31-07-23 ### Added diff --git a/package.json b/package.json index 14ca6a2..06eae39 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dash-extensions", - "version": "1.0.3", + "version": "1.0.4rc6", "description": "Extensions for Plotly Dash.", "main": "build/index.js", "scripts": { diff --git a/poetry.lock b/poetry.lock index 9b4e0d3..9ec2b7d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "aiofiles" @@ -1127,8 +1127,8 @@ files = [ [package.dependencies] numpy = [ {version = ">=1.20.3", markers = "python_version < \"3.10\""}, - {version = ">=1.21.0", markers = "python_version >= \"3.10\""}, {version = ">=1.23.2", markers = "python_version >= \"3.11\""}, + {version = ">=1.21.0", markers = "python_version >= \"3.10\" and python_version < \"3.11\""}, ] python-dateutil = ">=2.8.2" pytz = ">=2020.1" diff --git a/pyproject.toml b/pyproject.toml index 1cd4286..af14fb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "dash-extensions" -version = "1.0.3" +version = "1.0.4rc6" description = "Extensions for Plotly Dash." authors = ["emher "] license = "MIT" From 6aa0080835fd3d40340e5fd3dfa7a950459cfb1c Mon Sep 17 00:00:00 2001 From: emilhe Date: Sat, 7 Oct 2023 13:21:20 +0200 Subject: [PATCH 10/10] Add npm registry --- .github/workflows/python-publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index d34a753..04ef86a 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -17,6 +17,7 @@ jobs: - uses: actions/setup-node@v3 with: node-version: 16 + registry-url: https://registry.npmjs.org/ - name: Set up Python uses: actions/setup-python@v4 with: