white-twilight-61019
12/07/2023, 4:05 AMcelery[sqs]
and celery[redis]
package in poetry (pyproject.toml
) config. I can able to generate python_default.lock
file. However I'm not sure how to add this extras as dependancy in BUILD file. Can someone please guide me how to configure this?
# pyproject.toml
[tool.poetry.group.pkg-celery_worker.dependencies]
celery = {extras = ["redis", "sqs"], version = "^5.3.6"}
# BUILD file
python_sources(
name="pkg",
sources=["celery/**/*.py"],
dependencies=[
"3rdparty/python:poetry#boto3",
"3rdparty/python:poetry#celery",
"3rdparty/python:poetry#redis",
],
)
broad-processor-92400
12/07/2023, 5:06 AM3rdparty/python:poetry#celery
will activate those extras (i.e. include the dependencies implied); are you observing something different?white-twilight-61019
12/07/2023, 9:20 AMraise ImportError('The curl client requires the pycurl library.')
ImportError: The curl client requires the pycurl library.
broad-processor-92400
12/07/2023, 9:52 AMwhite-twilight-61019
12/07/2023, 12:56 PMpyproject.toml
, will it be installed only if the platform is Linux and skipped for macOS?
triton = [
{ version = "2.1.0", markers = 'sys_platform == "linux"' },
]
white-twilight-61019
12/07/2023, 12:57 PMwhite-twilight-61019
12/07/2023, 12:58 PMEngine traceback:
in `check` goal
ProcessExecutionFailure: Process 'Building requirements_venv.pex' failed with exit code 1.
stdout:
stderr:
Failed to resolve requirements from PEX environment @ /home/runner/.cache/pants/named_caches/pex_root/unzipped_pexes/3d7a856ceb2854e125d946d7405388e8f27e501b.
Needed cp39-cp39-manylinux_2_35_x86_64 compatible dependencies for:
1: triton<3,>=2.0.0
Required by:
openai-whisper 20231117
But this pex had no ProjectName(raw='triton', normalized='triton') distributions.
Use `--keep-sandboxes=on_failure` to preserve the process chroot for inspection.
curved-television-6568
12/08/2023, 1:22 PMIf I add a dependency with markers like this inthat’s supposed to work, yes., will it be installed only if the platform is Linux and skipped for macOS?pyproject.toml
curved-television-6568
12/08/2023, 1:24 PMYes. It seems it’s not added by default. I’m getting this error
``` raise ImportError('The curl client requires the pycurl library.')
ImportError: The curl client requires the pycurl library.```
without knowing what you’re importing, it’s difficult to replicate..
white-twilight-61019
12/11/2023, 2:18 AMpants generate-lockfiles --resolve=python-default
command adds Triton to the python_default.lock
file when executed on the Ubuntu machine but not when executed on MacOS. I attempted to use the same lock file on both operating systems. However, when I run the pants check lint
command from the CI (Ubuntu machine), it throws an error because the package was not added, given that the lock file was generated on MacOS. Should I keep two different lock files based on the operating system? How can I resolve this issue?curved-television-6568
12/11/2023, 4:24 AM❯ shasum 3rdparty/python/default.lock
01f6f30a3da04983372e2e41f13126422c3eca29 3rdparty/python/default.lock
Using this setup:
# pants.toml
[GLOBAL]
pants_version = "2.18.1"
backend_packages.add = [
"pants.backend.python",
]
[python]
enable_resolves=true
interpreter_constraints = ["==3.11.*"]
# pyproject.toml
[tool.poetry.dependencies]
triton = [
{ version = "2.1.0", markers = 'sys_platform == "linux"' },
]
# BUILD
poetry_requirements(name="lib")
And that is with the triton package in the list of known artifacts, and the platform marker preserved in the requirements..white-twilight-61019
12/11/2023, 4:29 AMwhite-twilight-61019
12/11/2023, 4:29 AMwhite-twilight-61019
12/11/2023, 4:32 AMcurved-television-6568
12/11/2023, 4:32 AMwhite-twilight-61019
12/11/2023, 4:33 AM"triton<3,>=2.0.0"
curved-television-6568
12/11/2023, 4:34 AMcurved-television-6568
12/11/2023, 4:34 AMcurved-television-6568
12/11/2023, 4:35 AMwhite-twilight-61019
12/11/2023, 4:36 AMopenai-whisper
. I'm importing openai-whisper
package but internally this package is depending on triton package.curved-television-6568
12/11/2023, 4:37 AMwhite-twilight-61019
12/11/2023, 4:37 AMmy guess is that you need that platform marker for that project as well, perhapsOh is it possible. I'm new to pants ecosystem. Could you please explain how I can configure that?
curved-television-6568
12/11/2023, 4:37 AMwhite-twilight-61019
12/11/2023, 4:38 AMso since that depends on triton, it too would only work on linux...On MacOS, It's working without this triton package. I don't know how. When I try to install it on Ubuntu then it's throwing
triton
package not available.white-twilight-61019
12/11/2023, 4:42 AM# pyproject.toml file
[tool.poetry]
name = "3rdparty"
version = "0.1.0"
description = "3rdparty libs. Dependabot checks this file."
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.9,<3.11"
triton = [
{ version = "2.1.0", markers = 'sys_platform == "linux"' },
]
[tool.poetry.group.project-whisper-speach-recognition.dependencies]
boto3 = "^1.29.2"
numpy = "^1.26.2"
ctranslate2 = "^3.22.0"
transformers = "^4.35.2"
triton = [
{ version = "2.1.0", markers = 'sys_platform == "linux"' },
]
[tool.poetry.group.pkg-celery_worker.dependencies]
celery = {extras = ["redis", "sqs"], version = "^5.3.6"}
pycurl = "^7.45.2"
redis = "^5.0.1"
curved-television-6568
12/11/2023, 4:45 AMcurved-television-6568
12/11/2023, 4:46 AMwhite-twilight-61019
12/11/2023, 4:51 AMpants check
command on both the systems?
If you don't mind can you please share the sample lock file?white-twilight-61019
12/11/2023, 4:53 AMpants generate-lockfiles --resolve=python-default
command on Ubuntu, it adds the line "triton<3,>=2.0.0"
to the lock file. However, when I run the same command on MacOS, this line is not added.curved-television-6568
12/11/2023, 2:38 PMpants check
won’t do anything for me, as I don’t have any sources. It’ll be you that need to try things out, either start with my example and see how it behaves and go from there, or work with your repo trying to get a small enough reproduction you can share will make it easier to help you.white-twilight-61019
12/12/2023, 1:23 AM