adamserafini / zaml Goto Github PK
View Code? Open in Web Editor NEW๐ Fast YAML 1.2 parsing library for Python 3
License: BSD 3-Clause "New" or "Revised" License
๐ Fast YAML 1.2 parsing library for Python 3
License: BSD 3-Clause "New" or "Revised" License
Replicating build with zig 0.10.0 at commit 9adce96 (e.g., your talk) on Windows, I experience the following issue when running via pip install
:
ร Building wheel for zaml (pyproject.toml) did not run successfully.
โ exit code: 1
โฐโ> [15 lines of output]
running bdist_wheel
running build
running build_ext
zig build-lib -O ReleaseFast -lc -target x86_64-windows-msvc -femit-bin=build\lib.win-amd64-cpython-312\zaml.cp312-win_amd64.pyd -fallow-shlib-undefined -dynamic -I%PYPATH%\Python312\include -I%PYPATH%\Python312\Include -L%PYPATH%\Python312\Libs -lpython3 zamlmodule.zig
zamlmodule.zig:39:26: error: no field named 'ob_refcnt' in struct '%ZIGPATH%.zig.o.f50a540243561e8d55a8f2208b6843e4.cimport.struct__object'
.ob_refcnt = 1,
^
%ZIGPATH%\o\f50a540243561e8d55a8f2208b6843e4\cimport.zig:2324:35: note: struct declared here
pub const struct__object = extern struct {
~~~~~~~^~~~~~
referenced by:
PyInit_zaml: zamlmodule.zig:57:29
remaining reference traces hidden; use '-freference-trace' to see all reference traces
error: command '%ZIGPATH%\\zig.EXE' failed with exit code 1
[end of output]
My best guess is, the C API changed some time around 3.10/3.11 (I'm on 3.12): https://docs.python.org/3/c-api/refcounting.html
If you'd be so kind as to let me know what version of Python you were using, I can try to replicate and narrow this down to the point where I can take a stab at a fix and/or update.
Alternative explanations include specific zig cimport implementations (zigup applied v0.10.0 with f50a5402
) but the issue seems consistent across zig versions so I suspect this is less likely.
Hej,
indeed, the default yaml loader is slow!
Before I go ahead and start to parse strings manually, I wanted to give your lib a go!
Thanks for trying to fix this!
I was trying to replace
yaml.load(output, Loader=CLoader)
with
yaml_obj = zaml.load(output)
but got the following error:
Traceback (most recent call last):
File "./glljobstat_testing.py", line 508, in <module>
JobStatsParser().RunBEO()
File "./glljobstat_testing.py", line 498, in RunBEO
self.run_once_retry(HOSTS, STATSPARAM, SSHUSER, SSHKEY, SSHKEYTYPE, "stats", HOSTPARAM)
File "./glljobstat_testing.py", line 392, in run_once_retry
return self.run_once_ser(HOSTS, STATSPARAM, SSHUSER, SSHKEY, SSHKEYTYPE, TYPE, HOSTPARAM)
File "./glljobstat_testing.py", line 329, in run_once_ser
obj = self.parse_single_job_stats(data)
File "./glljobstat_testing.py", line 225, in parse_single_job_stats
yaml_obj = zaml.load(output)
TypeError: load() takes no arguments (1 given)
I installed zaml into my venv with:
python3 -m pip install zaml
Any suggestions on how to solve this?
Thanks a lot,
Bjoern
I'm assuming the build process needs to be changed so that wheels are built for all systems and made available on PyPI. Is that it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.