Git Product home page Git Product logo

pipenv's People

Contributors

altendky avatar arruda avatar atzannes avatar davidstaheli avatar devxpy avatar dreamersoul avatar erinxocon avatar frostming avatar glenrsmith avatar greysteil avatar hroncok avatar jacobhayes avatar jayvdb avatar jtratner avatar jxltom avatar kennethreitz avatar markkoz avatar maxkrivich avatar nateprewitt avatar ncoghlan avatar nonylene avatar peterschutt avatar tapaswenipathak avatar techalchemy avatar timofurrer avatar tsiq-oliver avatar uranusjr avatar vphilippon avatar woile avatar zbentley avatar

pipenv's Issues

`pipenv install -c` fails due to expected package name difference

Issue Description

This code is buggy since it assumes the package name matches exactly the import name:

pipenv/pipenv/utils.py

Lines 1583 to 1585 in b503e8b

r = _get_requests_session().get(
f"https://pypi.org/pypi/{package_name}/json", timeout=0.3, stream=True
)

In the case of 'nmap3', its package name is 'python3-nmap':
https://pypi.org/project/python3-nmap/

core.py silently fails on this and seems to not install any packages it finds once it runs into 'import nmap3':
https://github.com/fevrin/pipenv/blob/b503e8b3aa32b9c80596e70682272e9ec22a8473/pipenv/core.py#L216-L21985

Expected result

$ pipenv install -c ../../
Discovering imports from local codebase...
  Found mysql-connector-repackaged!
  Found nmap!
  Found pylama!
  Found pylint!
  Found pytest!
  Found requests!
  Found slack-sdk!
  Found tabulate!
Pipfile.lock (db4242) out of date, updating to (704a1c)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Building requirements...
Resolving dependencies...
βœ” Success! 
Updated Pipfile.lock (704a1c)!
Installing dependencies from Pipfile.lock (704a1c)...
  🐍   β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰ 29/29 β€” 00:00:06
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

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

[packages]
mysql-connector-repackaged = "*"
nmap = "*"
pylama = "*"
pylint = "*"
pytest = "*"
requests = "*"
slack-sdk = "*"
tabulate = "*"

[dev-packages]

[requires]
python_version = "3.8"

Actual result

I've printed the exception here in core.py and utils.py, as adding --verbose does nothing in this case:

$ pipenv install -c ../../
Discovering imports from local codebase...
import_from_code: pkg_names = '['mysql_connector_repackaged', 'nmap3', 'pylama', 'pylint', 'pytest', 'Requests', 'slack_sdk', 'tabulate']'
poper_case: package_name = 'mysql_connector_repackaged'
proper_case: good_name = 'mysql-connector-repackaged'
poper_case: package_name = 'nmap3'
import_from_code: exception 'Unable to find package nmap3 in PyPI repository.'
do_install: code = '[]'
import_from_code: pkg_names = '['mysql_connector_repackaged', 'nmap3', 'pylama', 'pylint', 'pytest', 'Requests', 'slack_sdk', 'tabulate']'
poper_case: package_name = 'mysql_connector_repackaged'
proper_case: good_name = 'mysql-connector-repackaged'
poper_case: package_name = 'nmap3'
import_from_code: exception 'Unable to find package nmap3 in PyPI repository.'
Pipfile.lock (704a1c) out of date, updating to (db4242)...
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
Updated Pipfile.lock (db4242)!
Installing dependencies from Pipfile.lock (db4242)...
  🐍   β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰β–‰ 0/0 β€” 00:00:00
To activate this project's virtualenv, run pipenv shell.
Alternatively, run a command inside the virtualenv with pipenv run.

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

[packages]

[dev-packages]

[requires]
python_version = "3.8"

This is the environment I'm using:

$ pipenv --version
pipenv, version 2021.5.29

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal

I didn't see an existing issue about this in the official repo, but the barrier to entry in this fork is much lower πŸ˜‰

Steps to replicate

Provide the steps to replicate (which usually at least includes the commands and the Pipfile).


$ pipenv --support

Pipenv version: '2021.5.29'

Pipenv location: '/home/user/.local/lib/python3.8/site-packages/pipenv'

Python location: '/usr/bin/python3'

