Hi all, I am having an issue where pants does not ...
# general
s
Hi all, I am having an issue where pants does not seem to pull the correct commit of a repository that I have added as a build dependency:
Copy code
python_requirement(
    name="everest",
    resolve="base",
    requirements=[
        "everest@git+ssh://git@github.com/reflectionai/everest.git#54f4c949a423384417dc3b9527b174bf18e92d2f"
    ],
    dependencies=[":httpx"],
)
I have confirmed that this is reflected in my
.pantslock/base.lock
file:
Copy code
❯ cat .pantslock/base.lock | rg everest
//     "everest@ <git+ssh://git@github.com/reflectionai/everest.git#54f4c949a423384417dc3b9527b174bf18e92d2f>",
              "url": "<git+ssh://git@github.com/reflectionai/everest.git>"
          "project_name": "everest",
    "everest",
However, after running
pants export --export-resolve=base
, the resulting
site-packages/
does not seem to have updated correctly:
Copy code
❯ ls -lah dist/export/python/virtualenvs/base/3.12.4
lrwxrwxrwx 1 ethan ethan 134 Aug 23 17:08 dist/export/python/virtualenvs/base/3.12.4 -> /home/ethan/.cache/pants/named_caches/pex_root/venvs/b2b893d4d16826e01addcd768a57eb4c54681208/0de1795ad4486f45ee94cecd983e9905b6b11dc9

❯ rg FileMount /home/ethan/.cache/pants/named_caches/pex_root/venvs/b2b893d4d16826e01addcd768a57eb4c54681208/0de1795ad4486f45ee94cecd983e9905b6b11dc9/lib/python3.12/site-packages/everest/schema.py 
# not found
In contrast:
Copy code
~/everest heads/add-file-mounts
everest-py3.11nix-shell-env ❯ git checkout 54f4c949a423384417dc3b9527b174bf18e92d2f

HEAD is now at 54f4c94 Add mounted files to job requests

~/everest heads/add-file-mounts
everest-py3.11nix-shell-env ❯ rg FileMount everest/schema.py 
35:class FileMount(pydantic.BaseModel, validate_assignment=True):
142:  files: list[FileMount] = []
I have tried deleting all the pants caches:
Copy code
rm -rf ~/.cache/pants/
rm -rf .pants.d
rm -rf dist
Thank you for your help.
I have a follow up on this. No matter what commit I choose, pants only pulls in the version of
everest
that is at the head of the
main
branch. I have pushed a commit to
everest
and after re-running
pants generate-lockfiles
and
pants export --export-resolve=base
, the code did update, matching that new commit.
p
Have you tried git+https? This isn't the same, but works for me afaict:
Copy code
python_requirement(
    name="aiohttp_server",
    requirements=["opentelemetry-instrumentation-aiohttp-server@ git+<https://github.com/open-telemetry/opentelemetry-python-contrib.git@v0.46b0#subdirectory=instrumentation/opentelemetry-instrumentation-aiohttp-server"|https://github.com/open-telemetry/opentelemetry-python-contrib.git@v0.46b0#subdirectory=instrumentation/opentelemetry-instrumentation-aiohttp-server">],
)
s
Hi @powerful-scooter-95162 thanks for the response. I will be following up on this soon, but need to wrap something up first.