gorules / zen

Open-source Business Rules Engine for your Rust, NodeJS, Python or Go applications.
https://gorules.io
MIT License
835 stars 80 forks source link

zen-engine doesn't install on Python 3.13 #260

Closed anil-enable closed 1 month ago

anil-enable commented 1 month ago

When installing zen-engine (0.30.0) on Python 3.13 virtual environment, it gives the following error

anilk@Anils-MacBook-Pro python313-play % python3 --version
Python 3.13.0

anilk@Anils-MacBook-Pro python313-play % poetry add zen-engine
Using version ^0.30.0 for zen-engine

Updating dependencies
Resolving dependencies... (0.1s)

Package operations: 1 install, 0 updates, 0 removals

  - Installing zen-engine (0.30.0): Failed

  ChefBuildError

  Backend subprocess exited when trying to invoke build_wheel

  Running `maturin pep517 build-wheel -i /private/var/folders/c5/r2wq7_6d0x7blz60313sfc0m0000gn/T/tmpnm16f2hc/.venv/bin/python --compatibility off`
  πŸ’₯ maturin failed
    Caused by: Cargo metadata failed. Do you have cargo in your PATH?
    Caused by: No such file or directory (os error 2)
  Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/private/var/folders/c5/r2wq7_6d0x7blz60313sfc0m0000gn/T/tmpnm16f2hc/.venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1

  at ~/Library/Application Support/pypoetry/venv/lib/python3.11/site-packages/poetry/installation/chef.py:164 in _prepare
      160β”‚ 
      161β”‚                 error = ChefBuildError("\n\n".join(message_parts))
      162β”‚ 
      163β”‚             if error is not None:
    β†’ 164β”‚                 raise error from None
      165β”‚ 
      166β”‚             return path
      167β”‚ 
      168β”‚     def _prepare_sdist(self, archive: Path, destination: Path | None = None) -> Path:

Note: This error originates from the build backend, and is likely not a problem with poetry but with zen-engine (0.30.0) not supporting PEP 517 builds. You can verify this by running 'pip wheel --no-cache-dir --use-pep517 "zen-engine (==0.30.0)"'.

Operating system: macOS 15.0.1 (24A348)

stefan-gorules commented 1 month ago

Likely we aren't building a wheel for your architecture / cpython version yet. Would you be able to provide more details on how you've set-up the example as well as if your mac is M1 or Intel.

anil-enable commented 1 month ago

Ok, I will share an example soon In the meantime, sharing some additional information

Sharing a fragment of poetry.lock file showing how zen-engine (0.30.0) installation on Python 3.12 on my machine looks like

[[package]]
name = "zen-engine"
version = "0.30.0"
description = "Open-Source Business Rules Engine"
optional = false
python-versions = ">=3.7"
files = [
    {file = "zen_engine-0.30.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:9b5ce482c7ebdc1705f6acd5d1093e5238b16cf78661ca136da18f2aa446c534"},
    {file = "zen_engine-0.30.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:5da7d0754ef9e561284fbeea7c273875f77e20d72a047888b193096a8c64b4fd"},
...

In the above you will notice entry for zen_engine-0.30.0-cp312-cp312-macosx_11_0_arm64.whl.

I am assuming for installation on Python 3.13, there should be a wheel named zen_engine-0.30.0-cp313-cp313-macosx_11_0_arm64.whl or something equivalent. Can you please confirm if this is already there.

Hope this helps.

anil-enable commented 1 month ago

Here is a minimal example, that has no additional dependencies

anilk@Anils-MacBook-Pro example1 % python3 --version
Python 3.13.0

anilk@Anils-MacBook-Pro example1 % pip3 --version
pip 24.2 from /Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages/pip (python 3.13)

anilk@Anils-MacBook-Pro example1 % python3 -m venv .venv           
anilk@Anils-MacBook-Pro example1 % source .venv/bin/activate   

(.venv) anilk@Anils-MacBook-Pro example1 % pip3 install zen-engine  
Collecting zen-engine
  Using cached zen_engine-0.30.0.tar.gz (169 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  Γ— Preparing metadata (pyproject.toml) did not run successfully.
  β”‚ exit code: 1
  ╰─> [6 lines of output]

      Cargo, the Rust package manager, is not installed or is not on PATH.
      This package requires Rust and Cargo to compile extensions. Install it through
      the system's package manager or via https://rustup.rs/

      Checking for Rust toolchain....
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Γ— Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
ivanmiletic commented 1 month ago

@anil-enable seems we do not build that specific wheel (3.13) for python https://pypi.org/project/zen-engine/0.30.0/#files

As a workaround you have 2 options:

  1. Try to downgrade to 3.12 python
  2. Install Rust and repeat installation, it will try to build this package
anil-enable commented 1 month ago

Ok, I understand that you don't currently build wheel for python 3.13, but I am requesting you to support this. This will become a blocker for all python projects that use zen-engine and are trying to move to the latest version of python (3.13).

ivanmiletic commented 1 month ago

We understand the importance of supporting Python 3.13, and we’ve added this to our backlog. However, at the moment, we are prioritizing features and requests across BRE and BRMS from our Enterprise and Business customers.

If this is critical for your project or organization, please feel free to reach out directly via email (hi@gorules.io), and we’ll do our best to re-evaluate the priority.

stefan-gorules commented 1 month ago

Issue has been identified, please see #262.