opensim-org / opensim-core

SimTK OpenSim C++ libraries and command-line applications, and Java/Python wrapping.
https://opensim.stanford.edu
Apache License 2.0
800 stars 323 forks source link

Publish opensim-core on PyPI #3939

Open mrrezaie opened 1 month ago

mrrezaie commented 1 month ago

Hi, I think opensim-core can be published on PyPI with minimal effort, for those who have to work with official Python and pip.

Here, I created a workflow in GitHub Actions (derived from yours) that clones opensim-core, builds it for Windows (Python 3.12), creates a wheel file, and uploads it (available in artifacts): https://github.com/mrrezaie/testBuildOpenSim/blob/42d9596d642ee87f06c89eee0a4130cd123efd3a/.github/workflows/main.yml#L100-L102

The wheel file can be installed easily using pip install zzz.whl, or be published on PyPI for any Python users: https://medium.com/@blackary/publishing-a-python-package-from-github-to-pypi-in-2024-a6fb8635d45d

Also, installing the PyPI package in Google Colab would be much faster than the conda package (through condacolab).

Hope this helps.

Update: I found one other advantage; since the opensim dll and exe files are being copied into the opensim package folder using this method, there won't be any interference with other dependencies like casadi and ezc3d. So, all packages can be installed and used in a same Python environment.

alexbeattie42 commented 1 month ago

This issue seems relevant to the discussion also.