PyO3 / maturin

Build and publish crates with pyo3, cffi and uniffi bindings as well as rust binaries as python packages
https://maturin.rs
Apache License 2.0
3.99k stars 275 forks source link

Replace "." with "/" in module_name #2219

Closed mscroggs closed 2 months ago

mscroggs commented 2 months ago

If a "." is used in module_name, this should be replaced by joining a path, as it represents a subdirectory.

Fixes #2218.

netlify[bot] commented 2 months ago

Deploy Preview for maturin-guide ready!

Built without sensitive environment variables

Name Link
Latest commit adb5657b4bf23810505b4552f8f68a28e0c43924
Latest deploy log https://app.netlify.com/sites/maturin-guide/deploys/66e1a808309cde00098cc90b
Deploy Preview https://deploy-preview-2219--maturin-guide.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

messense commented 2 months ago

Just to confirm, do it work for module name that doesn't not contain .?

mscroggs commented 2 months ago

Just to confirm, do it work for module name that doesn't not contain .?

Good question. I'll make up a local package now and check

mscroggs commented 2 months ago

Just to confirm, do it work for module name that doesn't not contain .?

Picking from the examples in the README, I was able to build and install https://github.com/webonnx/wonnx with this branch

messense commented 2 months ago

Unfortunately wonnx won't trigger that code path because it does not need to bundle external libs:

$ unzip -l wonnx-0.5.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Archive:  wonnx-0.5.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
     1567  09-30-2023 09:12   wonnx-0.5.1.dist-info/METADATA
      129  09-30-2023 09:12   wonnx-0.5.1.dist-info/WHEEL
      103  09-30-2023 09:12   wonnx/__init__.py
 15338144  09-30-2023 09:12   wonnx/wonnx.abi3.so
      354  09-30-2023 09:12   wonnx-0.5.1.dist-info/RECORD
---------                     -------
 15340297                     5 files
mscroggs commented 2 months ago

Just to confirm, do it work for module name that doesn't not contain .?

Picking from the examples in the README, I was able to build and install https://github.com/webonnx/wonnx with this branch

.. although I've just realised that that was useless as it doesn't have any shared objects

mscroggs commented 2 months ago

Good news: I locally built ndelement with module-name updated to not have a dot, and it built, installed an imported without errors