Questions tagged [pip-tools]

Pip-tools is a set of command tools designed to keep your pinned Python dependencies up-to-date.

pip-tools is a set of command line tools to help you keep your pip-based packages fresh, even when you've pinned them. In building your Python application and its dependencies for production, you want to make sure that your builds are predictable and deterministic.

Resources

38 questions
74
votes
1 answer

What does pip-compile do? What is its use? (how do I maintain the contents of my requirements.txt file?)

I am a beginner in programming and Python. I read pip-compiles definition in pip-tools documentation but I could not understand. Can someone explain me this? More specifically, what does compiling requirements.in to produce requirements.txt mean?
nilinswap
  • 1,226
  • 1
  • 10
  • 17
32
votes
3 answers

pip-compile raising AssertionError on its logging handler

I have a dockerfile that currently only installs pip-tools FROM python:3.9 RUN pip install --upgrade pip && \ pip install pip-tools COPY ./ /root/project WORKDIR /root/project ENTRYPOINT ["tail", "-f", "/dev/null"] I build and open a shell…
Bruno Murino
  • 459
  • 5
  • 8
7
votes
1 answer

What is the proper way to decide whether to allow unsafe package versions in pip-tools?

I am trying to use pip-tools to manage a venv (as in python -m venv .venv) environment. The freshly-activated environment has nothing but pip-tools initially: > pip list Package Version --------- ------- Click 7.0 pip 19.3.1 pip-tools…
Alexandros
  • 2,097
  • 20
  • 27
6
votes
2 answers

When run `pip-compile requirements.in` in macOS12 monterey using venv python-3.9.9, pg_config not found

OS: monterey macOSv12.0.1 python venv: 3.9.9 requirements.in # To update requirements.txt, run: # # pip-compile requirements.in # # To install in localhost, run: # # pip-sync requirements.txt # django==3.2.10 #…
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
5
votes
1 answer

How do I pin versioned dependencies in Python when using both conda and pip?

I'm trying to follow the best practice of installing fully pinned dependencies (for repeatable builds and better Docker caching, see this pythonspeed.com article). My project needs to use both conda and pip (conda for complex ML packages, pip for…
jli
  • 333
  • 3
  • 8
4
votes
1 answer

ERROR Backend subprocess exited when trying to invoke get_requires_for_build_sdist

I was creating a Python library, I needed to compile the pyproject.toml file. I runned this command: pip-compile pyproject.toml --resolver=backtracking I got: Backend subprocess exited when trying to invoke get_requires_for_build_wheel Failed to…
Gorzan
  • 69
  • 9
4
votes
1 answer

How to use pip-tools to install from a github repo?

Here is a line in a req.in file (for pip-compile) to get a package from a github repository: -e git://github.com/dfrankow/django-editorjs-fields.git#egg=django-editorjs-fields Running pip-compile req.in gives a req.txt with -e…
dfrankow
  • 20,191
  • 41
  • 152
  • 214
3
votes
1 answer

Clean setup of pip-tools doesn't compile very basic pyproject.toml

Using a completely new pip-tools setup always results in a Backend subprocess exited error. pyproject.toml: [project] dependencies = [ 'openpyxl >= 3.0.9, < 4', ] Running pip-tools in an empty directory that only contains the above…
Windowlicker
  • 498
  • 11
  • 18
3
votes
1 answer

Automate the update of packages in pyproject.toml from virtualenv or pip-tools

I am trying to update my Python CI environment and am working on package management right now. I have several reasons that I do not want to use Poetry; however, one nice feature of poetry is the fact that it automatically updates the pyproject.toml…
Jon
  • 1,621
  • 5
  • 23
  • 46
3
votes
3 answers

Change Python version for pip-compile

When I run pip-compile, part of the generated file is this: # This file is autogenerated by pip-compile with python 3.8 I suppose this is happening because I cloned a project that contained a setup.py at one point that specified Python 3.8.…
Tobias Feil
  • 2,399
  • 3
  • 25
  • 41
3
votes
1 answer

How to create `dev_requirements.txt` from `extras_require` section of `setup.cfg` file using `pip-compile` from `pip-tools`?

I use pip-tools to manage my dependencies and environments which perfectly generates a requirements.txt file for my package that consists of a setup.py that looks like this: #! /usr/bin/env python import os from setuptools import setup if…
Cord Kaldemeyer
  • 6,405
  • 8
  • 51
  • 81
3
votes
1 answer

Error with pip : pip-compile does not support URLs as packages

I'm using pip with pip-compile (installed this way: pip install pip-tools) I got the following error when I run the pip-compile -v command: pip-compile does not support URLs as packages, unless they are editable. Perhaps add -e option? (constraint…
JimyRyan
  • 359
  • 1
  • 2
  • 17
2
votes
1 answer

Generate aligned requirements.txt and dev-requirements.txt with pip-compile

I have a Python project that depends on two packages moduleA and moduleB. I have the following pyproject.toml: [project] name = "meta-motor" version = "3.1.0.dev" dependencies = [ "moduleA==1.0.0" ] [project.optional-dependencies] dev = [ …
Kins
  • 547
  • 1
  • 5
  • 22
2
votes
1 answer

Disable adding github token in requirements.txt from pip-compile

I have a file requirements.in with below context: . . . git+https://${GITHUB_TOKEN}@github.com/company/some-lib-name.git@v1.4.0 pyzipcode3==2.2 pytz==2019.3 timezonefinder==4.1.0 sqlalchemy==1.2.18 Private lib is downloaded from company's github…
Misa
  • 51
  • 1
  • 6
2
votes
1 answer

Is it possible to pip-compile a requirements.txt with the oldest dependencies?

I use pip-compile from pip-tools to create a requirements.txt which has all dependencies (including all transitive ones) which fulfill all requirements and are consistent. This is nice for applications which I run via CI/CD. For libraries, I think…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
1
2 3