Compare commits
No commits in common. "1bc17e8f25f775897415fbd931efa5801ef2b179" and "5db94471a62009013238e57b6aacab068d6fdff4" have entirely different histories.
1bc17e8f25
...
5db94471a6
18
flake.nix
18
flake.nix
|
|
@ -11,28 +11,14 @@
|
||||||
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
|
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
|
||||||
flake-utils.lib.eachDefaultSystem (system:
|
flake-utils.lib.eachDefaultSystem (system:
|
||||||
let
|
let
|
||||||
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication overrides;
|
inherit (poetry2nix.legacyPackages.${system}) mkPoetryApplication;
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = {
|
packages = {
|
||||||
test_flake_poetry2nix = mkPoetryApplication {
|
test_flake_poetry2nix = mkPoetryApplication { projectDir = self; };
|
||||||
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 {
|
docker = pkgs.dockerTools.buildImage {
|
||||||
name = "test_flake_poetry2nix";
|
name = "test_flake_poetry2nix";
|
||||||
tag = "latest";
|
|
||||||
copyToRoot = pkgs.buildEnv {
|
copyToRoot = pkgs.buildEnv {
|
||||||
name = "test_flake_poetry2nix_root_img";
|
name = "test_flake_poetry2nix_root_img";
|
||||||
paths = [ self.packages.${system}.test_flake_poetry2nix ];
|
paths = [ self.packages.${system}.test_flake_poetry2nix ];
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ numpy = "^1.24.3"
|
||||||
matplotlib = "^3.7.1"
|
matplotlib = "^3.7.1"
|
||||||
|
|
||||||
[tool.poetry.scripts]
|
[tool.poetry.scripts]
|
||||||
test_p2n = "test_flake_poetry2nix.cli:main"
|
test = "test_flake_poetry2nix.cli:main"
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
pytest = "*"
|
pytest = "*"
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,8 @@
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
import argparse
|
|
||||||
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
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)
|
fig, (ax1, ax2) = plt.subplots(2, 1)
|
||||||
# make a little extra space between the subplots
|
# make a little extra space between the subplots
|
||||||
fig.subplots_adjust(hspace=0.5)
|
fig.subplots_adjust(hspace=0.5)
|
||||||
|
|
@ -39,4 +32,4 @@ def main():
|
||||||
|
|
||||||
cxy, f = ax2.csd(s1, s2, 256, 1.0 / dt)
|
cxy, f = ax2.csd(s1, s2, 256, 1.0 / dt)
|
||||||
ax2.set_ylabel("CSD (dB)")
|
ax2.set_ylabel("CSD (dB)")
|
||||||
plt.savefig(args.file)
|
plt.savefig("test.pdf")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue