Skip to content

As of v2023.8.19 local file dependencies default to being installed as editable #6054

@edmorley

Description

@edmorley

Issue description

Between Pipenv 2023.7.23 and 2023.8.19 there was an undocumented breaking change in default installation behaviour for local file directory installs that don't specify an explicit editable property, such as:

[packages]
mypackage = {file = "packages/mypackage"}

Before (in 2023.7.23 and earlier), such a dependency specifier was installed as a standard non-editable install.

Now (in 2023.8.19 and later), the install is performed as an editable install - ie: as though editable = "true" had been specified in the Pipfile / Pipfile.lock.

I presume this might be an unintended side-effect of #5793?

Expected result

If this behaviour change was intentional:

  • For it to have been documented in the changelog

If this wasn't intentional:

  • For the behaviour to have not changed
  • For Pipenv to have test coverage of this

And for bonus points either way:

Steps to replicate

Using https://github.com/edmorley/testcase-pipenv-file-editable:

Behaviour before (with 2023.7.23):

$ docker run --rm -it python:3.12 bash -c 'git clone -q https://github.com/edmorley/testcase-pipenv-file-editable && cd testcase-pipenv-file-editable && pip install -q --disable-pip-version-check --root-user-action=ignore pipenv==2023.7.23 && pipenv install && pipenv run pip show mypackage | grep -i location'
...
Location: /root/.local/share/virtualenvs/testcase-pipenv-file-editable-YkSiblPt/lib/python3.12/site-packages

Behaviour now (with 2023.8.19):

$ docker run --rm -it python:3.12 bash -c 'git clone -q https://github.com/edmorley/testcase-pipenv-file-editable && cd testcase-pipenv-file-editable && pip install -q --disable-pip-version-check --root-user-action=ignore pipenv==2023.8.19 && pipenv install && pipenv run pip show mypackage | grep -i location'
...
Location: /root/.local/share/virtualenvs/testcase-pipenv-file-editable-YkSiblPt/lib/python3.12/site-packages
Editable project location: /testcase-pipenv-file-editable/packages/mypackage

Note in the second output, the Editable project location shows that the package was installed in editable mode, when it was not before.

A package being installed in editable vs not editable mode has quite a few implications (such as whether the original location needs to be preserved for the environment to work, whether edits when developing take effect, plus the obvious path changes etc) - so a change like this is breaking, so should be mentioned in the changelog if it's intentional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions