Skip to content
Snippets Groups Projects

Refactor python package installation

What does this MR do?

This MR is a refactor of the CMake function dune_python_install_package. The function has many responsibilities that conflict with the initial intention of the function but are needed to properly configure the python bindings. So in this MR we (@andreas.dedner, @samuel.burbulla, and @santiago.ospina) identify such responsibilities and split them into separate functions. That is:

  • dune_python_configure_dependencies: Installs dependencies at configure time for a project with a setup.py file. This is done by extracting a requirements file and installing them explicitely.
  • dune_link_dune_py: Create the metadata in the python package. This function effectively glues a python package with the dune-py project running the bindings. Additionally, it provides a setup.py if none is given (a typical use case of dune bindings).
  • dune_python_configure_package: Configures dependencies (with dune_python_configure_dependencies) and installs a project having a setup.py at configure time (notice that we opted to include !1103 (closed) directly here). Package installation is done without internet since the package is available locally and dependencies have been already fulfilled.
  • dune_python_configure_bindings: Combines dune_python_configure_package and dune_link_dune_py for easy set-up of the dune python bindings.
  • dune_python_install_package: Legacy command for installing packages. Should be deprecated in favor of dune_python_configure_package and dune_python_configure_bindings.

What does this MR solves?

With the current state, only one python package can be configured/installed with this function, namely, the dune python bindings. This was not the initial intention of the function and conflicts with other use cases on downstream projects before Dune 2.8. So, this refactor, allows to pick the correct use-case of the python package and keep both intended uses available.

  • Add CHANGELOG entry

Closes #310 (closed)

Edited by Santiago Ospina De Los Ríos

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Samuel Burbulla
  • added 1 commit

    Compare with previous version

  • added 1 commit

    • 6a9acb68 - Improve documentation and readability

    Compare with previous version

  • Andreas Dedner added 1 commit

    added 1 commit

    • 6bf9bc79 - avoid fatal error on venv configuration error

    Compare with previous version

  • Samuel Burbulla added 2 commits

    added 2 commits

    • fb6435e9 - Restore pyproject.toml and setup.py.
    • ec2fa099 - Apply changes of feature/pip-editable-in-configure.

    Compare with previous version

  • added 1 commit

    • 3393a742 - Apply changes of feature/pip-editable-in-configure.

    Compare with previous version

  • Andreas Dedner resolved all threads

    resolved all threads

  • added 4 commits

    • 46a351d6 - Document deprecated function
    • ce3adb3c - Remove unneeded build target
    • 1720e45d - Clean up documentation
    • 91bc368d - Return error code from python package installation

    Compare with previous version

  • resolved all threads

  • Santiago Ospina De Los Ríos changed the description

    changed the description

  • Santiago Ospina De Los Ríos marked this merge request as ready

    marked this merge request as ready

  • Santiago Ospina De Los Ríos changed title from Draft: Resolve "dune_python_install_package can only install packages without setup.py" to Refactor python package installation

    changed title from Draft: Resolve "dune_python_install_package can only install packages without setup.py" to Refactor python package installation

  • Andreas Dedner added 1 commit

    added 1 commit

    • 404fc8c3 - added change log for MR 1148 (Refactor python package installation)

    Compare with previous version

  • Santiago Ospina De Los Ríos marked the checklist item Add CHANGELOG entry as completed

    marked the checklist item Add CHANGELOG entry as completed

  • resolved all threads

  • Andreas Dedner added 23 commits

    added 23 commits

    • 404fc8c3...757631ef - 11 commits from branch master
    • 589e3304 - Allow processes to be executed on other directories
    • 0d07444f - Move mpi4py dependency to python configuration file
    • 3d9a7f9c - Use relative paths on pip installation
    • 162b2259 - Split python install package into smaller functions
    • 2fe64d70 - [try] upgrade to a suitable version of setuptools
    • a8bf2a0a - add back into dune.module
    • c02bb7d1 - Improve documentation and readability
    • 16918949 - avoid fatal error on venv configuration error
    • 03767dfa - Apply changes of feature/pip-editable-in-configure.
    • c0c6615a - Document deprecated function
    • 088ef61a - Return error code from python package installation
    • 8ced750a - added change log for MR 1148 (Refactor python package installation)

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading