Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into upgrade_ibc
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Oct 14, 2024
2 parents f4fefb9 + 7b83d80 commit 859190a
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 27 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: install dependencies
run: |
python3 -m pip install --user --upgrade pipx
pipx install poetry
run: python3 -m pip install --user --upgrade poetry
- name: install
run: poetry install
- name: Run tests
Expand Down
62 changes: 40 additions & 22 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,53 @@
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
(flake-utils.lib.eachDefaultSystem (system:
outputs =
{
self,
nixpkgs,
flake-utils,
poetry2nix,
}:
(flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = (import nixpkgs {
inherit system;
config = { };
overlays = [
poetry2nix.overlays.default
];
});
overrides = pkgs.poetry2nix.overrides.withDefaults (self: super:
pkgs = (
import nixpkgs {
inherit system;
config = { };
overlays = [
poetry2nix.overlays.default
];
}
);
overrides = pkgs.poetry2nix.overrides.withDefaults (
self: super:
let
buildSystems = {
durations = [ "setuptools" ];
multitail2 = [ "setuptools" ];
pytest-github-actions-annotate-failures = [ "setuptools" ];
flake8-black = [ "setuptools" ];
flake8-isort = [ "hatchling" ];
docker = [ "hatchling" "hatch-vcs" ];
docker = [
"hatchling"
"hatch-vcs"
];
};
in
pkgs.lib.mapAttrs
(attr: systems: super.${attr}.overridePythonAttrs
(old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ map (a: self.${a}) systems;
}))
buildSystems
pkgs.lib.mapAttrs (
attr: systems:
super.${attr}.overridePythonAttrs (old: {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ map (a: self.${a}) systems;
})
) buildSystems
);
in
rec {
packages.default = pkgs.poetry2nix.mkPoetryApplication
{
projectDir = ./.;
inherit overrides;
};
packages.default = pkgs.poetry2nix.mkPoetryApplication {
projectDir = ./.;
inherit overrides;
};
apps.default = {
type = "app";
program = "${packages.default}/bin/pystarport";
Expand All @@ -53,6 +65,12 @@
projectDir = ./.;
inherit overrides;
})
(pkgs.poetry2nix.mkPoetryEditablePackage {
projectDir = ./.;
editablePackageSources = {
pystarport = ./pystarport;
};
})
];
};
}
Expand Down
6 changes: 4 additions & 2 deletions pystarport/tests/test_expansion/test_expansion.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ def test_expansion(type, func):
}
}

path = Path(__file__).parent

# overriding dotenv with absolute path is expanded and has diff
dotenv = os.path.abspath("test_expansion/dotenv1")
dotenv = os.path.abspath(path / "dotenv1")
config = func(cronos_has_dotenv, dotenv)
assert DeepDiff(
base_config,
Expand All @@ -72,7 +74,7 @@ def test_expansion(type, func):
}

# overriding dotenv with absolute path is expanded and no diff
dotenv = os.path.abspath("test_expansion/dotenv")
dotenv = os.path.abspath(path / "dotenv")
config = func(cronos_has_posix_no_dotenv, dotenv)
assert not DeepDiff(
base_config,
Expand Down

0 comments on commit 859190a

Please sign in to comment.