Python installations found:

  • 3.8.10: /usr/bin/python3
  • 3.8.10: /usr/bin/python3.8
  • 3.8.10: /bin/python3
  • 3.8.10: /bin/python3.8
  • 2.7.18: /usr/bin/python2
  • 2.7.18: /usr/bin/python2.7
  • 2.7.18: /bin/python2
  • 2.7.18: /bin/python2.7

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.11.0-38-generic',
 'platform_system': 'Linux',
 'platform_version': '#42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021',
 'python_full_version': '3.8.10',
 'python_version': '3.8',
 'sys_platform': 'linux'}

System environment variables:

  • SHELL
  • SESSION_MANAGER
  • QT_ACCESSIBILITY
  • COLORTERM
  • SCREEN_CONF
  • XDG_CONFIG_DIRS
  • LESS
  • HISTCONTROL
  • XDG_MENU_PREFIX
  • GNOME_DESKTOP_SESSION_ID
  • TMUX
  • HISTSIZE
  • LANGUAGE
  • LC_ADDRESS
  • GNOME_SHELL_SESSION_MODE
  • LC_NAME
  • SSH_AUTH_SOCK
  • GIT_PS1_SHOWDIRTYSTATE
  • HISTTIMEFORMAT
  • GOPRIVATE
  • XMODIFIERS
  • DESKTOP_SESSION
  • LC_MONETARY
  • SSH_AGENT_PID
  • EDITOR
  • GOBIN
  • GTK_MODULES
  • PWD
  • XDG_SESSION_DESKTOP
  • LOGNAME
  • XDG_SESSION_TYPE
  • GPG_AGENT_INFO
  • XAUTHORITY
  • GIT_PS1_SHOWCOLORHINTS
  • WINDOWPATH
  • VAULT_CACERT
  • HOME
  • USERNAME
  • IM_CONFIG_PHASE
  • LC_PAPER
  • LANG
  • LS_COLORS
  • XDG_CURRENT_DESKTOP
  • VTE_VERSION
  • PROMPT_COMMAND
  • GNOME_TERMINAL_SCREEN
  • INVOCATION_ID
  • MANAGERPID
  • LESSCLOSE
  • XDG_SESSION_CLASS
  • TERM
  • LC_IDENTIFICATION
  • WORK
  • LESSOPEN
  • USER
  • VAULT_ADDR
  • TMUX_PANE
  • LPASS_AGENT_TIMEOUT
  • GNOME_TERMINAL_SERVICE
  • MANPAGER
  • DISPLAY
  • SHLVL
  • LC_TELEPHONE
  • QT_IM_MODULE
  • LC_MEASUREMENT
  • PAPERSIZE
  • XDG_RUNTIME_DIR
  • GO111MODULE
  • LC_TIME
  • LFS
  • JOURNAL_STREAM
  • XDG_DATA_DIRS
  • PATH
  • HISTIGNORE
  • GDMSESSION
  • HISTFILESIZE
  • DBUS_SESSION_BUS_ADDRESS
  • GIT_PS1_SHOWUNTRACKEDFILES
  • LC_NUMERIC
  • OLDPWD
  • _
  • PIP_DISABLE_PIP_VERSION_CHECK
  • PYTHONDONTWRITEBYTECODE
  • PIP_SHIMS_BASE_MODULE
  • PIP_PYTHON_PATH
  • PYTHONFINDER_IGNORE_UNSUPPORTED

Pipenv–specific environment variables:

Debug–specific environment variables:

  • PATH: /home/user/.local/bin:/home/user/bin:/home/user/.local/bin:/home/user/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/user/.gem/ruby/2.7.0/bin:/home/user/go/bin
  • SHELL: /bin/bash
  • EDITOR: vim
  • LANG: en_US.UTF-8
  • PWD: /home/user/stage2-utils/fleet-management

Contents of Pipfile ('/home/user/fleet-management/Pipfile'):

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

[packages]
mysql-connector-repackaged = "*"
nmap = "*"
pylama = "*"
pylint = "*"
pytest = "*"
requests = "*"
slack-sdk = "*"
tabulate = "*"

[dev-packages]

[requires]
python_version = "3.8"

Contents of Pipfile.lock ('/home/user/fleet-management/Pipfile.lock'):

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.