Skip to content

compile_pip_requirements: a way to disable hashes (for e.g. constraints files) #894

@vonschultz

Description

@vonschultz

🚀 feature request

Relevant Rules

compile_pip_requirements

Description

As it is, compile_pip_requirements, through python/pip_install/pip_compile.py, always adds the --generate-hashes flag.

    sys.argv.append("--generate-hashes")

I would like an option to disable that.

Specifically, I'm using compile_pip_requirements both to generate requirement.txt files, where I do want the hashes, and also to generate constraints.txt files, where the hashes don't really make sense. It's the requirements.txt files that control what gets installed, so the hashes make a lot of sense there, but in the constraints file (used with -c constraints.txt in a requirements.in file) hashes make less sense. I'm not sure they are even obeyed by pip (see pypa/pip#8792), so in the constraints file it's confusing noise at best.

Describe the solution you'd like

A parameter to compile_pip_requirements that says if we want hashes in the output file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Can Close?Will close in 30 days if there is no new activity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions