Does anyone have any suggestions for fixing this i...
# general
f
Does anyone have any suggestions for fixing this issue when testing within Gitlab CI? Problem: • Tests work locally • Gitlab CI steps of installing pants and linting succeed • The unit testing CI step fails with this error:
Copy code
Failed to resolve compatible artifacts from lock data_sci.lock for 1 target:
1. /usr/local/bin/python3.10:
    Failed to resolve all requirements for cp310-cp310-manylinux_2_31_x86_64 interpreter at /usr/local/bin/python3.10 from data_sci.lock:
Configured with:
    build: True
    use_wheel: True
Dependency on openpyxl (via: openpyxl>=3.1.5) not satisfied, no candidates found.
The build files for
src/
and
tests/
directories both have dependencies set for openpyxl
Copy code
dependencies=[
        ...
        "//:data_sci#openpyxl",
    ],
What we have tried: • Downgrading openpyxl version • Looking through threads in this slack with similar errors - didn't find any clear solutions EDIT: The fix for this was generating lockfiles in the CI, instead of relying on lockfiles generated locally. We had time-out issues with generating lockfiles in CI before, so I'm not sure why it worked this time, but seems to be the solution for now.
w
Are CI and local running the same OS? and the same Python version?
f
• For the CI we use a Docker image based on
python:3.10-slim
• Locally I am using
Ubuntu 22.04.5 LTS
with
Python 3.10.12
• Note: This pipeline has succeeded before, but failed when I added commit to add in integration test and added openpyxl dependency to BUILD files • Another dev uses Mac locally and gets a similar CI error for a different package on another branch
w
So, there are a bunch of slack histories for "Failed to resolve compatible artifacts" - as the error is common enough. I've seen in the past stuff about using "complete_platforms" helping? But I'm not sure if you're building a pex here
f
Thanks - yes I checked through the slack history but the solves all seemed slightly different. Ok yes we had added in
complete_platforms
for projects with Docker builds to solve issue with Mac builds, but I was assuming that wouldn't help as you say because we are just testing However, I do see that Pants does seem to be building some pex files
Copy code
22:19:08.21 [INFO] Starting: Building 1 requirement for requirements.pex from the data_sci.lock resolve: pytest>=8.0.1
22:19:08.28 [INFO] Canceled: Building pytest.pex from <resource://pants.backend.python.subsystems/pytest.lock>
so I can try using
complete_platforms
in case that helps Pants do its job?
Edit - Actually not sure how I would incorporate
complete_platforms
for
python_test_utils
or
python_sources
targets - unless I added an unused
pex_binary
target 🤔
w
Can you provide a replication? Its hard to see the problem with just a one-liner
f
That might be tricky, but we can try. In any case thanks for your time- we'll see what we can do.
w
👍
f
Update: We (hopefully) fixed the issue by going back to generating lockfiles in CI. We had an issue in the past with doing this so I'm not sure why it's working now, but seems to be resolution in the short term at least. Thanks for the help!
👍 1