Comments (7)
If you comment out the Zig tests (test { ... }
), does it run then?
I think what's happened is that some releases of Miniconda ship with a statically linked Python. So while we can build the Python extension and run pytests initiated from Python, we are failing to run the Zig tests (hello.test.bin) which are bundled into standalone executables expecting to find a libpython.
from ziggy-pydust.
Let me know if 0.2.13 solves this for you
from ziggy-pydust.
I did poetry update
. Now I don't get the build error, but I get this error instead:
❯ poetry update
Updating dependencies
Resolving dependencies... (0.7s)
Package operations: 0 installs, 1 update, 0 removals
• Updating ziggy-pydust (0.2.12 -> 0.2.13)
❯ poetry run pytest
===================================== test session starts =====================================
platform darwin -- Python 3.11.5, pytest-7.4.2, pluggy-1.3.0
rootdir: /private/var/tmp/ziggy-pydust-test/poetry-demo
plugins: ziggy-pydust-0.2.13
collected 1 item / 1 error
=========================================== ERRORS ============================================
_______________________________ ERROR collecting src/hello.zig ________________________________
.../opt/miniconda3/envs/poetry.3.11/lib/python3.11/site-packages/_pytest/runner.py:341: in from_call
result: Optional[TResult] = func()
.../opt/miniconda3/envs/poetry.3.11/lib/python3.11/site-packages/_pytest/runner.py:372: in <lambda>
call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
.../opt/miniconda3/envs/poetry.3.11/lib/python3.11/site-packages/pydust/pytest_plugin.py:62: in collect
h = TestProtocol.Header.unpack(proc.stdout)
.../opt/miniconda3/envs/poetry.3.11/lib/python3.11/site-packages/pydust/pytest_plugin.py:230: in unpack
(tag, bytes_len) = struct.unpack("<II", buffer.read(8))
E struct.error: unpack requires a buffer of 8 bytes
--------------------------------------- Captured stderr ---------------------------------------
dyld[79445]: Library not loaded: @rpath/libpython3.11.dylib
Referenced from: <D72FED9A-0E06-3AAD-BE89-DEB489A71CE4> /private/var/tmp/ziggy-pydust-test/poetry-demo/zig-out/bin/hello.test.bin
Reason: tried: '/usr/local/lib/libpython3.11.dylib' (no such file), '/usr/lib/libpython3.11.dylib' (no such file, not in dyld cache)
=================================== short test summary info ===================================
ERROR src/hello.zig - struct.error: unpack requires a buffer of 8 bytes
!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!
====================================== 1 error in 0.14s =======================================
If I look at linkage on hello.test.bin:
❯ otool -L zig-out/bin/hello.test.bin
zig-out/bin/hello.test.bin:
@rpath/libpython3.11.dylib (compatibility version 3.11.0, current version 3.11.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.100.3)
from ziggy-pydust.
@ssteinbach could you attach the output of poetry run python -m sysconfig
?
from ziggy-pydust.
❯ poetry run python -m sysconfig
Platform: "macosx-11.0-arm64"
Python version: "3.11"
Current installation scheme: "posix_prefix"
Paths:
data = "~/opt/miniconda3/envs/poetry.3.11"
include = "~/opt/miniconda3/envs/poetry.3.11/include/python3.11"
platinclude = "~/opt/miniconda3/envs/poetry.3.11/include/python3.11"
platlib = "~/opt/miniconda3/envs/poetry.3.11/lib/python3.11/site-packages"
platstdlib = "~/opt/miniconda3/envs/poetry.3.11/lib/python3.11"
purelib = "~/opt/miniconda3/envs/poetry.3.11/lib/python3.11/site-packages"
scripts = "~/opt/miniconda3/envs/poetry.3.11/bin"
stdlib = "~/opt/miniconda3/envs/poetry.3.11/lib/python3.11"
...
(+ a ton of environment variables)
from ziggy-pydust.
I managed to repro this locally and we have fixed it in #69. Please reopen if this is still an issue after 0.3.3
from ziggy-pydust.
Working great now, thanks again!
from ziggy-pydust.
Related Issues (20)
- Support GIL management
- Support Python base classes
- py.isinstance should support Pydust types
- Support __del__ method on modules (with m_free slot)
- Support *args and **kwargs
- Support tracebacks for non PyExc exceptions
- Convention for returning new/borrowed references
- Add py.alloc HOT 1
- Action Required: Fix Renovate Configuration
- Should produce error when non kwargs args follow variadic args HOT 1
- Unexpectedly slow class method calls HOT 2
- Provide fast conversion from `PyObject` to Pydust type struct
- Store PyType objects on module state
- GC traverse and clear should traverse plain structs
- Is pydust still in active development? HOT 4
- Support creating PyLong from arbitrary sized integers
- Using Pydust to Embed a Python Interpreter
- sysconfig.get_config_var("LDLIBRARY") is now defined in Windows Python v3.13.0b1
- License template is not populated.
- Support of Zig versions >= 0.13.0? How hard will it be? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ziggy-pydust.