-
Notifications
You must be signed in to change notification settings - Fork 603
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
[TODO] Full python integration #207
Comments
Hi Syoyo! I maintain a Python library called Lace and also use Trimesh. I'm evaluating tinyobjloader as a replacement loader that could work with both projects. (Lace has its own loader using C++/Boost/NumPy, and Trimesh has one in pure Python.) I'm planning to write tinyobjloader integrations for Lace and Trimesh (which I'd then add to / offer to add to the libraries themselves). I'd also like to help smooth out the Python interop so it's easy for Lace + Trimesh users to consume this library. So far I've run into two issues:
Regarding the wheels, out of curiosity how are you handling releasing to PyPI? Do you release from your dev machine or from CI? I think a wheel needs to be built on the target platform, though I could see what kind of tools are available with the CIs you're already using, and what I might be able to put together using Docker. Thanks again for your work on this library. I'm excited at the prospect of using it in Lace + Trimesh.
|
PyPI build follows standard procedure from this: https://packaging.python.org/tutorials/packaging-projects/
You may need to add pybind11 files to |
Okay, I will look into that! Regarding wheels, I understand what's happening now. There is a Linux wheel but not for Mac or Windows: https://pypi.org/simple/tinyobjloader/ The wheels for other platforms need to be built on the other platforms, which is a challenge. I found this too. which could help: https://github.com/joerick/cibuildwheel The tool is new, but it's used by big projects like websockets and Twisted. Would you be interested in running something like that? I could help set it up. |
Regarding the build issue for the source distribution, one issue is that the pybind11 sources are not shipped with the source distribution. This is the full contents:
It seems like the more common way to solve this is declaring an install dependency on pybind11 (as in the setup.py for mplcairo). Added: Here is another, much simpler example: https://github.com/pybind/python_example/blob/master/setup.py If you prefer to keep the subtree approach, it's probably possible to vendor in pybind11 with your source distribution. However, it has a different license, so that might be confusing. |
I have a version which installs pybind11 at build time. It seems to be working well. master...metabolize:fix-python-sdist |
Awesome! Could you please send this changes as an PR?
I didn't realized that such a feature in setuptools. Good to know! |
I will! I’m just digging in now to one last complication which is making pybind11 available at build time without unnecessarily installing it at runtime. I also got cibuildwheel running on Azure Pipelines and used it to publish some experimental wheels. Python packaging is complicated and can be opaque, and I’m really impressed with the documentation for that tool, and how easy it makes the process. |
Hi @syoyo! Could you tag a new version and release it to PyPI, along with the wheels that get generated? Also, I'll put an offer out there. I noticed some discussion about releases in #212, and would be happy to maintain the releases for this project, according to Semantic Versioning. I maintain a bunch of reputable projects, most notably https://shields.io/ and https://github.com/nock/nock/. I'm paulmelnikow on PyPI. Let me know if you'd like my help with this! |
@paulmelnikow I have added a tag for recent
Awesome! How can I delegate permissions of release versioning, uploading PyPI, etc to you? I found this on github https://github.blog/2019-10-03-delegate-responsibilities-with-expanded-repository-permissions/ |
Cool! You can give me write access to the repo here: https://github.com/syoyo/tinyobjloader/settings/access Write access isn't restricted to tagging releases, though if you'd prefer, I can refrain from using the access to do anything else. Probably it will be necessary to push commits to update version numbers and changelogs, as well, though I can definitely run those through pull requests. You can add me to the PyPI project here: https://pypi.org/manage/project/tinyobjloader/collaboration/ In the future it might be useful to move the project to a GitHub organization, which would allow delegating more access, such as managing connected apps, and using those expanded repository permissions you linked to. Though, that doesn't seem necessary right now. This is a great first step! |
Maybe you should also give me access to publish to Conan? To minimize confusion, ideally all the channels should get a new release with the same version number at the same time. |
@paulmelnikow Thanks! I have created an organization: https://github.com/tinyobjloader Migrating the repo will be soon.
Github organitzation + proper permission setting will also enable accessing Conan to you? |
I’m not sure! I’ve never used Conan and I’m not familiar with how it works. |
@paulmelnikow OK. Now I have moved the repo to tinyobjloader organization and added |
Did you add me to PyPI too? Why don’t I try publishing the release you tagged to PyPI? |
@paulmelnikow Added as maintainer! If you need |
Since cibuildwheel wasn't working on the 2.0.0rc4 rev, I'll tag rc5 and get this going. |
Could you set up Azure Pipelines and Travis on the new repo? |
Oh, I see. Will look into that soon(tomorrow or day after tomorrow) |
Finish writing full python binding using pybind11(
python/binding.cc
)Status
material_t
)Related to #148
The text was updated successfully, but these errors were encountered: