Skip to content

Inexplicable pip install caching behavior #910

@maxupp

Description

@maxupp

I have been bashing my head against this for hours. I build my Docker image based on python:3.12, and then install my package like this:

FROM python:3.12

RUN mkdir /build
COPY pyproject.toml /build/pyproject.toml
COPY src /build/src

# set up access token usage
ARG ACCESS_TOKEN=*******************************
RUN git config --global url."https://${ACCESS_TOKEN}@github".insteadOf ssh://git@github

WORKDIR build
RUN pip install --force-reinstall --no-cache-dir .

One of my dependencies in the pyproject.toml is directly from a git repository, with a specified version tag.

dependencies = [ "boto3", "itsdangerous", "jsonref", "pydantic", "python-dotenv", "PyYAML", "typing", "websockets", "*** @ git+ssh://git@github.com/********@v2.2.0" ]

But whatever I do, I can't get pip to install the correct version of the package. I have cleared any cache I can think of, but for some reason I always end up with an old version.

PROBABLE FACTOR: The old version and the tagged version share the same version number within the pyproject.toml, due to an oversight I cannot fix right now. I will bump the version in the near future and I suspect that will make this whole issue go away.

But I really need to know what is happening here, since I'm questioning my sanity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions