I am trying to setup a code repository for workshop UDFs in Python. I have done this many times via typescript, but am unable to get the python functions to build properly.
The error that I am getting below:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':python-functions:testVersions'.
> Execution failed with non-zero exit code: 1
[STDERR]
ERROR × failed to solve environment
╰─▶ Cannot solve the request because of: No candidates were found for pytest ==7.2.1.
An error occurred while executing the command with Hawk 0.215.0.
This error occurs upon creation of the code repository and causes the gradle task to fail before I even try to build the function.
Has anyone had this problem or know how to fix it? I tried to install pytest into the code repository, but it errors out.
This error indicates that the Gradle build failed while running the testVersions task in the python-functions module due to an issue with Python environment resolution. Specifically, it could not find a compatible candidate for pytest 7.2.1 while solving the dependency environment.
I just tested created a new repository from scratch and it works just fine.
After some investigation, we believe this error is associated with code repositories which lack the external-conda-forge artifacts backing channel.
An automatic fix for this issue is currently being deployed. In the meantime, you should be able to fix your own repository by adding an additional artifacts backing channel, lang-python-template-asset, which contains the required pytest dependency. You can do so by navigating to Settings → Libraries → Add → External Repositories → add lang-python-template-asset.
We also recently had this error in a PySpark Repository, getting the error below:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':transforms-python:condaPackTest'.
> Execution failed with non-zero exit code: 1
[STDERR]
ERROR × failed to solve environment
╰─▶ Cannot solve the request because of: The following packages are incompatible
├─ python_abi ==3.10 5_cp310 can be installed with any of the following options:
│ └─ python_abi 3.10
├─ pytest-metadata ==2.0.4 pyhd8ed1ab_0 can be installed with any of the following options:
│ └─ pytest-metadata 2.0.4 would require
│ └─ pytest >=3.0.0,<8.0.0, which can be installed with any of the following options:
│ └─ pytest 7.2.1 | 7.2.2 | 7.3.0 | 7.3.1 | 7.3.2 | 7.3.2 | 7.4.0 | 7.4.1 | 7.4.2 | 7.4.3 | 7.4.4
└─ pytest ==8.3.4 pyhd8ed1ab_1 cannot be installed because there are no viable options:
└─ pytest 8.3.4, which conflicts with the versions reported above.
Failed to run command with hawk (v0.163.0), if you believe this to be an issue with hawk, please file a ticket!
@asmyth in this repo lang-python-template-asset was enabled. We fixed it by upgrading the repo, and then the checks worked again. It looked somehow like some dependencies updated out of sync with others, but I don’t know how that can happen.
One change that happened in an upgrade a few months ago is that in the meta.yaml file the explicit python version (e.g. 3.10*) was removed and replaced with just python. Is there any chance that this perhaps somehow allows a more recent version of python to be used than is supported by all the libraries/packages that a specified in the .lock file?
@89443bfc259f0cb0224e I would suggest making sure that your repo has been upgraded to the latest template and see if that helps.