Closed pkulev closed 2 years ago
Oops, I finally found that there is prerelease version with fixes, but it failed to install on MacOS. So this issue should be closed.
Thanks I did fix this but forgot it was present in 3.7.0post9. I have no idea when 4.0.0 is going to be released so I should backport the fix into 3.7.0.
It’s quite bizarre that there seems to be no way of including a version number in a file in a library that isn’t a nasty hack. Stack over flow shows a bunch of solutions and they are all nasty.
Oh, packaging is not easy anywhere.
Why version should be in separate file? I use pyproject.toml with poetry and bump version using poetry version [patch|minor|major]
. Publishing also quite easy, just build and publish commands. But maybe for such complex stuff like CFFI bindings it's not so easy to do...
Version doesn't have to be in a separate file, but it does need to be available in raylib/init.py and dynamic/raylib/init.py and in setup.py. So whichever one you put it in, the others now depend on that. So I figured easier to have all three depend on one separate file.
I'll take a look at Poetry.
btw what platform are you on that we don't have binary wheels for?
And what are the errors when you try to install 4.0a4 ?
btw what platform are you on that we don't have binary wheels for?
MacOS on m1 (I was going to report this in issue with macos)
And what are the errors when you try to install 4.0a4 ?
File "raylib/build.py", line 152, in <module>
build_mac()
File "raylib/build.py", line 104, in build_mac
ffibuilder.cdef(mangle("/usr/local/include/raylib.h"))
File "raylib/build.py", line 31, in mangle
for line in open(file):
FileNotFoundError: [Errno 2] No such file or directory: '/usr/local/include/raylib.h'
BUILDING FOR MAC
--------------------
but it does need to be available in raylib/init.py and dynamic/raylib/init.py and in setup.py.
I packaged only easy things and for getting version inside package I used this:
import importlib.metadata
print(importlib.metadata.version('package-name')
Of course it requires some sort of virtualenv for development (python -m venv .venv
or things like poetry can create it transparently) or be installed into system site-packages somehow (via pip or if it packaged for system PM like dnf / portage / brew / etc.).
This should be fixed in 3.7.0.post10
Hi, trying to install via pip (python3.9):
I bet it's because version.py is not included in Manifest.in, I see it included already in https://github.com/electronstudio/raylib-python-cffi/commit/775d2da32df895e4c407d86b7d4a5e826bbd9424.
Please, publish fixed version into PyPI.