Closed sweetgiorni closed 3 years ago
Hi @sweetgiorni, thanks for letting us know!
Indeed, the file bison_callback.h
is not in the source package pybison-0.3.1.tar.gz
.
It seems that this file was missing in MANIFEST.in
, which is fixed now (in version v0.4.1)
However, it seems that you are using python 2.7, which is not actively supported. I would recommend to use python 3, if possible.
Best, @sbrodehl
Thanks. Yeah, I figured out Python 2 wasn't supported but unfortunately I'm stuck with it for now. But I will be coming back when we switch to Python 3!
Maybe the last supported version works for you, which is v0.2.10 and has packages on pypi. I think the main problem was, that our manylinux build environment dropped support for python 2.7, thus, we were unable to (easily) build the release packages for pypi. Maybe there is a way to build the packages yourself?
Well I played around with this for a bit and got import bison
to succeed. Even when working from the v0.2.10 Git tag I ran into a few issues.
pip install pybison==0.2.10
failsbison_.pyx
uses from importlib import machinery
which apparently is Python3 only. I replaced it with imp.get_suffixes()
__init__.py
seems to contain a Unicode character - color_blue("└ near ")
- and fails to load unless # -*- coding: utf-8 -*-
is added to the top of the file (maybe it's just my system?)__init__.py
calls makedirs
with the exist_ok
parameter which is Python3That got the import working, but tests still look pretty broken. Are you sure Python2 was supported at some point? :) If so then I'm doing something very wrong.
Would you be interested in getting this package working with Python 2? If so I can try and get it backward compatible and send a PR. I'm currently using PLY which is slow as hell, and unfortunately there aren't many alternatives
I looked into this and added a new branch, which should get it working with Python2. It includes pretty much the changes you mentioned. bison_.c
is updated (compiled for Python2 - we probably need to delete this in the source package later on).
I replaced the makedirs
call with Path(..).mkdir(..)
, which introduces pathlib2
as a new dependency.
However, the tests are a different story. I fixed a wrong include, but that was only a cosmetic change.
The probleme here is, that the tests are all very old (like decades?!), and meanwhile bison
/flex
got quite some (breaking) changes. I must admit, the tests need some love ..
Building from source fails with the following errors:
It looks like bison_callback.h is missing from the package: