Skip to content
Merged
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
3 changes: 2 additions & 1 deletion dev/poetry2setup
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env nix-shell
#!nix-shell --pure -p python3Packages.black -p python3Packages.poetry-core -p bash -i bash
#!nix-shell -I nixpkgs=channel:nixos-unstable-small --pure -p python3Packages.black -p python3Packages.poetry-core -p bash -i bash
# shellcheck shell=bash
# vim: filetype=sh

set -euo pipefail
Expand Down
14 changes: 14 additions & 0 deletions dev/update-lock-files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=channel:nixos-unstable-small --pure -p poetry nix -i bash
# shellcheck shell=bash
set -euo pipefail

export PYTHONHASHSEED=42

TOP="${1:-$(dirname "$(dirname "$(readlink -f "$0")")")}"

pushd "${TOP}" > /dev/null || exit 1
poetry lock --no-update
poetry export --dev --without-hashes --no-ansi --extras all > "${TOP}/requirements.txt"
"${TOP}/dev/poetry2setup" -o "${TOP}/setup.py"
popd > /dev/null || exit 1
22 changes: 1 addition & 21 deletions nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import sources.nixpkgs {
# subprocess invocations of `mkdocs` by `mike` to see Python dependencies.
#
# This shouldn't be necessary, but I think the nix wrappers may be
# indavertently preventing this.
# inadvertently preventing this.
text = ''
export PYTHONPATH TEMPDIR

Expand All @@ -57,26 +57,6 @@ import sources.nixpkgs {
'';
};

aws-sdk-cpp = (super.aws-sdk-cpp.overrideAttrs (attrs: {
patches = (attrs.patches or [ ]) ++ [
# https://github.com/aws/aws-sdk-cpp/pull/1912
(pkgs.fetchpatch {
url = "https://github.com/aws/aws-sdk-cpp/commit/1884876d331f97e75e60a2f210b4ecd8401ecc8f.patch";
sha256 = "sha256-nea8TF6iJcHjwv0nsbrbw15ALQfLeB/DvRRpk35AWAU=";
})
];
})).override {
apis = [
"cognito-identity"
"config"
"core"
"identity-management"
"s3"
"sts"
"transfer"
];
};

changelog = pkgs.writeShellApplication {
name = "changelog";
runtimeInputs = [ pkgs.nodePackages.conventional-changelog-cli ];
Expand Down
12 changes: 6 additions & 6 deletions nix/sources.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 17 additions & 16 deletions poetry-overrides.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,30 @@ self: super:
let
inherit (self) pkgs;
inherit (pkgs) lib stdenv;
numpyVersion = self.numpy.version;
numpyVersion = super.numpy.version;
parallelizeSetupPy = drv: drv.overridePythonAttrs (attrs: {
format = "setuptools";
enableParallelBuilding = true;
setupPyBuildFlags = attrs.setupPyBuildFlags or [ ] ++ [ "--parallel" "$NIX_BUILD_CORES" ];
});
versionBetween = version: lower: upper:
lib.versionAtLeast version lower && lib.versionOlder version upper;
in
{
# this patch only applies to macos and only with numpy versions >=1.21,<1.21.2
# see https://github.com/numpy/numpy/issues/19624 for details
numpy = super.numpy.overridePythonAttrs (attrs: {
patches = (attrs.patches or [ ])
++ lib.optional
# this patch only applies to macos and only with numpy versions >=1.21,<1.21.2
(stdenv.isDarwin && (lib.versionAtLeast numpyVersion "1.21.0" && lib.versionOlder numpyVersion "1.21.2"))
(pkgs.fetchpatch {
url = "https://github.com/numpy/numpy/commit/8045183084042fbafc995dd26eb4d9ca45eb630e.patch";
sha256 = "14g69vq7llkh6smpfrb50iqga7fd360dkcc0rlwb5k2cz8bsii5b";
});
});
numpy = super.numpy.overridePythonAttrs (
attrs: lib.optionalAttrs
(stdenv.isDarwin && versionBetween numpyVersion "1.21.0" "1.21.2")
{
patches = attrs.patches or [ ] ++ [
(pkgs.fetchpatch {
url = "https://github.com/numpy/numpy/commit/8045183084042fbafc995dd26eb4d9ca45eb630e.patch";
sha256 = "14g69vq7llkh6smpfrb50iqga7fd360dkcc0rlwb5k2cz8bsii5b";
})
];
}
);

datafusion = super.datafusion.overridePythonAttrs (attrs: rec {
inherit (attrs) version;
Expand All @@ -31,7 +36,7 @@ in
sha256 = "sha256-9muPSFb4RjxP7X+qtUQ41rypgn0s9yWgmkyTA+edehU=";
};

patches = [
patches = attrs.patches or [ ] ++ [
(pkgs.fetchpatch {
name = "optional-mimalloc.patch";
url = "https://github.com/datafusion-contrib/datafusion-python/commit/a5b10e8ef19514361fc6062a8ad63d7a793c2111.patch";
Expand All @@ -52,10 +57,6 @@ in
};
});

tabulate = super.tabulate.overridePythonAttrs (_: {
TABULATE_INSTALL = "lib-only";
});

pandas = parallelizeSetupPy super.pandas;
pydantic = parallelizeSetupPy super.pydantic;

Expand Down
Loading