Michael-J-Ward commented on PR #694:
URL: 
https://github.com/apache/datafusion-python/pull/694#issuecomment-2110364004

   Following the recommended solution of nesting `python/datafusion` and adding 
`tool.maturin.python-source = "python"` *does* seem to work for me.
   
   ---------
   
   ```console
   
   ❯ git diff pyproject.toml 
   diff --git a/pyproject.toml b/pyproject.toml
   index d353605..24bd296 100644
   --- a/pyproject.toml
   +++ b/pyproject.toml
   @@ -55,6 +55,7 @@ repository = 
"https://github.com/apache/arrow-datafusion-python";
    profile = "black"
    
    [tool.maturin]
   +python-source = "python"
    module-name = "datafusion._internal"
    include = [
        { path = "Cargo.lock", format = "sdist" }
   
   flake on  flake [$✘!?⇕] is 📦 v37.1.0 via 🐍 v3.11.9 (venv) via 🦀 v1.77.1 via 
❄  impure (nix-shell-env) on ☁  (us-east-1) 
   ❯ ls python/
   datafusion
   
   flake on  flake [$✘!?⇕] is 📦 v37.1.0 via 🐍 v3.11.9 (venv) via 🦀 v1.77.1 via 
❄  impure (nix-shell-env) on ☁  (us-east-1) 
   ❯ ls -l python
   total 4
   drwxr-xr-x 5 mike users 4096 May 14 08:07 datafusion
   
   flake on  flake [$✘!?⇕] is 📦 v37.1.0 via 🐍 v3.11.9 (venv) via 🦀 v1.77.1 via 
❄  impure (nix-shell-env) on ☁  (us-east-1) 
   ❯ maturin build
   ⚠  Warning: You specified maturin >=0.15, <0.16 in pyproject.toml under 
`build-system.requires`, but the current maturin version is 1.4.0
   🍹 Building a mixed python/rust project
   🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.8
   🐍 Not using a specific python interpreter
   📡 Using build options features, locked from pyproject.toml
       Finished dev [unoptimized + debuginfo] target(s) in 0.17s
   ⚠  Warning: No compatible platform tag found, using the linux tag instead. 
You won't be able to upload those wheels to PyPI.
   📦 Built wheel for abi3 Python ≥ 3.8 to 
/home/mike/workspace/datafusion-python/flake/target/wheels/datafusion-37.1.0-cp38-abi3-linux_x86_64.whl
   
   flake on  flake [$✘!?⇕] is 📦 v37.1.0 via 🐍 v3.11.9 (venv) via 🦀 v1.77.1 via 
❄  impure (nix-shell-env) on ☁  (us-east-1) took 20s 
   ❯ pip install .
   Processing /home/mike/workspace/datafusion-python/flake
     Installing build dependencies ... done
     Getting requirements to build wheel ... done
     Preparing metadata (pyproject.toml) ... done
   Requirement already satisfied: pyarrow>=11.0.0 in 
/nix/store/llp7z339ix0lm7nlrndn1yvdmhskcsyk-rust-toolchain/lib/python3.11/site-packages
 (from datafusion==37.1.0) (15.0.0)
   Requirement already satisfied: numpy<2,>=1.16.6 in 
/nix/store/llp7z339ix0lm7nlrndn1yvdmhskcsyk-rust-toolchain/lib/python3.11/site-packages
 (from pyarrow>=11.0.0->datafusion==37.1.0) (1.26.4)
   Building wheels for collected packages: datafusion
     Building wheel for datafusion (pyproject.toml) ... done
     Created wheel for datafusion: 
filename=datafusion-37.1.0-cp38-abi3-linux_x86_64.whl size=17875125 
sha256=921aca268be398c639695a5b851e14b3a19185ce39f2336d736a5f5705841b01
     Stored in directory: 
/tmp/nix-shell.e0IZLi/pip-ephem-wheel-cache-lzlmoc66/wheels/8e/1b/87/2a5f750e961aa47403189d62f5e1236e0819f25e0a9068babf
   Successfully built datafusion
   Installing collected packages: datafusion
     Attempting uninstall: datafusion
       Found existing installation: datafusion 37.1.0
       Uninstalling datafusion-37.1.0:
         Successfully uninstalled datafusion-37.1.0
   Successfully installed datafusion-37.1.0
   
   flake on  flake [$✘!?⇕] is 📦 v37.1.0 via 🐍 v3.11.9 (venv) via 🦀 v1.77.1 via 
❄  impure (nix-shell-env) on ☁  (us-east-1) took 4s 
   ❯ python 
   Python 3.11.9 (main, Apr  2 2024, 08:25:04) [GCC 13.2.0] on linux
   Type "help", "copyright", "credits" or "license" for more information.
   >>> import datafusion
   >>> datafusion.__version__
   '37.1.0'
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to