From 594db150ec95207c403b4937adf188cb91e51fcf Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Mon, 15 Jul 2024 23:38:28 +0200 Subject: [PATCH 01/11] feat(pendulum): Add version >=3.0.0 override with rust build hook See https://github.com/nix-community/poetry2nix/pull/1739 --- overrides/default.nix | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/overrides/default.nix b/overrides/default.nix index fcbfa76d4..37651dd40 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2124,6 +2124,48 @@ lib.composeManyExtensions [ } ); + pendulum = prev.pendulum.overridePythonAttrs ( + old: ( + # NOTE: Versions <3.0.0 is pure Python and is not PEP-517 compliant, + # which means they can not be built using recent Poetry versions. + if lib.versionOlder old.version "3" + then prev.pendulum + else + let + githubHash = { + "3.0.0" = "sha256-v0kp8dklvDeC7zdTDOpIbpuj13aGub+oCaYz2ytkEpI="; + }.${old.version} or lib.fakeHash; + + src = pkgs.fetchFromGitHub { + owner = "sdispater"; + repo = "pendulum"; + rev = old.version; + sha256 = githubHash; + }; + in + lib.optionalAttrs (!old.src.isWheel or false) ( + rec { + cargoRoot = "rust"; + # NOTE: rustPlatform.importCargoLock would require prePatch on Cargo.lock + # since that file has its version value set to "3.0.0-beta-1" + # instead of the "3.0.0" used in the Python pyproject.toml, and + # this would cause an integrity check error when building. + cargoDeps = pkgs.rustPlatform.fetchCargoTarball { + src = "${src.out}/${cargoRoot}"; + sha256 = "sha256-6cL3GXtGnmD/nruOykBRqNwXnB74sr9EEFFT0fXamp0="; + }; + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ + pkgs.rustPlatform.cargoSetupHook + pkgs.rustPlatform.maturinBuildHook + ]; + buildInputs = old.buildInputs or [ ] ++ lib.optionals pkgs.stdenv.isDarwin [ + pkgs.libiconv + ]; + } + ) + ) + ); + pikepdf = prev.pikepdf.overridePythonAttrs ( old: { buildInputs = old.buildInputs or [ ] ++ [ pkgs.qpdf final.pybind11 ]; From e0c4376e0232d920249a6b119cb1b8cc583fb798 Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 15:31:38 +0200 Subject: [PATCH 02/11] feat(pendulum): Apply nixpkgs-fmt See: https://github.com/nix-community/poetry2nix/pull/1739 --- overrides/default.nix | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/overrides/default.nix b/overrides/default.nix index 37651dd40..ab453af92 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2143,26 +2143,26 @@ lib.composeManyExtensions [ sha256 = githubHash; }; in - lib.optionalAttrs (!old.src.isWheel or false) ( - rec { - cargoRoot = "rust"; - # NOTE: rustPlatform.importCargoLock would require prePatch on Cargo.lock - # since that file has its version value set to "3.0.0-beta-1" - # instead of the "3.0.0" used in the Python pyproject.toml, and - # this would cause an integrity check error when building. - cargoDeps = pkgs.rustPlatform.fetchCargoTarball { - src = "${src.out}/${cargoRoot}"; - sha256 = "sha256-6cL3GXtGnmD/nruOykBRqNwXnB74sr9EEFFT0fXamp0="; - }; - nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ - pkgs.rustPlatform.cargoSetupHook - pkgs.rustPlatform.maturinBuildHook - ]; - buildInputs = old.buildInputs or [ ] ++ lib.optionals pkgs.stdenv.isDarwin [ - pkgs.libiconv - ]; - } - ) + lib.optionalAttrs (!old.src.isWheel or false) ( + rec { + cargoRoot = "rust"; + # NOTE: rustPlatform.importCargoLock would require prePatch on Cargo.lock + # since that file has its version value set to "3.0.0-beta-1" + # instead of the "3.0.0" used in the Python pyproject.toml, and + # this would cause an integrity check error when building. + cargoDeps = pkgs.rustPlatform.fetchCargoTarball { + src = "${src.out}/${cargoRoot}"; + sha256 = "sha256-6cL3GXtGnmD/nruOykBRqNwXnB74sr9EEFFT0fXamp0="; + }; + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ + pkgs.rustPlatform.cargoSetupHook + pkgs.rustPlatform.maturinBuildHook + ]; + buildInputs = old.buildInputs or [ ] ++ lib.optionals pkgs.stdenv.isDarwin [ + pkgs.libiconv + ]; + } + ) ) ); From 07602e052ca994b76da5dd39c1b2d3e46a2bd60b Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 16:21:47 +0200 Subject: [PATCH 03/11] feat(pendulum): Add test versions > 3.0.0 with rust See: https://github.com/nix-community/poetry2nix/pull/1739 --- tests/default.nix | 1 + tests/pendulum-with-rust/default.nix | 7 + tests/pendulum-with-rust/poetry.lock | 204 ++++++++++++++++++ tests/pendulum-with-rust/pyproject.toml | 15 ++ .../test_pendulum_with_rust.py | 0 5 files changed, 227 insertions(+) create mode 100644 tests/pendulum-with-rust/default.nix create mode 100644 tests/pendulum-with-rust/poetry.lock create mode 100644 tests/pendulum-with-rust/pyproject.toml create mode 100644 tests/pendulum-with-rust/test_pendulum_with_rust.py diff --git a/tests/default.nix b/tests/default.nix index 522e378e6..6f9711c4c 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -229,6 +229,7 @@ in } // lib.optionalAttrs (stdenv.isLinux && stdenv.isx86_64) { # x86_86-linux pendulum = callTest ./pendulum { }; + pendulum-with-rust = callTest ./pendulum-with-rust { }; tensorflow = callTest ./tensorflow { }; # Test deadlocks on darwin and fails to start at all with aarch64-linux, # sandboxing issue? diff --git a/tests/pendulum-with-rust/default.nix b/tests/pendulum-with-rust/default.nix new file mode 100644 index 000000000..de5847fd7 --- /dev/null +++ b/tests/pendulum-with-rust/default.nix @@ -0,0 +1,7 @@ +{ lib, poetry2nix, python39 }: +poetry2nix.mkPoetryApplication { + pyproject = ./pyproject.toml; + poetrylock = ./poetry.lock; + src = lib.cleanSource ./.; + python = python39; +} diff --git a/tests/pendulum-with-rust/poetry.lock b/tests/pendulum-with-rust/poetry.lock new file mode 100644 index 000000000..357ce5cf3 --- /dev/null +++ b/tests/pendulum-with-rust/poetry.lock @@ -0,0 +1,204 @@ +# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. + +[[package]] +name = "backports-zoneinfo" +version = "0.2.1" +description = "Backport of the standard library zoneinfo module" +optional = false +python-versions = ">=3.6" +files = [ + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:da6013fd84a690242c310d77ddb8441a559e9cb3d3d59ebac9aca1a57b2e18bc"}, + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:89a48c0d158a3cc3f654da4c2de1ceba85263fafb861b98b59040a5086259722"}, + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:1c5742112073a563c81f786e77514969acb58649bcdf6cdf0b4ed31a348d4546"}, + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-win32.whl", hash = "sha256:e8236383a20872c0cdf5a62b554b27538db7fa1bbec52429d8d106effbaeca08"}, + {file = "backports.zoneinfo-0.2.1-cp36-cp36m-win_amd64.whl", hash = "sha256:8439c030a11780786a2002261569bdf362264f605dfa4d65090b64b05c9f79a7"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:f04e857b59d9d1ccc39ce2da1021d196e47234873820cbeaad210724b1ee28ac"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:17746bd546106fa389c51dbea67c8b7c8f0d14b5526a579ca6ccf5ed72c526cf"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5c144945a7752ca544b4b78c8c41544cdfaf9786f25fe5ffb10e838e19a27570"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-win32.whl", hash = "sha256:e55b384612d93be96506932a786bbcde5a2db7a9e6a4bb4bffe8b733f5b9036b"}, + {file = "backports.zoneinfo-0.2.1-cp37-cp37m-win_amd64.whl", hash = "sha256:a76b38c52400b762e48131494ba26be363491ac4f9a04c1b7e92483d169f6582"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:8961c0f32cd0336fb8e8ead11a1f8cd99ec07145ec2931122faaac1c8f7fd987"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:e81b76cace8eda1fca50e345242ba977f9be6ae3945af8d46326d776b4cf78d1"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7b0a64cda4145548fed9efc10322770f929b944ce5cee6c0dfe0c87bf4c0c8c9"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-win32.whl", hash = "sha256:1b13e654a55cd45672cb54ed12148cd33628f672548f373963b0bff67b217328"}, + {file = "backports.zoneinfo-0.2.1-cp38-cp38-win_amd64.whl", hash = "sha256:4a0f800587060bf8880f954dbef70de6c11bbe59c673c3d818921f042f9954a6"}, + {file = "backports.zoneinfo-0.2.1.tar.gz", hash = "sha256:fadbfe37f74051d024037f223b8e001611eac868b5c5b06144ef4d8b799862f2"}, +] + +[package.extras] +tzdata = ["tzdata"] + +[[package]] +name = "importlib-resources" +version = "6.4.0" +description = "Read resources from Python packages" +optional = false +python-versions = ">=3.8" +files = [ + {file = "importlib_resources-6.4.0-py3-none-any.whl", hash = "sha256:50d10f043df931902d4194ea07ec57960f66a80449ff867bfe782b4c486ba78c"}, + {file = "importlib_resources-6.4.0.tar.gz", hash = "sha256:cdb2b453b8046ca4e3798eb1d84f3cce1446a0e8e7b5ef4efb600f19fc398145"}, +] + +[package.dependencies] +zipp = {version = ">=3.1.0", markers = "python_version < \"3.10\""} + +[package.extras] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["jaraco.test (>=5.4)", "pytest (>=6)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy", "pytest-ruff (>=0.2.1)", "zipp (>=3.17)"] + +[[package]] +name = "pendulum" +version = "3.0.0" +description = "Python datetimes made easy" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pendulum-3.0.0-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:2cf9e53ef11668e07f73190c805dbdf07a1939c3298b78d5a9203a86775d1bfd"}, + {file = "pendulum-3.0.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:fb551b9b5e6059377889d2d878d940fd0bbb80ae4810543db18e6f77b02c5ef6"}, + {file = "pendulum-3.0.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6c58227ac260d5b01fc1025176d7b31858c9f62595737f350d22124a9a3ad82d"}, + {file = "pendulum-3.0.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:60fb6f415fea93a11c52578eaa10594568a6716602be8430b167eb0d730f3332"}, + {file = "pendulum-3.0.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b69f6b4dbcb86f2c2fe696ba991e67347bcf87fe601362a1aba6431454b46bde"}, + {file = "pendulum-3.0.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:138afa9c373ee450ede206db5a5e9004fd3011b3c6bbe1e57015395cd076a09f"}, + {file = "pendulum-3.0.0-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:83d9031f39c6da9677164241fd0d37fbfc9dc8ade7043b5d6d62f56e81af8ad2"}, + {file = "pendulum-3.0.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:0c2308af4033fa534f089595bcd40a95a39988ce4059ccd3dc6acb9ef14ca44a"}, + {file = "pendulum-3.0.0-cp310-none-win_amd64.whl", hash = "sha256:9a59637cdb8462bdf2dbcb9d389518c0263799189d773ad5c11db6b13064fa79"}, + {file = "pendulum-3.0.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:3725245c0352c95d6ca297193192020d1b0c0f83d5ee6bb09964edc2b5a2d508"}, + {file = "pendulum-3.0.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6c035f03a3e565ed132927e2c1b691de0dbf4eb53b02a5a3c5a97e1a64e17bec"}, + {file = "pendulum-3.0.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:597e66e63cbd68dd6d58ac46cb7a92363d2088d37ccde2dae4332ef23e95cd00"}, + {file = "pendulum-3.0.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:99a0f8172e19f3f0c0e4ace0ad1595134d5243cf75985dc2233e8f9e8de263ca"}, + {file = "pendulum-3.0.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:77d8839e20f54706aed425bec82a83b4aec74db07f26acd039905d1237a5e1d4"}, + {file = "pendulum-3.0.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:afde30e8146292b059020fbc8b6f8fd4a60ae7c5e6f0afef937bbb24880bdf01"}, + {file = "pendulum-3.0.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:660434a6fcf6303c4efd36713ca9212c753140107ee169a3fc6c49c4711c2a05"}, + {file = "pendulum-3.0.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:dee9e5a48c6999dc1106eb7eea3e3a50e98a50651b72c08a87ee2154e544b33e"}, + {file = "pendulum-3.0.0-cp311-none-win_amd64.whl", hash = "sha256:d4cdecde90aec2d67cebe4042fd2a87a4441cc02152ed7ed8fb3ebb110b94ec4"}, + {file = "pendulum-3.0.0-cp311-none-win_arm64.whl", hash = "sha256:773c3bc4ddda2dda9f1b9d51fe06762f9200f3293d75c4660c19b2614b991d83"}, + {file = "pendulum-3.0.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:409e64e41418c49f973d43a28afe5df1df4f1dd87c41c7c90f1a63f61ae0f1f7"}, + {file = "pendulum-3.0.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a38ad2121c5ec7c4c190c7334e789c3b4624798859156b138fcc4d92295835dc"}, + {file = "pendulum-3.0.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fde4d0b2024b9785f66b7f30ed59281bd60d63d9213cda0eb0910ead777f6d37"}, + {file = "pendulum-3.0.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4b2c5675769fb6d4c11238132962939b960fcb365436b6d623c5864287faa319"}, + {file = "pendulum-3.0.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8af95e03e066826f0f4c65811cbee1b3123d4a45a1c3a2b4fc23c4b0dff893b5"}, + {file = "pendulum-3.0.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2165a8f33cb15e06c67070b8afc87a62b85c5a273e3aaa6bc9d15c93a4920d6f"}, + {file = "pendulum-3.0.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:ad5e65b874b5e56bd942546ea7ba9dd1d6a25121db1c517700f1c9de91b28518"}, + {file = "pendulum-3.0.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:17fe4b2c844bbf5f0ece69cfd959fa02957c61317b2161763950d88fed8e13b9"}, + {file = "pendulum-3.0.0-cp312-none-win_amd64.whl", hash = "sha256:78f8f4e7efe5066aca24a7a57511b9c2119f5c2b5eb81c46ff9222ce11e0a7a5"}, + {file = "pendulum-3.0.0-cp312-none-win_arm64.whl", hash = "sha256:28f49d8d1e32aae9c284a90b6bb3873eee15ec6e1d9042edd611b22a94ac462f"}, + {file = "pendulum-3.0.0-cp37-cp37m-macosx_10_12_x86_64.whl", hash = "sha256:d4e2512f4e1a4670284a153b214db9719eb5d14ac55ada5b76cbdb8c5c00399d"}, + {file = "pendulum-3.0.0-cp37-cp37m-macosx_11_0_arm64.whl", hash = "sha256:3d897eb50883cc58d9b92f6405245f84b9286cd2de6e8694cb9ea5cb15195a32"}, + {file = "pendulum-3.0.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2e169cc2ca419517f397811bbe4589cf3cd13fca6dc38bb352ba15ea90739ebb"}, + {file = "pendulum-3.0.0-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f17c3084a4524ebefd9255513692f7e7360e23c8853dc6f10c64cc184e1217ab"}, + {file = "pendulum-3.0.0-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:826d6e258052715f64d05ae0fc9040c0151e6a87aae7c109ba9a0ed930ce4000"}, + {file = "pendulum-3.0.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2aae97087872ef152a0c40e06100b3665d8cb86b59bc8471ca7c26132fccd0f"}, + {file = "pendulum-3.0.0-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:ac65eeec2250d03106b5e81284ad47f0d417ca299a45e89ccc69e36130ca8bc7"}, + {file = "pendulum-3.0.0-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:a5346d08f3f4a6e9e672187faa179c7bf9227897081d7121866358af369f44f9"}, + {file = "pendulum-3.0.0-cp37-none-win_amd64.whl", hash = "sha256:235d64e87946d8f95c796af34818c76e0f88c94d624c268693c85b723b698aa9"}, + {file = "pendulum-3.0.0-cp38-cp38-macosx_10_12_x86_64.whl", hash = "sha256:6a881d9c2a7f85bc9adafcfe671df5207f51f5715ae61f5d838b77a1356e8b7b"}, + {file = "pendulum-3.0.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:d7762d2076b9b1cb718a6631ad6c16c23fc3fac76cbb8c454e81e80be98daa34"}, + {file = "pendulum-3.0.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e8e36a8130819d97a479a0e7bf379b66b3b1b520e5dc46bd7eb14634338df8c"}, + {file = "pendulum-3.0.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:7dc843253ac373358ffc0711960e2dd5b94ab67530a3e204d85c6e8cb2c5fa10"}, + {file = "pendulum-3.0.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0a78ad3635d609ceb1e97d6aedef6a6a6f93433ddb2312888e668365908c7120"}, + {file = "pendulum-3.0.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b30a137e9e0d1f751e60e67d11fc67781a572db76b2296f7b4d44554761049d6"}, + {file = "pendulum-3.0.0-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:c95984037987f4a457bb760455d9ca80467be792236b69d0084f228a8ada0162"}, + {file = "pendulum-3.0.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:d29c6e578fe0f893766c0d286adbf0b3c726a4e2341eba0917ec79c50274ec16"}, + {file = "pendulum-3.0.0-cp38-none-win_amd64.whl", hash = "sha256:deaba8e16dbfcb3d7a6b5fabdd5a38b7c982809567479987b9c89572df62e027"}, + {file = "pendulum-3.0.0-cp39-cp39-macosx_10_12_x86_64.whl", hash = "sha256:b11aceea5b20b4b5382962b321dbc354af0defe35daa84e9ff3aae3c230df694"}, + {file = "pendulum-3.0.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:a90d4d504e82ad236afac9adca4d6a19e4865f717034fc69bafb112c320dcc8f"}, + {file = "pendulum-3.0.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:825799c6b66e3734227756fa746cc34b3549c48693325b8b9f823cb7d21b19ac"}, + {file = "pendulum-3.0.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad769e98dc07972e24afe0cff8d365cb6f0ebc7e65620aa1976fcfbcadc4c6f3"}, + {file = "pendulum-3.0.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6fc26907eb5fb8cc6188cc620bc2075a6c534d981a2f045daa5f79dfe50d512"}, + {file = "pendulum-3.0.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0c717eab1b6d898c00a3e0fa7781d615b5c5136bbd40abe82be100bb06df7a56"}, + {file = "pendulum-3.0.0-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:3ddd1d66d1a714ce43acfe337190be055cdc221d911fc886d5a3aae28e14b76d"}, + {file = "pendulum-3.0.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:822172853d7a9cf6da95d7b66a16c7160cb99ae6df55d44373888181d7a06edc"}, + {file = "pendulum-3.0.0-cp39-none-win_amd64.whl", hash = "sha256:840de1b49cf1ec54c225a2a6f4f0784d50bd47f68e41dc005b7f67c7d5b5f3ae"}, + {file = "pendulum-3.0.0-pp310-pypy310_pp73-macosx_10_12_x86_64.whl", hash = "sha256:3b1f74d1e6ffe5d01d6023870e2ce5c2191486928823196f8575dcc786e107b1"}, + {file = "pendulum-3.0.0-pp310-pypy310_pp73-macosx_11_0_arm64.whl", hash = "sha256:729e9f93756a2cdfa77d0fc82068346e9731c7e884097160603872686e570f07"}, + {file = "pendulum-3.0.0-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e586acc0b450cd21cbf0db6bae386237011b75260a3adceddc4be15334689a9a"}, + {file = "pendulum-3.0.0-pp310-pypy310_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:22e7944ffc1f0099a79ff468ee9630c73f8c7835cd76fdb57ef7320e6a409df4"}, + {file = "pendulum-3.0.0-pp310-pypy310_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:fa30af36bd8e50686846bdace37cf6707bdd044e5cb6e1109acbad3277232e04"}, + {file = "pendulum-3.0.0-pp310-pypy310_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:440215347b11914ae707981b9a57ab9c7b6983ab0babde07063c6ee75c0dc6e7"}, + {file = "pendulum-3.0.0-pp310-pypy310_pp73-win_amd64.whl", hash = "sha256:314c4038dc5e6a52991570f50edb2f08c339debdf8cea68ac355b32c4174e820"}, + {file = "pendulum-3.0.0-pp37-pypy37_pp73-macosx_10_12_x86_64.whl", hash = "sha256:5acb1d386337415f74f4d1955c4ce8d0201978c162927d07df8eb0692b2d8533"}, + {file = "pendulum-3.0.0-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a789e12fbdefaffb7b8ac67f9d8f22ba17a3050ceaaa635cd1cc4645773a4b1e"}, + {file = "pendulum-3.0.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:860aa9b8a888e5913bd70d819306749e5eb488e6b99cd6c47beb701b22bdecf5"}, + {file = "pendulum-3.0.0-pp37-pypy37_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:5ebc65ea033ef0281368217fbf59f5cb05b338ac4dd23d60959c7afcd79a60a0"}, + {file = "pendulum-3.0.0-pp37-pypy37_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:d9fef18ab0386ef6a9ac7bad7e43ded42c83ff7ad412f950633854f90d59afa8"}, + {file = "pendulum-3.0.0-pp38-pypy38_pp73-macosx_10_12_x86_64.whl", hash = "sha256:1c134ba2f0571d0b68b83f6972e2307a55a5a849e7dac8505c715c531d2a8795"}, + {file = "pendulum-3.0.0-pp38-pypy38_pp73-macosx_11_0_arm64.whl", hash = "sha256:385680812e7e18af200bb9b4a49777418c32422d05ad5a8eb85144c4a285907b"}, + {file = "pendulum-3.0.0-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9eec91cd87c59fb32ec49eb722f375bd58f4be790cae11c1b70fac3ee4f00da0"}, + {file = "pendulum-3.0.0-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4386bffeca23c4b69ad50a36211f75b35a4deb6210bdca112ac3043deb7e494a"}, + {file = "pendulum-3.0.0-pp38-pypy38_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:dfbcf1661d7146d7698da4b86e7f04814221081e9fe154183e34f4c5f5fa3bf8"}, + {file = "pendulum-3.0.0-pp38-pypy38_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:04a1094a5aa1daa34a6b57c865b25f691848c61583fb22722a4df5699f6bf74c"}, + {file = "pendulum-3.0.0-pp38-pypy38_pp73-win_amd64.whl", hash = "sha256:5b0ec85b9045bd49dd3a3493a5e7ddfd31c36a2a60da387c419fa04abcaecb23"}, + {file = "pendulum-3.0.0-pp39-pypy39_pp73-macosx_10_12_x86_64.whl", hash = "sha256:0a15b90129765b705eb2039062a6daf4d22c4e28d1a54fa260892e8c3ae6e157"}, + {file = "pendulum-3.0.0-pp39-pypy39_pp73-macosx_11_0_arm64.whl", hash = "sha256:bb8f6d7acd67a67d6fedd361ad2958ff0539445ef51cbe8cd288db4306503cd0"}, + {file = "pendulum-3.0.0-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fd69b15374bef7e4b4440612915315cc42e8575fcda2a3d7586a0d88192d0c88"}, + {file = "pendulum-3.0.0-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dc00f8110db6898360c53c812872662e077eaf9c75515d53ecc65d886eec209a"}, + {file = "pendulum-3.0.0-pp39-pypy39_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:83a44e8b40655d0ba565a5c3d1365d27e3e6778ae2a05b69124db9e471255c4a"}, + {file = "pendulum-3.0.0-pp39-pypy39_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:1a3604e9fbc06b788041b2a8b78f75c243021e0f512447806a6d37ee5214905d"}, + {file = "pendulum-3.0.0-pp39-pypy39_pp73-win_amd64.whl", hash = "sha256:92c307ae7accebd06cbae4729f0ba9fa724df5f7d91a0964b1b972a22baa482b"}, + {file = "pendulum-3.0.0.tar.gz", hash = "sha256:5d034998dea404ec31fae27af6b22cff1708f830a1ed7353be4d1019bb9f584e"}, +] + +[package.dependencies] +"backports.zoneinfo" = {version = ">=0.2.1", markers = "python_version < \"3.9\""} +importlib-resources = {version = ">=5.9.0", markers = "python_version < \"3.9\""} +python-dateutil = ">=2.6" +tzdata = ">=2020.1" + +[package.extras] +test = ["time-machine (>=2.6.0)"] + +[[package]] +name = "python-dateutil" +version = "2.9.0.post0" +description = "Extensions to the standard Python datetime module" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" +files = [ + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, +] + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +files = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] + +[[package]] +name = "tzdata" +version = "2024.1" +description = "Provider of IANA time zone data" +optional = false +python-versions = ">=2" +files = [ + {file = "tzdata-2024.1-py2.py3-none-any.whl", hash = "sha256:9068bc196136463f5245e51efda838afa15aaeca9903f49050dfa2679db4d252"}, + {file = "tzdata-2024.1.tar.gz", hash = "sha256:2674120f8d891909751c38abcdfd386ac0a5a1127954fbc332af6b5ceae07efd"}, +] + +[[package]] +name = "zipp" +version = "3.19.2" +description = "Backport of pathlib-compatible object wrapper for zip files" +optional = false +python-versions = ">=3.8" +files = [ + {file = "zipp-3.19.2-py3-none-any.whl", hash = "sha256:f091755f667055f2d02b32c53771a7a6c8b47e1fdbc4b72a8b9072b3eef8015c"}, + {file = "zipp-3.19.2.tar.gz", hash = "sha256:bf1dcf6450f873a13e952a29504887c89e6de7506209e5b1bcc3460135d4de19"}, +] + +[package.extras] +doc = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] + +[metadata] +lock-version = "2.0" +python-versions = "^3.8" +content-hash = "2580ecf7939395de3370c09cdbbdde72cf80194784365188a12ceb93440c5719" diff --git a/tests/pendulum-with-rust/pyproject.toml b/tests/pendulum-with-rust/pyproject.toml new file mode 100644 index 000000000..a25154ac2 --- /dev/null +++ b/tests/pendulum-with-rust/pyproject.toml @@ -0,0 +1,15 @@ +[tool.poetry] +name = "test_pendulum_with_rust" +version = "0.1.0" +description = "" +authors = [] + +[tool.poetry.dependencies] +python = "^3.8" +pendulum = "^3.0.0" + +[tool.poetry.dev-dependencies] + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/tests/pendulum-with-rust/test_pendulum_with_rust.py b/tests/pendulum-with-rust/test_pendulum_with_rust.py new file mode 100644 index 000000000..e69de29bb From 76504c5853421f41f87b09d6d43ee574a0a4ef6b Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 16:27:14 +0200 Subject: [PATCH 04/11] feat(pendulum): Fix override return value for versions <3.0.0 See: https://github.com/nix-community/poetry2nix/pull/1739 --- overrides/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overrides/default.nix b/overrides/default.nix index ab453af92..4d9b1012e 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2129,7 +2129,7 @@ lib.composeManyExtensions [ # NOTE: Versions <3.0.0 is pure Python and is not PEP-517 compliant, # which means they can not be built using recent Poetry versions. if lib.versionOlder old.version "3" - then prev.pendulum + then {} else let githubHash = { From f79513eb9aafaa8335e7cfdf61b33b85fc3ed5ca Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 16:57:36 +0200 Subject: [PATCH 05/11] feat(pendulum): Apply nixpkgs-fmt --- overrides/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overrides/default.nix b/overrides/default.nix index 4d9b1012e..d27f7afd4 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2129,7 +2129,7 @@ lib.composeManyExtensions [ # NOTE: Versions <3.0.0 is pure Python and is not PEP-517 compliant, # which means they can not be built using recent Poetry versions. if lib.versionOlder old.version "3" - then {} + then { } else let githubHash = { From e60cb1ef5befa7554727761d8e712b30122e5839 Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 17:01:17 +0200 Subject: [PATCH 06/11] fix(pendulum): Update sha256 value of cargoDeps --- overrides/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overrides/default.nix b/overrides/default.nix index d27f7afd4..1297c0808 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2152,7 +2152,7 @@ lib.composeManyExtensions [ # this would cause an integrity check error when building. cargoDeps = pkgs.rustPlatform.fetchCargoTarball { src = "${src.out}/${cargoRoot}"; - sha256 = "sha256-6cL3GXtGnmD/nruOykBRqNwXnB74sr9EEFFT0fXamp0="; + sha256 = "sha256-nhQM7QChMay/EQuAO9PSRguXq13Mfwkk5bNTn/8Fzlc="; }; nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.rustPlatform.cargoSetupHook From 28ae7a20f651d57db8915a9d7cd30c4dd03163f4 Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 19:58:32 +0200 Subject: [PATCH 07/11] feat(pendulum): Use importCargoLock without downloading from GitHub Previous approach of patching the source prior to build always results in some hash mismatch. So here we just use a drop-in Cargo.lock file, or rather what it would have looked like had the version been set correctly. See: https://github.com/nix-community/poetry2nix/pull/1739 --- overrides/default.nix | 23 +- overrides/pendulum/3.0.0-Cargo.lock | 318 ++++++++++++++++++++++++++++ 2 files changed, 321 insertions(+), 20 deletions(-) create mode 100644 overrides/pendulum/3.0.0-Cargo.lock diff --git a/overrides/default.nix b/overrides/default.nix index 1297c0808..3552eb3f9 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2131,28 +2131,11 @@ lib.composeManyExtensions [ if lib.versionOlder old.version "3" then { } else - let - githubHash = { - "3.0.0" = "sha256-v0kp8dklvDeC7zdTDOpIbpuj13aGub+oCaYz2ytkEpI="; - }.${old.version} or lib.fakeHash; - - src = pkgs.fetchFromGitHub { - owner = "sdispater"; - repo = "pendulum"; - rev = old.version; - sha256 = githubHash; - }; - in lib.optionalAttrs (!old.src.isWheel or false) ( - rec { + { cargoRoot = "rust"; - # NOTE: rustPlatform.importCargoLock would require prePatch on Cargo.lock - # since that file has its version value set to "3.0.0-beta-1" - # instead of the "3.0.0" used in the Python pyproject.toml, and - # this would cause an integrity check error when building. - cargoDeps = pkgs.rustPlatform.fetchCargoTarball { - src = "${src.out}/${cargoRoot}"; - sha256 = "sha256-nhQM7QChMay/EQuAO9PSRguXq13Mfwkk5bNTn/8Fzlc="; + cargoDeps = pkgs.rustPlatform.importCargoLock { + lockFile = ./pendulum/3.0.0-Cargo.lock; }; nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.rustPlatform.cargoSetupHook diff --git a/overrides/pendulum/3.0.0-Cargo.lock b/overrides/pendulum/3.0.0-Cargo.lock new file mode 100644 index 000000000..1e20ee1b3 --- /dev/null +++ b/overrides/pendulum/3.0.0-Cargo.lock @@ -0,0 +1,318 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "_pendulum" +version = "3.0.0" +dependencies = [ + "mimalloc", + "pyo3", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "indoc" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306" + +[[package]] +name = "libc" +version = "0.2.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" + +[[package]] +name = "libmimalloc-sys" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3979b5c37ece694f1f5e51e7ecc871fdb0f517ed04ee45f88d15d6d553cb9664" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "mimalloc" +version = "0.1.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa01922b5ea280a911e323e4d2fd24b7fe5cc4042e0d2cda3c40775cdc4bdc9c" +dependencies = [ + "libmimalloc-sys", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + +[[package]] +name = "proc-macro2" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "pyo3" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb88ae05f306b4bfcde40ac4a51dc0b05936a9207a4b75b798c7729c4258a59" +dependencies = [ + "cfg-if", + "indoc", + "libc", + "memoffset", + "parking_lot", + "pyo3-build-config", + "pyo3-ffi", + "pyo3-macros", + "unindent", +] + +[[package]] +name = "pyo3-build-config" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "554db24f0b3c180a9c0b1268f91287ab3f17c162e15b54caaae5a6b3773396b0" +dependencies = [ + "once_cell", + "python3-dll-a", + "target-lexicon", +] + +[[package]] +name = "pyo3-ffi" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "922ede8759e8600ad4da3195ae41259654b9c55da4f7eec84a0ccc7d067a70a4" +dependencies = [ + "libc", + "pyo3-build-config", +] + +[[package]] +name = "pyo3-macros" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a5caec6a1dd355964a841fcbeeb1b89fe4146c87295573f94228911af3cc5a2" +dependencies = [ + "proc-macro2", + "pyo3-macros-backend", + "quote", + "syn", +] + +[[package]] +name = "pyo3-macros-backend" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0b78ccbb160db1556cdb6fd96c50334c5d4ec44dc5e0a968d0a1208fa0efa8b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "python3-dll-a" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f07cd4412be8fa09a721d40007c483981bbe072cd6a21f2e83e04ec8f8343f" +dependencies = [ + "cc", +] + +[[package]] +name = "quote" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "target-lexicon" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5" + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unindent" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c" + +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" From f287e40ce4fe115356c26638457ffb80c5881e94 Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 20:00:31 +0200 Subject: [PATCH 08/11] chore: Apply nixpkgs-fmt to entire source tree --- tests/ml-stack-old/default.nix | 4 ++-- tests/ml-stack/default.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ml-stack-old/default.nix b/tests/ml-stack-old/default.nix index a8360ca23..d55590601 100644 --- a/tests/ml-stack-old/default.nix +++ b/tests/ml-stack-old/default.nix @@ -27,8 +27,8 @@ let ''; in # Note: torch.cuda() will print False, even if you have a GPU, when this runs *during test.* -# But if you run the script below in your shell (rather than during build), it will print True. -# Presumably this is due to sandboxing. + # But if you run the script below in your shell (rather than during build), it will print True. + # Presumably this is due to sandboxing. runCommand "ml-stack-old-test" { } '' ${env}/bin/python "${testScript}" > $out '' diff --git a/tests/ml-stack/default.nix b/tests/ml-stack/default.nix index bb94e7ae7..c8507f8ef 100644 --- a/tests/ml-stack/default.nix +++ b/tests/ml-stack/default.nix @@ -27,8 +27,8 @@ let ''; in # Note: torch.cuda() will print False, even if you have a GPU, when this runs *during test.* -# But if you run the script below in your shell (rather than during build), it will print True. -# Presumably this is due to sandboxing. + # But if you run the script below in your shell (rather than during build), it will print True. + # Presumably this is due to sandboxing. runCommand "ml-stack-test" { } '' ${env}/bin/python "${testScript}" > $out '' From 6d1fba8601f9f84ee01ffbf729545f26203f15bf Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 20:08:09 +0200 Subject: [PATCH 09/11] chore: Revert 'apply nixpkgs-fmt to entire source tree' This reverts commit 777fb62b345f37374bd733420372d482551fb529. --- tests/ml-stack-old/default.nix | 4 ++-- tests/ml-stack/default.nix | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/ml-stack-old/default.nix b/tests/ml-stack-old/default.nix index d55590601..a8360ca23 100644 --- a/tests/ml-stack-old/default.nix +++ b/tests/ml-stack-old/default.nix @@ -27,8 +27,8 @@ let ''; in # Note: torch.cuda() will print False, even if you have a GPU, when this runs *during test.* - # But if you run the script below in your shell (rather than during build), it will print True. - # Presumably this is due to sandboxing. +# But if you run the script below in your shell (rather than during build), it will print True. +# Presumably this is due to sandboxing. runCommand "ml-stack-old-test" { } '' ${env}/bin/python "${testScript}" > $out '' diff --git a/tests/ml-stack/default.nix b/tests/ml-stack/default.nix index c8507f8ef..bb94e7ae7 100644 --- a/tests/ml-stack/default.nix +++ b/tests/ml-stack/default.nix @@ -27,8 +27,8 @@ let ''; in # Note: torch.cuda() will print False, even if you have a GPU, when this runs *during test.* - # But if you run the script below in your shell (rather than during build), it will print True. - # Presumably this is due to sandboxing. +# But if you run the script below in your shell (rather than during build), it will print True. +# Presumably this is due to sandboxing. runCommand "ml-stack-test" { } '' ${env}/bin/python "${testScript}" > $out '' From 0a424cf9f7a6f4f5a39ec7e06b62cf7f12b14a79 Mon Sep 17 00:00:00 2001 From: Wibowo Arindrarto Date: Tue, 16 Jul 2024 20:09:01 +0200 Subject: [PATCH 10/11] chore(pendulum): Format according to CI formatter check --- overrides/default.nix | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/overrides/default.nix b/overrides/default.nix index 3552eb3f9..3a7b844a6 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2131,21 +2131,19 @@ lib.composeManyExtensions [ if lib.versionOlder old.version "3" then { } else - lib.optionalAttrs (!old.src.isWheel or false) ( - { - cargoRoot = "rust"; - cargoDeps = pkgs.rustPlatform.importCargoLock { - lockFile = ./pendulum/3.0.0-Cargo.lock; - }; - nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ - pkgs.rustPlatform.cargoSetupHook - pkgs.rustPlatform.maturinBuildHook - ]; - buildInputs = old.buildInputs or [ ] ++ lib.optionals pkgs.stdenv.isDarwin [ - pkgs.libiconv - ]; - } - ) + lib.optionalAttrs (!old.src.isWheel or false) { + cargoRoot = "rust"; + cargoDeps = pkgs.rustPlatform.importCargoLock { + lockFile = ./pendulum/3.0.0-Cargo.lock; + }; + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ + pkgs.rustPlatform.cargoSetupHook + pkgs.rustPlatform.maturinBuildHook + ]; + buildInputs = old.buildInputs or [ ] ++ lib.optionals pkgs.stdenv.isDarwin [ + pkgs.libiconv + ]; + } ) ); From 04670ec18647819ec89ff5bde912670a0f554e1b Mon Sep 17 00:00:00 2001 From: Phillip Cloud <417981+cpcloud@users.noreply.github.com> Date: Fri, 27 Sep 2024 07:11:46 -0400 Subject: [PATCH 11/11] chore: roll version checking into optionalAttrs call --- overrides/default.nix | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/overrides/default.nix b/overrides/default.nix index 3a7b844a6..c309f1164 100644 --- a/overrides/default.nix +++ b/overrides/default.nix @@ -2125,26 +2125,22 @@ lib.composeManyExtensions [ ); pendulum = prev.pendulum.overridePythonAttrs ( - old: ( - # NOTE: Versions <3.0.0 is pure Python and is not PEP-517 compliant, - # which means they can not be built using recent Poetry versions. - if lib.versionOlder old.version "3" - then { } - else - lib.optionalAttrs (!old.src.isWheel or false) { - cargoRoot = "rust"; - cargoDeps = pkgs.rustPlatform.importCargoLock { - lockFile = ./pendulum/3.0.0-Cargo.lock; - }; - nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ - pkgs.rustPlatform.cargoSetupHook - pkgs.rustPlatform.maturinBuildHook - ]; - buildInputs = old.buildInputs or [ ] ++ lib.optionals pkgs.stdenv.isDarwin [ - pkgs.libiconv - ]; - } - ) + old: + # NOTE: Versions <3.0.0 is pure Python and is not PEP-517 compliant, + # which means they can not be built using recent Poetry versions. + lib.optionalAttrs (lib.versionAtLeast old.version "3" && (!old.src.isWheel or false)) { + cargoRoot = "rust"; + cargoDeps = pkgs.rustPlatform.importCargoLock { + lockFile = ./pendulum/3.0.0-Cargo.lock; + }; + nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ + pkgs.rustPlatform.cargoSetupHook + pkgs.rustPlatform.maturinBuildHook + ]; + buildInputs = old.buildInputs or [ ] ++ lib.optionals pkgs.stdenv.isDarwin [ + pkgs.libiconv + ]; + } ); pikepdf = prev.pikepdf.overridePythonAttrs (