generated from linz/template-python-hello-world
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Cache Python packages in CI using the "linz" repository - Lint and format the Nix code - Create a symlink to the Python executable for easy IDE integration - Use the same version of Geos as in Ubuntu
- Loading branch information
Showing
6 changed files
with
81 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
*.pyc | ||
__pycache__ | ||
/.pytest_cache | ||
/python | ||
Thumbs.db | ||
/.venv | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,4 +57,3 @@ pytest = "*" | |
pytest-dependency = "*" | ||
pytest-mock = "*" | ||
pytest-subtests = "*" | ||
shellcheck-py = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
let | ||
pkgs = import (builtins.fetchTarball { | ||
name = "nixos-unstable-2024-09-17"; | ||
url = "https://github.com/nixos/nixpkgs/archive/345c263f2f53a3710abe117f28a5cb86d0ba4059.tar.gz"; | ||
sha256 = "1llzyzw7a0jqdn7p3px0sqa35jg24v5pklwxdybwbmbyr2q8cf5j"; | ||
}) { overlays = [ (_final: prev: { geos = prev.geos_3_11; }) ]; }; | ||
poetry2nix = import (builtins.fetchTarball { | ||
url = "https://github.com/nix-community/poetry2nix/archive/2024.9.1542864.tar.gz"; | ||
sha256 = "06vz5hwylvjvx4ywbv4y3kadq8zxmvpf5h7pjy6w1yhkwpjd6k25"; | ||
}) { inherit pkgs; }; | ||
poetryPackages = poetry2nix.mkPoetryPackages { | ||
projectDir = ./.; | ||
python = pkgs.python312; | ||
overrides = poetry2nix.overrides.withDefaults ( | ||
final: prev: { | ||
cryptography = prev.cryptography.overridePythonAttrs ( | ||
# TODO: Remove when <URL> is in poetry2nix | ||
old: { | ||
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ | ||
final.distutils | ||
]; | ||
} | ||
); | ||
} | ||
); | ||
}; | ||
pythonWithPackages = poetryPackages.python.withPackages (_ps: poetryPackages.poetryPackages); | ||
in | ||
pkgs.mkShell { | ||
packages = [ | ||
pythonWithPackages | ||
pkgs.bashInteractive | ||
pkgs.cacert | ||
pkgs.deadnix | ||
pkgs.gcc # To install Python debugging in IDEA | ||
pkgs.gdal | ||
pkgs.gitFull | ||
pkgs.nixfmt-rfc-style | ||
pkgs.nodejs | ||
pkgs.poetry | ||
pkgs.shellcheck | ||
pkgs.statix | ||
pkgs.which | ||
]; | ||
shellHook = '' | ||
ln --force --no-target-directory --symbolic "${pkgs.lib.getExe pythonWithPackages}" python | ||
''; | ||
} |