Skip to content

Warn users that pip download can run arbitrary code #12465

@decorator-factory

Description

@decorator-factory

What's the problem this feature will solve?

I've been using pip for many years now, but I didn't realize that pip download runs setup.py containing arbitrary code (until someone explicitly told me).

I think the name download implies that you're just moving bits from one computer to another (like downloading a file using the browser). If you know how Python packaging works in detail, it's clear that this has to run setup.py, but it's not obvious to everyone.

Describe the solution you'd like

  1. Add a note to pip download --help, https://pip.pypa.io/en/stable/cli/pip_download/ and other "official" documentation for pip download. This will raise awareness of this command being potentially dangerous.

  2. On the online documentation page, provide a recipe for just downloading the source. I was only able to find an old thread that is now outdated and doesn't provide a solution. Maybe downloading the wheel from the PyPI website might be good direction?

Additional context

Example on StackOverflow (2018): https://stackoverflow.com/questions/52486985/pip-download-without-executing-setup-py

https://discuss.python.org/t/pip-download-just-the-source-packages-no-building-no-metadata-etc/465

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: downloadAbout fetching data from PyPI and other sourcestype: docsDocumentation relatedtype: feature requestRequest for a new featuretype: securityHas potential security implications

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions