f3d icon indicating copy to clipboard operation
f3d copied to clipboard

WIP: Add python packaging

Open sitic opened this issue 2 years ago • 6 comments

Initial implementation of python packaging, looking for feedback if's something you want / would accept.

Goal would be to make f3d easily installable with pip. The python packages generated here include both the libf3d (#52) bindings, as well as the f3d executable. I advocate for including the f3d binary in the python distribution wheel, to me pip the fastest & easiest way to install software (especially if I only need it for a specific project).

pip install . installs the python package, pip wheel . builds a python distribution wheel. I've updated the python test files so that pytest is able to run.

I'll note that because pybind11 does not support the stable cpython ABI we unfortunately would have to build a .whlfor each python minor version & OS combination.

  • [x] Make pip install . compile & install a python package for libf3d
  • [x] Add f3d executable as a console_script (using a python wrapper)
  • [ ] Don't use BUILD_SHARED_LIBS=OFF
  • [ ] Add CI to build platform independent wheels for Linux / MacOS / Windows
  • [ ] Complete metadata information in setup.py
  • [ ] Add CI job to publish on PyPi on release
  • [ ] Maintainers: Register https://pypi.org/project/f3d/

sitic avatar Jun 20 '22 00:06 sitic

That's nice! We wanted to create a python wheel before the release and it definitely helps us a lot! Thanks for the effort, I will take a look.

Meakk avatar Jun 20 '22 06:06 Meakk

Thanks @sitic !

mwestphal avatar Jun 20 '22 07:06 mwestphal

Don't use BUILD_SHARED_LIBS=OFF

Indeed, the python library and the file executable are both embedding the f3d library right now.

Add CI to build platform independent wheels for Linux / MacOS / Windows

See ci.yml, you should be add another job.

Add CI job to publish on PyPi on release

Isn't it optional? We can still publish the wheels manually right?

Maintainers: Register https://pypi.org/project/f3d/

I will after the next release

Meakk avatar Jun 21 '22 17:06 Meakk

Add CI job to publish on PyPi on release

Isn't it optional? We can still publish the wheels manually right?

I agree, that does not seems necessary.

mwestphal avatar Jun 25 '22 14:06 mwestphal

@sitic Let us know if you need any help moving forward :)

mwestphal avatar Jul 04 '22 19:07 mwestphal

@sitic Let us know if you need any help moving forward :)

I haven't had time yet to work on this PR, but I definitely haven't forgotten it. Thank you both for the comments. I'll reply to them hopefully soonish

sitic avatar Jul 05 '22 02:07 sitic

Any luck with this @sitic ?

mwestphal avatar Feb 01 '23 06:02 mwestphal

Closing this one.
Most of the changes have been addressed by #920 and #915

Meakk avatar Jul 18 '23 09:07 Meakk