-
Notifications
You must be signed in to change notification settings - Fork 187
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build and distribute Python pip package of verovio #1798
Comments
@musicEnfanthen what do you think? |
Yes, this could be a valuable asset. (But it is not on me to decide, so let's ask @lpugin ;) There are two different build scenarios:
@apacha Could you point out what the problem was building the Python toolkit on MacOS? For the CI, it would not matter on which platform we build the toolkit, wouldn't it? Another thought: The approach of 1) could be also used to provide the JAVA toolkit. |
I think it would make sense for stable releases but not on every commit. @apacha could you draft the pip package? That would be very helpful. We can then build it from the GH action and publish it from there. (I just build the latest develop on MacOS 10.15.7 with the MacOSX10.15.sdk without problem, so it would be a good track down the issue your are reporting) |
Here is an example workflow how to publish python packages: https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python#publishing-to-package-registries |
Thanks! Quite useful. I think the tricky part will be to deal with the C++/swig build. I assume users will still need to compile them on their side. Am I wrong? Sorry, I have very little experience with Python modules. |
I think users won't have to compile it if you build binaries for their platform. From https://pythonwheels.com: "C extensions PyPI currently allows uploading platform-specific wheels for Windows, macOS and Linux. It is useful to create wheels for these platforms, as it avoids the need for your users to compile the package when installing. You will need to have access to the platform you are building for." |
For now moved to the wish-list /~https://github.com/rism-ch/verovio/wiki/Low-priority-wish-list |
Preliminary cross-platform working draft: /~https://github.com/musicEnfanthen/verovio/actions/runs/417449074 Including data folder works for |
Steps to get
[1] https://stackoverflow.com/questions/61624018/include-extra-file-in-a-python-package-using-setuptools |
Not sure if data is at the right location now . Wheel checker complains about it being at the top level. Also complains about duplicated files: /~https://github.com/musicEnfanthen/verovio/runs/1544041739?check_suite_focus=true#step:16:7 The checks can be disabled if duplication and top level is what we want instead |
The next issue will be that TestPyPi (and probably PyPi, too) does not allow the upload of Linux specific wheels: pypi/legacy#120 One would have to rely on manylinux, so we are back at the first issue that |
Where should it expected to be placed? We can move it there. We still need to change the path in the C++ code anyway.
The duplicated files warning should be disabled because we cannot change this. The files are expected to be the same (content and name). |
That's quite annoying... I don't think symlink will work, unless manylinux takes care of resolving / updating the links when copying stuff to the docker container. I doubt it. One way forward would be to have a script to copy everything we need into a directory and run setup from there. But basically we would more or less copy everything from the parent. Not very elegant. Alternatively we could move |
Having |
Yes, that is a great idea, since we can move it to the top level inside the action! Let's try |
I have no idea what the correct location would be. Wheel checker has some restrictions for folder names at the top level including
Ok, that's fine. Will disable then. |
This should also make it possible to use cibuildwheel, which could also make it easier. @musicEnfanthen are you giving a try? I can then look at the resource path issue. (Maybe one thing to look at is to have setup.py outputting things in one directory that we can add to gitignore, and to not many files and directories in |
@lpugin Could you explain briefly the following construction, especially why the
|
The script needs to run from on level down the |
Ok thanks. The new path seems to work. |
I was excited to see Verovio available via |
It is a work-in-progress (that's why this ticket is still open), though you can already install it from the test-pypi site, e.g., with |
The latest release (3.1.0) is now available in the official index and can be installed with Many thanks to @musicEnfanthen and @alastair for their great help and the huge amount of time they invested into this! |
Awesome, thank you! |
It would be fantastic if the CI would build the verovio wheels for all different platforms and distributes them via pip, so Python developers can just say 'pip install verovio'.
For example, for building the application on Mac is a bit tricky, as you need to install several dependencies. I also ran into another problem that I was luckily able to solve by calling
export ARCHFLAGS="-arch x86_64"
before running the build.One last thing that I would like to point out: The pip package
verovio
isn't taken yet, so it would make sense to publish the official version of verovio on it, before someone else might grab that name.The text was updated successfully, but these errors were encountered: