Skip to content

Local dependencies are always installed in editable mode #6221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tamboles98 opened this issue Aug 10, 2024 · 0 comments · Fixed by #6222
Closed

Local dependencies are always installed in editable mode #6221

tamboles98 opened this issue Aug 10, 2024 · 0 comments · Fixed by #6222
Assignees
Labels
Status: Awaiting Review This item is currently awaiting review. Type: Regression This issue is a regression of a previous behavior.

Comments

@tamboles98
Copy link

Issue description

When installing a package to the environment from a local path using pipenv install ., the package is always installed in editable mode

Pipenv: 2024.0.1
Python: 3.12.4

Expected result

Running: pipenv install . should:

  • Add the package in the current working directory (my_package going forward) to the pipfile, without the editable flag
  • Add my_package in the pipfile lock, without the editable flag
  • Install my_package in the virtual environment in non editable mode

Actual result

Running pipenv install .:

  • Adds the package in the current working directory (my_package going forward) to the pipfile, without the editable flag ✅
  • Adds my_package in the pipfile lock, without the editable flag ✅
  • Installs my_package in the virtual environment in editable mode ❌

Steps to replicate

  1. Have an installable python project in the current working directory
  2. Run pipenv install .
  3. Run pipenv shell
  4. Run pip show my_package (with the name of the package installed)
Name: my_package
Version: 0.1.0
Summary: Sample project
Home-page: 
Author: 
Author-email:
License: 
Location: .../.venv/lib/python3.12/site-packages
Editable project location: .../project_directory (This does not appear if the package is in non-editable mode)
Requires: 
Required-by:
  1. Open a python shell and:
import my_package
print(my_package.__file__) # Output: '/home/sacebell/notebooks/trobleshoot_pipenv/my_package/__init__.py'
# Code is not being loaded from the site_packages folder

Notes

  • This behavior also happens if the virtual environment is not in the project itself
  • This behavior also happens if the installation path is absolute and does not point to the current working directory
  • Manually editing the Pipfile to have my-package = {file = ".", editable=false}, then running pipenv lock and pipenv sync does not fix the issue
  • Running pipenv install -e . --verbose gives:
Installing dependencies from Pipfile.lock (6a1f4b)...
Writing supplied requirement line to temporary file: '-e .'
Install Phase: Editable Requirements
Preparing Installation of '-e .'

$ pipenv --support

Pipenv version: '2024.0.1'

Pipenv location: '/home/sacebell/.pyenv/versions/3.12.4/lib/python3.12/site-packages/pipenv'

Python location: '/home/sacebell/.pyenv/versions/3.12.4/bin/python3.12'

OS Name: 'posix'

User pip version: '24.0'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.12.4',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.10.0-31-amd64',
 'platform_system': 'Linux',
 'platform_version': '#1 SMP Debian 5.10.221-1 (2024-07-14)',
 'python_full_version': '3.12.4',
 'python_version': '3.12',
 'sys_platform': 'linux'}

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: 1
  • PIPENV_ACTIVE: 1

Contents of Pipfile ('/home/sacebell/notebooks/trobleshoot_pipenv/Pipfile'):

[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
my-package = {file = "."}

[dev-packages]

[requires]
python_version = "3.12"

Contents of Pipfile.lock ('/home/sacebell/notebooks/trobleshoot_pipenv/Pipfile.lock'):

{
    "_meta": {
        "hash": {
            "sha256": "affcb2de36f727e24e7110b01058d53eb409d0de54fd2886b2a0c9cb636a1f4b"
        },
        "pipfile-spec": 6,
        "requires": {
            "python_version": "3.12"
        },
        "sources": [
            {
                "name": "pypi",
                "url": "https://pypi.org/simple",
                "verify_ssl": true
            }
        ]
    },
    "default": {
        "my-package": {
            "file": "."
        }
    },
    "develop": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting Review This item is currently awaiting review. Type: Regression This issue is a regression of a previous behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants