-
-
Couldn't load subscription status.
- Fork 1.9k
Description
Issue description
Create a local Python package called mypackage with a mypackage/mypackage/tests/test_setup.py file (see mypackage.zip):
import unittest
class TestNothing(unittest.TestCase):
def setup(**kwargs):
pass
def test_nada(self):
_ = setup(name='foo')- Create a pipenv virtual environment using say
( export PIPENV_NO_INHERIT=1; pipenv run echo ) - Install the package as editable using
pipenv install -e ./mypackage - See the package installed in the Pipfile uses the name in inferred from test file not the top level
setup.py, i.e:grep mypackage Pipfileshowsfoo = {file = "mypackage"}notmypackage = {file = "mypackage"}as expected.
Expected result
The package should be named correctly in Pipfile.
Actual result
The package name is incorrectly parsed from a test file.
Steps to replicate
See above.
Please run $ pipenv --support, and paste the results here. Don't put backticks (`) around it! The output already contains Markdown formatting.
$ pipenv --support
Pipenv version: '2025.0.2'
Pipenv location: '/home/stewart/.local/share/pipx/venvs/pipenv/lib/python3.10/site-packages/pipenv'
Python location: '/home/stewart/.local/share/pipx/venvs/pipenv/bin/python'
OS Name: 'posix'
User pip version: '25.0.1'
user Python installations found:
3.10.12:/usr/bin/python33.10.12:/usr/bin/python3.10.12:/bin/python33.10.12:/bin/python3.8.20:/usr/bin/python3.83.8.20:/bin/python3.8
PEP 508 Information:
{'implementation_name': 'cpython',
'implementation_version': '3.10.12',
'os_name': 'posix',
'platform_machine': 'x86_64',
'platform_python_implementation': 'CPython',
'platform_release': '6.8.0-59-generic',
'platform_system': 'Linux',
'platform_version': '#61~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Apr 15 '
'17:03:15 UTC 2',
'python_full_version': '3.10.12',
'python_version': '3.10',
'sys_platform': 'linux'}
System environment variables:
SHELLPIPENV_VENV_IN_PROJECTTERMCAPSSH_AUTH_SOCKWINDOWSSH_AGENT_PIDPWDLOGNAMEXDG_SESSION_TYPEMOTD_SHOWNHOMELANGLS_COLORSSSH_CONNECTIONLESSCLOSEXDG_SESSION_CLASSTERMLESSOPENUSERXLA_FLAGSSHLVLXDG_SESSION_IDLD_LIBRARY_PATHXDG_RUNTIME_DIRSSH_CLIENTXDG_DATA_DIRSPATHSTYDBUS_SESSION_BUS_ADDRESSSSH_TTYOLDPWD_PIP_DISABLE_PIP_VERSION_CHECKPYTHONDONTWRITEBYTECODEPIP_FIND_LINKSPIP_NO_BUILD_ISOLATIONPIPENV_SKIP_LOCK
Pipenv–specific environment variables:
PIPENV_VENV_IN_PROJECT:truePIPENV_SKIP_LOCK:true
Debug–specific environment variables:
PATH:/home/stewart/bin/node/bin:/usr/local/cuda/bin:/usr/local/nvidia/bin:/home/stewart/bin/cmake/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:/opt/halyard/binSHELL:/bin/bashLANG:en_US.UTF-8PWD:/home/stewart/src/agentic/service/tmp
Contents of Pipfile ('/home/stewart/src/agentic/service/tmp/Pipfile'):
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
foo = {file = "mypackage", editable = true}
[dev-packages]
[requires]
python_version = "3.10"