Skip to content

Commit

Permalink
Simplified and correct direnv and nix-shell environment.
Browse files Browse the repository at this point in the history
This simplifies the configuration by keeping everything in the
pyproject.yaml and just reading that environment into the nix-shell with
poetry2nix.  This should keep everything much more sane for python
projects and I'll verify this is correct with another project shortly.
  • Loading branch information
alunduil committed Oct 27, 2020
1 parent 31a0b13 commit 01563ef
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 40 deletions.
3 changes: 0 additions & 3 deletions .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,3 @@ watch_file nix/shell.nix
watch_file nix/default.nix
watch_file pyproject.toml
watch_file poetry.lock

# Used by pre-commit
layout python3
11 changes: 6 additions & 5 deletions nix/shell.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
let
pkgs = import <nixpkgs> {};
cron-install = import ./default.nix;
zfs-replicate = import ./default.nix;
in
pkgs.mkShell {
buildInputs = [
cron-install
pkgs.poetry
pkgs.python3
pkgs.python37Packages.virtualenv
zfs-replicate
(pkgs.poetry2nix.mkPoetryEnv { projectDir = ../.; })
];
shellHook = ''
unset SOURCE_DATE_EPOCH
'';
}
62 changes: 31 additions & 31 deletions poetry.lock

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

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,18 @@ packages = [

[tool.poetry.dependencies]
click = "^7.1.2"
pre-commit = "^2.7.1"
python = "^3.6.1"
stringcase = "^1.2.0"

[tool.poetry.dev-dependencies]
coveralls = "^2.1.1"
hypothesis = "^5.37.3"
pip = "^20.2.4"
pre-commit = "^2.7.1"
pytest = "^6.1.1"
pytest-cov = "^2.10.0"
vulture = "^2.0"
virtualenv = "^20.1.0"

[tool.poetry.scripts]
zfs-replicate = "zfs.replicate.cli.main:main"
Expand Down

0 comments on commit 01563ef

Please sign in to comment.