You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.package = []
[metadata]
lock-version = "2.0"python-versions = "^3.11"content-hash = "81b2fa642d7f2d1219cf80112ace12d689d053d81be7f7addb98144d56fc0fb2"
The result is that changing the main function in app/__init__.py will change the behaviour of the testing script (within the devshell defined in the flake).
If this app package is moved to a src folder, and the following changes are applied to the flake.nix and pyproject.toml files, this behaviour is lost, and only recompiling the project will apply the changes. The only changes are changing the editablePackageSources.app attribute from ./. to ./src in the flake.nix file, and adding packages = [{include="app", from="src}] to the [tool.poetry] field of the pyproject.toml file:
default.nix/shell.nix/flake.nix:
{description="Application packaged using poetry2nix";inputs={flake-utils.url="github:numtide/flake-utils";nixpkgs.url="github:NixOS/nixpkgs/nixos-unstable-small";poetry2nix={url="github:nix-community/poetry2nix";inputs.nixpkgs.follows="nixpkgs";};};outputs={self,nixpkgs,flake-utils,poetry2nix}:
flake-utils.lib.eachDefaultSystem(system:
letpkgs=nixpkgs.legacyPackages.${system};inherit(poetry2nix.lib.mkPoetry2Nix{inheritpkgs;})mkPoetryEnv;in{packages.myapp-env=mkPoetryEnv{projectDir=self;editablePackageSources.app=./src;};devShells.default=pkgs.mkShell{inputsFrom=[self.packages.${system}.myapp-env.env];};});}
# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand.package = []
[metadata]
lock-version = "2.0"python-versions = "^3.11"content-hash = "81b2fa642d7f2d1219cf80112ace12d689d053d81be7f7addb98144d56fc0fb2"
The text was updated successfully, but these errors were encountered:
Describe the issue
When a package is in a
src
directory, theeditablePackageSources
attribute doesn't work.Additional context
Set up a package
app
in the main directory, with a single__init__.py
file:If the
flake.nix
andpyproject.toml
files are set up like this:default.nix
/shell.nix
/flake.nix
:pyproject.toml
:poetry.lock
:The result is that changing the main function in
app/__init__.py
will change the behaviour of thetesting
script (within the devshell defined in the flake).If this
app
package is moved to asrc
folder, and the following changes are applied to theflake.nix
andpyproject.toml
files, this behaviour is lost, and only recompiling the project will apply the changes. The only changes are changing theeditablePackageSources.app
attribute from./.
to./src
in theflake.nix
file, and addingpackages = [{include="app", from="src}]
to the[tool.poetry]
field of thepyproject.toml
file:default.nix
/shell.nix
/flake.nix
:pyproject.toml
:poetry.lock
:The text was updated successfully, but these errors were encountered: