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

Error trying to use pyspark #120

Open
njlr opened this issue Sep 20, 2024 · 4 comments
Open

Error trying to use pyspark #120

njlr opened this issue Sep 20, 2024 · 4 comments

Comments

@njlr
Copy link
Contributor

njlr commented Sep 20, 2024

When I try to use the pyspark package, I get this error:

Backend 'setuptools.build_meta:legacy' is not available.

Here is the pyproject.toml:

[tool.poetry]
name = "cowapp"
version = "0.1.0"
description = ""
authors = ["Your Name <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "3.10.11"
cowsay = "^6.1"
numpy = "^2.0.1"
pyspark = "^3.5.2"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

Full repro code is here: https://github.com/njlr/rules_pycross_oci/tree/issue-pyspark

Trigger the error with:

bazel build //...
@njlr njlr changed the title Cannot use pyspark Error trying to use pyspark Sep 20, 2024
@jvolkman
Copy link
Owner

Unfortunately build dependencies are not included in the poetry lock file, so you'll need to include them yourself like here. You'll also need to add dependencies on setuptools and wheel to pyproject.toml and re-lock.

@njlr
Copy link
Contributor Author

njlr commented Sep 21, 2024

Unfortunately build dependencies are not included in the poetry lock file, so you'll need to include them yourself like here. You'll also need to add dependencies on setuptools and wheel to pyproject.toml and re-lock.

Thanks for the pointers.

I made some progress but hit a new error:

ERROR Backend 'mesonpy' is not available.

Repro is in https://github.com/njlr/rules_pycross_oci/tree/issue-pyspark

@jvolkman
Copy link
Owner

It's the same issue: you'd need to add an explicit dependency on mesonpy.

But meson is a full-fledged build system, so I'm not sure that attempting to build a wheel with it will be very successful nested within a Bazel invocation. It's been on my TODO list for a while to add support for other build systems like meson, maturin (for rust-based wheels), etc. Currently the wheel builder in this rule set assumes setuptools and distutils. These are by and large still the standard, though, so maybe mesonpy will also work with the same assumptions. But I've never tried.

@njlr
Copy link
Contributor Author

njlr commented Dec 4, 2024

I attempted to add this, but I still get the same error:

ERROR Backend 'mesonpy' is not available.

Added here: https://github.com/njlr/rules_pycross_oci/blob/0df866815655f837603a05db81e7cc00eb05b759/cowapp/BUILD.bazel#L40-L45

Any ideas?

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