Skip to content

Commit

Permalink
devenv: use poetry instead of requirements.txt
Browse files Browse the repository at this point in the history
Currently requirements.txt is used. It is installed in enterShell. This
has 2 downsides:

- Loading devenv shell takes a longer time, because pip install reruns
every time the devenv shell is entered.
- The dependencies that are installed are not locked. The latest version
is chosen, which will result in differences in tooling for different
people. devenv docs from the past might not be reproducible.

The biggest downside I have seen is that the files are larger in size.
Though I might be biased to using poetry vs pip directly.
  • Loading branch information
bobvanderlinden committed Apr 21, 2023
1 parent 4e838d4 commit e85b081
Show file tree
Hide file tree
Showing 6 changed files with 1,004 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ result
/lib
pyvenv.cfg
/.direnv
/.venv
7 changes: 2 additions & 5 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
tasks:
- command: |
- command: |
cachix use devenv
nix build --accept-flake-config
./result/bin/devenv shell virtualenv .
./result/bin/devenv shell bin/pip install -r requirements.txt
./result/bin/devenv shell true
9 changes: 2 additions & 7 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
{
packages = [
(import ./src/devenv.nix { inherit pkgs; nix = inputs.nix; })
pkgs.python3Packages.virtualenv
pkgs.python3Packages.cairocffi
pkgs.cairo
pkgs.yaml2json
];

languages.python.enable = true;
languages.python.venv.enable = true;
languages.python.poetry.enable = true;

devcontainer.enable = true;
devcontainer.settings.customizations.vscode.extensions = [ "bbenoist.Nix" ];
Expand All @@ -19,10 +18,6 @@
processes.docs.exec = "mkdocs serve";
processes.build.exec = "${pkgs.watchexec}/bin/watchexec -e nix nix build";

enterShell = ''
pip install -r requirements.txt
'';

scripts.devenv-bump-version.exec = ''
# TODO: ask for the new version
# TODO: update the version in the mkdocs.yml
Expand Down
Loading

0 comments on commit e85b081

Please sign in to comment.