Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inexplicable pip install caching behavior #910

Open
maxupp opened this issue Mar 19, 2024 · 1 comment
Open

Inexplicable pip install caching behavior #910

maxupp opened this issue Mar 19, 2024 · 1 comment

Comments

@maxupp
Copy link

maxupp commented Mar 19, 2024

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.

@tianon
Copy link
Member

tianon commented Mar 20, 2024

I'm afraid I'm at a total loss -- you'll possibly have better luck in a dedicated support forum, especially one with deeper PIP experience. 😅

The best I can offer is perhaps trying docker build --no-cache which should disable any Docker cache (and your Dockerfile shouldn't have any other cache available unless it's inside src itself)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants