pypa / pip

The Python package installer
https://pip.pypa.io/
MIT License
9.46k stars 3k forks source link

pip inspect shows wrong installer #12930

Closed julian-belina closed 2 days ago

julian-belina commented 3 weeks ago

Description

Hello,

the output of pip inspect shows the wrong installer. I have tried to come up with this minimal example, that only installs a single library called "lunardate" using conda. However, the output of inspect shows that it was installed with pip.

Expected behavior

Show that the package was installed with conda and not with pip

pip version

24.2

Python version

3.12.5

OS

Windows

How to Reproduce

conda create -n test_env python pip lunardate conda activate test_env pip inspect

Output

{ "version": "1", "pip_version": "24.2", "installed": [ { "metadata": { "metadata_version": "2.1", "name": "lunardate", "version": "0.2.0", "platform": [ "UNKNOWN" ], "summary": "A Chinese Calendar Library in Pure Python", "description": "A Chinese Calendar Library in Pure Python\n=========================================\n\nChinese Calendar: http://en.wikipedia.org/wiki/Chinese_calendar\n\nUsage\n-----\n >>> LunarDate.fromSolarDate(1976, 10, 1)\n LunarDate(1976, 8, 8, 1)\n >>> LunarDate(1976, 8, 8, 1).toSolarDate()\n datetime.date(1976, 10, 1)\n >>> LunarDate(1976, 8, 8, 1).year\n 1976\n >>> LunarDate(1976, 8, 8, 1).month\n 8\n >>> LunarDate(1976, 8, 8, 1).day\n 8\n >>> LunarDate(1976, 8, 8, 1).isLeapMonth\n True\n\n >>> today = LunarDate.today()\n >>> type(today).name\n 'LunarDate'\n\n >>> # support '+' and '-' between datetime.date and datetime.timedelta\n >>> ld = LunarDate(1976,8,8)\n >>> sd = datetime.date(2008,1,1)\n >>> td = datetime.timedelta(days=10)\n >>> ld-ld\n datetime.timedelta(0)\n >>> (ld-sd).days\n -11444\n >>> ld-td\n LunarDate(1976, 7, 27, 0)\n >>> (sd-ld).days\n 11444\n >>> ld+td\n LunarDate(1976, 8, 18, 0)\n >>> td+ld\n LunarDate(1976, 8, 18, 0)\n >>> ld2 = LunarDate.today()\n >>> ld < ld2\n True\n >>> ld <= ld2\n True\n >>> ld > ld2\n False\n >>> ld >= ld2\n False\n >>> ld == ld2\n False\n >>> ld != ld2\n True\n >>> ld == ld\n True\n >>> LunarDate.today() == LunarDate.today()\n True\n >>> before_leap_month = LunarDate.fromSolarDate(2088, 5, 17)\n >>> before_leap_month.year\n 2088\n >>> before_leap_month.month\n 4\n >>> before_leap_month.day\n 27\n >>> before_leap_month.isLeapMonth\n False\n >>> leap_month = LunarDate.fromSolarDate(2088, 6, 17)\n >>> leap_month.year\n 2088\n >>> leap_month.month\n 4\n >>> leap_month.day\n 28\n >>> leap_month.isLeapMonth\n True\n >>> after_leap_month = LunarDate.fromSolarDate(2088, 7, 17)\n >>> after_leap_month.year\n 2088\n >>> after_leap_month.month\n 5\n >>> after_leap_month.day\n 29\n >>> after_leap_month.isLeapMonth\n False\n\nLimits\n------\n\nthis library can only deal with year from 1900 to 2099 (in chinese calendar).\n\nSee also\n--------\n\n lunar: http://packages.qa.debian.org/l/lunar.html,\n A converter written in C, this program is derived from it.\n python-lunar: http://code.google.com/p/liblunar/\n Another library written in C, including a python binding.\n\n\n", "home_page": "https://github.com/lidaobing/python-lunardate", "author": "LI Daobing", "author_email": "lidaobing@gmail.com", "license": "GPLv3", "classifier": [ "Development Status :: 4 - Beta", "Programming Language :: Python", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Topic :: Software Development :: Libraries :: Python Modules" ] }, "metadata_location": "C:\Users\Julian\miniforge3\envs\test_env\Lib\site-packages\lunardate-0.2.0.dist-info", "installer": "pip", "requested": false }, { "metadata": { "metadataversion": "2.1", "name": "pip", "version": "24.2", "summary": "The PyPA recommended tool for installing Python packages.", "description": "pip - The Python Package Installer\n==================================\n\n.. |pypi-version| image:: https://img.shields.io/pypi/v/pip.svg\n :target: https://pypi.org/project/pip/\n :alt: PyPI\n\n.. |python-versions| image:: https://img.shields.io/pypi/pyversions/pip\n :target: https://pypi.org/project/pip\n :alt: PyPI - Python Version\n\n.. |docs-badge| image:: https://readthedocs.org/projects/pip/badge/?version=latest\n :target: https://pip.pypa.io/en/latest\n :alt: Documentation\n\n|pypi-version| |python-versions| |docs-badge|\n\npip is the package installer for Python. You can use pip to install packages from the Python Package Index and other indexes.\n\nPlease take a look at our documentation for how to install and use pip:\n\n* Installation\n Usage_\n\nWe release updates regularly, with a new version every 3 months. Find more details in our documentation:\n\n Release notes\n* Release process\n\nIf you find bugs, need help, or want to talk to the developers, please use our mailing lists or chat rooms:\n\n Issue tracking_\n Discourse channel\n* User IRC\n\nIf you want to get involved head over to GitHub to get the source code, look at our development documentation and feel free to jump on the developer mailing lists and chat rooms:\n\n GitHub page_\n Development documentation\n* Development IRC\n\nCode of Conduct\n---------------\n\nEveryone interacting in the pip project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the PSF Code of Conduct_.\n\n.. _package installer: https://packaging.python.org/guides/tool-recommendations/\n.. _Python Package Index: https://pypi.org\n.. _Installation: https://pip.pypa.io/en/stable/installation/\n.. _Usage: https://pip.pypa.io/en/stable/\n.. _Release notes: https://pip.pypa.io/en/stable/news.html\n.. _Release process: https://pip.pypa.io/en/latest/development/release-process/\n.. _GitHub page: https://github.com/pypa/pip\n.. _Development documentation: https://pip.pypa.io/en/latest/development\n.. _Issue tracking: https://github.com/pypa/pip/issues\n.. _Discourse channel: https://discuss.python.org/c/packaging\n.. _User IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa\n.. _Development IRC: https://kiwiirc.com/nextclient/#ircs://irc.libera.chat:+6697/pypa-dev\n.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md\n", "description_content_type": "text/x-rst", "author_email": "The pip developers distutils-sig@python.org", "license": "MIT", "classifier": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Build Tools", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "requires_python": ">=3.8", "project_url": [ "Homepage, https://pip.pypa.io/", "Documentation, https://pip.pypa.io", "Source, https://github.com/pypa/pip", "Changelog, https://pip.pypa.io/en/stable/news/" ] }, "metadata_location": "C:\Users\Julian\miniforge3\envs\test_env\Lib\site-packages\pip-24.2.dist-info", "direct_url": { "url": "file:///home/conda/feedstock_root/build_artifacts/pip_1722450924710/work", "dir_info": {} }, "installer": "conda", "requested": true }, { "metadata": { "metadata_version": "2.1", "name": "setuptools", "version": "72.2.0", "summary": "Easily download, build, install, upgrade, and uninstall Python packages", "description": ".. |pypi-version| image:: https://img.shields.io/pypi/v/setuptools.svg\n :target: https://pypi.org/project/setuptools\n\n.. |py-version| image:: https://img.shields.io/pypi/pyversions/setuptools.svg\n\n.. |test-badge| image:: https://github.com/pypa/setuptools/actions/workflows/main.yml/badge.svg\n :target: https://github.com/pypa/setuptools/actions?query=workflow%3A%22tests%22\n :alt: tests\n\n.. |ruff-badge| image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json\n :target: https://github.com/astral-sh/ruff\n :alt: Ruff\n\n.. |docs-badge| image:: https://img.shields.io/readthedocs/setuptools/latest.svg\n :target: https://setuptools.pypa.io\n\n.. |skeleton-badge| image:: https://img.shields.io/badge/skeleton-2024-informational\n :target: https://blog.jaraco.com/skeleton\n\n.. |codecov-badge| image:: https://img.shields.io/codecov/c/github/pypa/setuptools/master.svg?logo=codecov&logoColor=white\n :target: https://codecov.io/gh/pypa/setuptools\n\n.. |tidelift-badge| image:: https://tidelift.com/badges/github/pypa/setuptools?style=flat\n :target: https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=readme\n\n.. |discord-badge| image:: https://img.shields.io/discord/803025117553754132\n :target: https://discord.com/channels/803025117553754132/815945031150993468\n :alt: Discord\n\n|pypi-version| |py-version| |test-badge| |ruff-badge| |docs-badge| |skeleton-badge| |codecov-badge| |discord-badge|\n\nSee the Quickstart <https://setuptools.pypa.io/en/latest/userguide/quickstart.html>\nand the User's Guide <https://setuptools.pypa.io/en/latest/userguide/> for\ninstructions on how to use Setuptools.\n\nQuestions and comments should be directed to GitHub Discussions\n<https://github.com/pypa/setuptools/discussions>.\nBug reports and especially tested patches may be\nsubmitted directly to the bug tracker\n<https://github.com/pypa/setuptools/issues>.\n\n\nCode of Conduct\n===============\n\nEveryone interacting in the setuptools project's codebases, issue trackers,\nchat rooms, and fora is expected to follow the\nPSF Code of Conduct <https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md>_.\n\n\nFor Enterprise\n==============\n\nAvailable as part of the Tidelift Subscription.\n\nSetuptools and the maintainers of thousands of other packages are working with Tidelift to deliver one enterprise subscription that covers all of the open source you use.\n\nLearn more <https://tidelift.com/subscription/pkg/pypi-setuptools?utm_source=pypi-setuptools&utm_medium=referral&utm_campaign=github>_.\n", "description_content_type": "text/x-rst", "keywords": [ "CPAN", "PyPI", "distutils", "eggs", "package", "management" ], "author_email": "Python Packaging Authority distutils-sig@python.org", "classifier": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Archiving :: Packaging", "Topic :: System :: Systems Administration", "Topic :: Utilities" ], "requires_dist": [ "pytest!=8.1.,>=6; extra == \"test\"", "pytest-checkdocs>=2.4; extra == \"test\"", "pytest-cov; extra == \"test\"", "pytest-mypy; extra == \"test\"", "pytest-enabler>=2.2; extra == \"test\"", "pytest-ruff>=0.2.1; sys_platform != \"cygwin\" and extra == \"test\"", "virtualenv>=13.0.0; extra == \"test\"", "wheel; extra == \"test\"", "pip>=19.1; extra == \"test\"", "packaging>=23.2; extra == \"test\"", "jaraco.envs>=2.2; extra == \"test\"", "pytest-xdist>=3; extra == \"test\"", "jaraco.path>=3.2.0; extra == \"test\"", "build[virtualenv]>=1.0.3; extra == \"test\"", "filelock>=3.4.0; extra == \"test\"", "ini2toml[lite]>=0.14; extra == \"test\"", "tomli-w>=1.0.0; extra == \"test\"", "pytest-timeout; extra == \"test\"", "pytest-perf; sys_platform != \"cygwin\" and extra == \"test\"", "jaraco.develop>=7.21; (python_version >= \"3.9\" and sys_platform != \"cygwin\") and extra == \"test\"", "pytest-home>=0.5; extra == \"test\"", "mypy==1.11.; extra == \"test\"", "tomli; extra == \"test\"", "importlib_metadata; extra == \"test\"", "pytest-subprocess; extra == \"test\"", "pytest-ruff>=0.3.2; sys_platform != \"cygwin\" and extra == \"test\"", "pyproject-hooks!=1.1; extra == \"test\"", "jaraco.test; extra == \"test\"", "pytest-ruff<0.4; platform_system == \"Windows\" and extra == \"test\"", "sphinx>=3.5; extra == \"doc\"", "jaraco.packaging>=9.3; extra == \"doc\"", "rst.linker>=1.9; extra == \"doc\"", "furo; extra == \"doc\"", "sphinx-lint; extra == \"doc\"", "jaraco.tidelift>=1.4; extra == \"doc\"", "pygments-github-lexers==0.0.5; extra == \"doc\"", "sphinx-favicon; extra == \"doc\"", "sphinx-inline-tabs; extra == \"doc\"", "sphinx-reredirects; extra == \"doc\"", "sphinxcontrib-towncrier; extra == \"doc\"", "sphinx-notfound-page<2,>=1; extra == \"doc\"", "pyproject-hooks!=1.1; extra == \"doc\"", "towncrier<24.7; extra == \"doc\"", "packaging>=24; extra == \"core\"", "ordered-set>=3.1.1; extra == \"core\"", "more_itertools>=8.8; extra == \"core\"", "jaraco.text>=3.7; extra == \"core\"", "importlib_resources>=5.10.2; python_version < \"3.9\" and extra == \"core\"", "importlib_metadata>=6; python_version < \"3.10\" and extra == \"core\"", "tomli>=2.0.1; python_version < \"3.11\" and extra == \"core\"", "wheel>=0.43.0; extra == \"core\"", "platformdirs>=2.6.2; extra == \"core\"" ], "requires_python": ">=3.8", "project_url": [ "Source, https://github.com/pypa/setuptools", "Documentation, https://setuptools.pypa.io/", "Changelog, https://setuptools.pypa.io/en/stable/history.html" ], "provides_extra": [ "test", "doc", "ssl", "certs", "core" ] }, "metadata_location": "C:\Users\Julian\miniforge3\envs\test_env\Lib\site-packages\setuptools-72.2.0-py3.12.egg-info" }, { "metadata": { "metadataversion": "2.1", "name": "wheel", "version": "0.44.0", "summary": "A built-package format for Python", "description": "wheel\n=====\n\nThis is a command line tool for manipulating Python wheel files, as defined in\nPEP 427. It contains the following functionality:\n\n Convert .egg archives into .whl\n Unpack wheel archives\n Repack wheel archives\n Add or remove tags in existing wheel archives\n\n.. PEP 427: https://www.python.org/dev/peps/pep-0427/\n\nHistorical note\n---------------\n\nThis project used to contain the implementation of the setuptools bdist_wheel\ncommand, but as of setuptools v70.1, it no longer needs wheel installed for that to\nwork. Thus, you should install this only if you intend to use the wheel command\nline tool!\n\n.. setuptools: https://pypi.org/project/setuptools/\n\nDocumentation\n-------------\n\nThe documentation can be found on Read The Docs.\n\n.. documentation: https://wheel.readthedocs.io/\n\nCode of Conduct\n---------------\n\nEveryone interacting in the wheel project's codebases, issue trackers, chat\nrooms, and mailing lists is expected to follow the PSF Code of Conduct.\n\n.. _PSF Code of Conduct: https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md\n\n", "description_content_type": "text/x-rst", "keywords": [ "wheel", "packaging" ], "author_email": "Daniel Holth dholth@fastmail.fm", "maintainer_email": "Alex Grönholm alex.gronholm@nextday.fi", "classifier": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Topic :: System :: Archiving :: Packaging", "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12" ], "requires_dist": [ "pytest >= 6.0.0 ; extra == \"test\"", "setuptools >= 65 ; extra == \"test\"" ], "requires_python": ">=3.8", "project_url": [ "Changelog, https://wheel.readthedocs.io/en/stable/news.html", "Documentation, https://wheel.readthedocs.io/", "Issue Tracker, https://github.com/pypa/wheel/issues", "Source, https://github.com/pypa/wheel" ], "provides_extra": [ "test" ] }, "metadata_location": "C:\Users\Julian\miniforge3\envs\test_env\Lib\site-packages\wheel-0.44.0.dist-info", "requested": false } ], "environment": { "implementation_name": "cpython", "implementation_version": "3.12.5", "os_name": "nt", "platform_machine": "AMD64", "platform_release": "11", "platform_system": "Windows", "platform_version": "10.0.22631", "python_full_version": "3.12.5", "platform_python_implementation": "CPython", "python_version": "3.12", "sys_platform": "win32" } }

Code of Conduct

pfmoore commented 3 weeks ago

The installer information comes from the INSTALLER file created when the package was installed. It's the responsibility of the installer to put the correct information in there. It looks like conda is reporting that pip did the install, which would be a bug in conda, not in pip.