Compare commits

...

2 Commits

Author SHA1 Message Date
Histausse 1bc17e8f25 new test 2023-05-20 15:15:59 +02:00
Histausse 11e4aed516 fix (?) flake 2023-05-20 15:04:04 +02:00
3 changed files with 25 additions and 4 deletions

View File

@ -11,14 +11,28 @@
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
flake-utils.lib.eachDefaultSystem (system:
let
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication;
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides;
pkgs = nixpkgs.legacyPackages.${system};
in
{
packages = {
test_flake_poetry2nix = mkPoetryApplication { projectDir = self; };
test_flake_poetry2nix = mkPoetryApplication {
projectDir = self;
overrides = overrides.withDefaults (self: super: {
pillow = super.pillow.overridePythonAttrs(old: {
# https://github.com/nix-community/poetry2nix/issues/1139
patches = (old.patches or []) ++ nixpkgs.lib.optionals (old.version == "9.5.0") [
(pkgs.fetchpatch {
url = "https://github.com/python-pillow/Pillow/commit/0ec0a89ead648793812e11739e2a5d70738c6be5.diff";
sha256 = "sha256-rZfk+OXZU6xBpoumIW30E80gRsox/Goa3hMDxBUkTY0=";
})
];
});
});
};
docker = pkgs.dockerTools.buildImage {
name = "test_flake_poetry2nix";
tag = "latest";
copyToRoot = pkgs.buildEnv {
name = "test_flake_poetry2nix_root_img";
paths = [ self.packages.${system}.test_flake_poetry2nix ];

View File

@ -17,7 +17,7 @@ numpy = "^1.24.3"
matplotlib = "^3.7.1"
[tool.poetry.scripts]
test = "test_flake_poetry2nix.cli:main"
test_p2n = "test_flake_poetry2nix.cli:main"
[tool.poetry.group.dev.dependencies]
pytest = "*"

View File

@ -1,8 +1,15 @@
import numpy as np
import matplotlib.pyplot as plt
import argparse
from pathlib import Path
def main():
parser = argparse.ArgumentParser(prog="test_p2n")
parser.add_argument("file", type=Path)
args = parser.parse_args()
print("plop")
fig, (ax1, ax2) = plt.subplots(2, 1)
# make a little extra space between the subplots
fig.subplots_adjust(hspace=0.5)
@ -32,4 +39,4 @@ def main():
cxy, f = ax2.csd(s1, s2, 256, 1.0 / dt)
ax2.set_ylabel("CSD (dB)")
plt.savefig("test.pdf")
plt.savefig(args.file)