Skip to content
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 python binding as regular package #506

Merged
merged 29 commits into from
May 26, 2023

Conversation

KernelA
Copy link
Contributor

@KernelA KernelA commented Jan 3, 2023

This pull request contains:

  • GitHub workflow to build python package for Linux only
  • publishing it on the release page when tag a commit
  • new doc for python binding

Release page example

We can install python binding as regular python package via pip. I think it simplifies package using and will lead to more broadly using.

The workflow contains code for windows building, but I cannot compile it with MS MPI. Changes in the source code are needed.

@ethzasl-jenkins
Copy link

Can one of the admins verify this patch?

@pomerlef
Copy link
Collaborator

pomerlef commented Jan 4, 2023

ok to test

@pomerlef
Copy link
Collaborator

pomerlef commented Jan 4, 2023

@aguenette can you have a look?

@KernelA KernelA marked this pull request as ready for review January 5, 2023 01:16
@pomerlef
Copy link
Collaborator

@KernelA , this is a great add-on for libpointmatcher!

We are not set up to use GitHub workflow yet, but the timing is good as our legacy CI tool seems to stop working. Hopefully, by mid-summer, we will have transitioned to GitHub workflow. Don't give up, your PR will be processed ;)

@KernelA
Copy link
Contributor Author

KernelA commented Mar 17, 2023

@pomerlef, ok. I think there is some work. For example, extracting version from CMake file as base version for the python package. We must sync it manually, at the moment.

@RedLeader962
Copy link
Collaborator

@KernelA By the way awesome work. It is a great addition to libpointmatcher.

Copy link
Collaborator

@RedLeader962 RedLeader962 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've finish my review and added my recommandation. Good job @KernelA, this is going to be very useful for the build system automation.

Remark: I've tested the GitHub workflow using nektos/act.

Note to self: we will have to refactor the jobs steps eventualy to reduce build time if we want to add support for other ubuntu versions and computer architecture (boost and libnabo install could go in a docker container) but this pull request is a great starting point.

Thanks @KernelA

.github/workflows/build-python.yaml Outdated Show resolved Hide resolved
.github/workflows/build-python.yaml Show resolved Hide resolved
doc/CompilationPython.md Outdated Show resolved Hide resolved
python/setup.py Outdated

version = None

with open(path_to_file, "r", encoding="utf-8") as f:
Copy link
Collaborator

@RedLeader962 RedLeader962 May 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fetching the pointmatcher version dynamicaly will be a very usefull tool for the build system automation.
(!) Limitation: This approach to fetching the POINTMATCHER_VERSION only work if the user execute

python -m build --wheel

It will break when using the default

python -m build

because the build command will build sdist in a first step and then build wheel fetching from a temporary dir /tmp/build-via-sdist-*/pypointmatcher-*.

I recommand

  • to keep this approach for now but wrapped in a try/except clause with an explicit error message pinpointing its origin since it is not obvious when it happen in a install stacktrace which is usualy prety long;
  • to add an explicit comment on those limitations in the code to advise futur developer;
  • and to add a warning in the doc/CompilationPython.md package install procedure.

python/setup.py Outdated Show resolved Hide resolved
@KernelA
Copy link
Contributor Author

KernelA commented May 11, 2023

@RedLeader962, thank you for feedback! I did make changes according to review.

Will wait a build status:
https://github.com/phygitalism/libpointmatcher/actions/runs/4952671666

@KernelA KernelA requested a review from RedLeader962 May 11, 2023 20:45
@KernelA
Copy link
Contributor Author

KernelA commented May 13, 2023

The last build status:
https://github.com/phygitalism/libpointmatcher/actions/runs/4966179029

Copy link
Collaborator

@RedLeader962 RedLeader962 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to merge PR.
@pomerlef Will need to bypass Jenkins

@KernelA Good job

@pomerlef pomerlef merged commit 64f4da6 into norlab-ulaval:master May 26, 2023
sloriot added a commit to sloriot/cgal-testsuite-dockerfiles that referenced this pull request Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants