Skip to content
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

Using 2023.9.1 editable package installation fails with --skiplock enabled #5917

Closed
stewartmiles opened this issue Sep 5, 2023 · 4 comments · Fixed by #5919
Closed

Using 2023.9.1 editable package installation fails with --skiplock enabled #5917

stewartmiles opened this issue Sep 5, 2023 · 4 comments · Fixed by #5919
Labels
Type: Bug 🐛 This issue is a bug.

Comments

@stewartmiles
Copy link

Issue description

Enabling --skiplock e.g via a .env file causes editable package installation to fail.

Expected result

When enabling --skiplock it would be great if editable package installation succeeded as it did in version 2023.7.23.

Actual result

Here's a minimal example using https://github.com/stewartmiles/pipenv_editable_install_repro

echo 'PIPENV_SKIP_LOCK=true' > .env && \
  pipenv --python $(which python) && \
  pipenv install -e ./test-hello

which fails with:

Loading .env environment variables...
Creating a virtualenv for this project...
Pipfile: /home/stewart/src/pipenv_editable_install_repro/Pipfile
Using /usr/bin/python (3.8.10) to create virtualenv...
⠋ Creating virtual environment...created virtual environment CPython3.8.10.final.0-64 in 53ms
  creator CPython3Posix(dest=/home/stewart/src/pipenv_editable_install_repro/.venv, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/stewart/.local/share/virtualenv)
    added seed packages: pip==23.2.1, setuptools==68.1.2, wheel==0.41.2
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

✔ Successfully created virtual environment!
Virtualenv location: /home/stewart/src/pipenv_editable_install_repro/.venv
Creating a Pipfile for this project...
Loading .env environment variables...
The flag --skip-lock has been reintroduced (but is not recommended).  Without the lock resolver it is
difficult to manage multiple package indexes, and hash checking is not provided.  However it can help
manage installs with current deficiencies in locking across platforms.
Installing -e ./test-hello...
Resolving -e ./test-hello...
Added test-hello to Pipfile's [packages] ...
✔ Installation Succeeded
Installing dependencies from Pipfile...
[pipenv.exceptions.InstallError]: ERROR: Could not find a version that satisfies the requirement test-hello (from versions: none)
[pipenv.exceptions.InstallError]: ERROR: No matching distribution found for test-hello
ERROR: Couldn't install package: {}
 Package installation failed...

Steps to replicate

See above. Also I've updated https://github.com/stewartmiles/pipenv_editable_install_repro/blob/main/try_pipenv_versions.sh to test this case as well.


$ pipenv --support

Pipenv version: '2023.9.1'

Pipenv location: '/home/stewart/.local/pipx/venvs/pipenv/lib/python3.8/site-packages/pipenv'

Python location: '/home/stewart/.local/pipx/venvs/pipenv/bin/python'

OS Name: 'posix'

User pip version: '23.2.1'

user Python installations found:

PEP 508 Information:

{'implementation_name': 'cpython',
 'implementation_version': '3.8.10',
 'os_name': 'posix',
 'platform_machine': 'x86_64',
 'platform_python_implementation': 'CPython',
 'platform_release': '5.15.0-69-generic',
 'platform_system': 'Linux',
 'platform_version': '#76~20.04.1-Ubuntu SMP Mon Mar 20 15:54:19 UTC 2023',
 'python_full_version': '3.8.10',
 'python_version': '3.8',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • PIPENV_VENV_IN_PROJECT
  • TERMCAP
  • SSH_AUTH_SOCK
  • WINDOW
  • SSH_AGENT_PID
  • PWD
  • LOGNAME
  • XDG_SESSION_TYPE
  • MOTD_SHOWN
  • HOME
  • LANG
  • LS_COLORS
  • SSH_CONNECTION
  • LESSCLOSE
  • XDG_SESSION_CLASS
  • TERM
  • LESSOPEN
  • USER
  • XLA_FLAGS
  • SHLVL
  • XDG_SESSION_ID
  • KUBECONFIG
  • LD_LIBRARY_PATH
  • XDG_RUNTIME_DIR
  • SSH_CLIENT
  • XDG_DATA_DIRS
  • PATH
  • STY
  • DBUS_SESSION_BUS_ADDRESS
  • SSH_TTY
  • USE_GKE_GCLOUD_AUTH_PLUGIN
  • _
  • OLDPWD
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIPENV_SKIP_LOCK
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

  • PIPENV_VENV_IN_PROJECT: true
  • PIPENV_SKIP_LOCK: true

Debug–specific environment variables:

  • PATH: /usr/local/cuda/bin:/usr/local/nvidia/bin:/home/stewart/bin/gradle/bin:/home/stewart/bin/cmake/bin:/usr/local/cuda/bin:~/.local/bin:/home/stewart/.local/bin:/home/stewart/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/stewart/bin/node/bin
  • SHELL: /bin/bash
  • LANG: en_US.UTF-8
  • PWD: /home/stewart/src/pipenv_editable_install_repro

Contents of Pipfile ('/home/stewart/src/pipenv_editable_install_repro/Pipfile'):

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

[packages]

[dev-packages]

[requires]
python_version = "3.8"
python_full_version = "3.8.10"
@matteius
Copy link
Member

matteius commented Sep 6, 2023

@stewartmiles This I believe fixes it with a caveat: #5919

Is there ever a case where users truly want a non-editable file install? And if so, how can I tell pip hey this is a file at path "test-hello" and not have it treat it as a named requirement "test-hello" -- it gets real messy if I have to determine if its a relative path or not and if its one deep to prepend a ./ so I prefer thinking all file installs can be editable.

@matteius matteius added the Type: Bug 🐛 This issue is a bug. label Sep 6, 2023
@matteius
Copy link
Member

matteius commented Sep 6, 2023

Actually there were some edge cases of my initial attempt, so I just got GPT-4 involved again and pushed up another change that I think handles both editable/non and more edge cases.

@stewartmiles
Copy link
Author

@stewartmiles This I believe fixes it with a caveat: #5919

Is there ever a case where users truly want a non-editable file install? And if so, how can I tell pip hey this is a file at path "test-hello" and not have it treat it as a named requirement "test-hello" -- it gets real messy if I have to determine if its a relative path or not and if its one deep to prepend a ./ so I prefer thinking all file installs can be editable.

I've always done this by prepending the current directory (i.e ./) or a relative path, which I agree is messy but walks the well trodden path.

@stewartmiles
Copy link
Author

@matteius thanks this now works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug 🐛 This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants