Skip to content

Commit

Permalink
Merge pull request #1 from nix-community/develop
Browse files Browse the repository at this point in the history
 change to buildPythonApplication from poetry2nix
  • Loading branch information
Janik-Haag authored Dec 15, 2023
2 parents f8e4eb2 + fec6744 commit 40d337f
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 270 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
dist
result
cache
__pycache__
167 changes: 19 additions & 148 deletions flake.lock

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

46 changes: 31 additions & 15 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,43 +4,59 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
poetry2nix.url = "github:nix-community/poetry2nix";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";

pre-commit.url = "github:cachix/pre-commit-hooks.nix";
pre-commit.inputs.nixpkgs.follows = "nixpkgs";
pre-commit.inputs.nixpkgs-stable.follows = "";
pre-commit.inputs.flake-utils.follows = "flake-utils";
};

outputs = { self, nixpkgs, flake-utils, poetry2nix, pre-commit-hooks, ... }:
outputs = { self, nixpkgs, flake-utils, pre-commit, ... }:
flake-utils.lib.eachDefaultSystem
(
system:
let
pkgs = import nixpkgs { inherit system; overlays = [ poetry2nix.overlay ]; };
pkgs = import nixpkgs { inherit system; };
in
{
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
pre-commit-check = pre-commit.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
isort.enable = true;
black.enable = true;
#autoflake.enable = true;
flake8.enable = true;
};
};
};
defaultPackage = pkgs.poetry2nix.mkPoetryApplication {
projectDir = ./.;
defaultPackage = with pkgs.python3Packages; pkgs.python3.pkgs.buildPythonApplication {
pname = "first-time-contribution-tagger";
version = "0.1.1";
pyproject = true;

src = ./.;

nativeBuildInputs = [
poetry-core
];

propagatedBuildInputs = [
requests
];

nativeCheckInputs = [
pytestCheckHook
];
meta = with pkgs.lib; {
license = licenses.agpl3Only;
maintainers = with maintainers; [ janik ];
};
};
devShell = pkgs.mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
buildInputs = with pkgs; [
(pkgs.poetry2nix.mkPoetryEnv {
projectDir = ./.;

editablePackageSources = {
my-app = ./src;
};
})
python3.pkgs.requests
];
};
}
Expand Down
Loading

0 comments on commit 40d337f

Please sign in to comment.