fckit icon indicating copy to clipboard operation
fckit copied to clipboard

Install python virtual environment with contributed ruamel.yaml

Open awnawab opened this issue 1 year ago • 3 comments

This PR contributes the installation of a python virtual environment that contains the contributed fypp and ruamel.yaml modules. A minimal fckit_yaml_reader module is also installed that creates an API consistent with the pyyaml yaml.safe_load and yaml.dump functions. The aim is to provide yaml parsing functionality for offline builds of the ifs-bundle and ecwam-bundle. Downstream projects will therefore rely on either pyyaml+fypp or fckit.

I have tested the fckit_yaml_reader with ecwam, as a bundle build and as an externally built or installed project. I have also run the downstream_fypp tests by compiling with eckit.

awnawab avatar May 06 '24 15:05 awnawab

It looks like we need to support CMake 3.18

wdeconinck avatar May 06 '24 15:05 wdeconinck

I've downgraded the minimum cmake to 3.17 and the minimum python to 3.6. This should fix the tests for everything except for the ubuntu [email protected] tests. This runner seems to have a very barebones python installation:

  The virtual environment was not created successfully because ensurepip is not
  available.  On Debian/Ubuntu systems, you need to install the python3-venv
  package using the following command.
  
      apt install python3.10-venv

I think to fix this error we will have to update to the runner config.

awnawab avatar May 06 '24 20:05 awnawab

As discussed offline, I've made the build and installation of the python virtual environment optional. This defaults to off, and if left disabled then we just install the fypp runner script like we used to.

The python virtual environment can only be enabled if python >= 3.8 is found. For most of the downstream tests this wasn't the case. The gnu@fedora-37 runners did however have a more up-to-date python installation. If possible, it would be great to configure these CI tests with the option -DENABLE_FCKIT_VENV=ON to have CI test coverage of the virtual environment.

awnawab avatar May 07 '24 13:05 awnawab

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 50.77%. Comparing base (f44d3f9) to head (a18d4f0). Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop      #39      +/-   ##
===========================================
- Coverage    53.34%   50.77%   -2.58%     
===========================================
  Files           54       55       +1     
  Lines         4508     4739     +231     
  Branches         0      450     +450     
===========================================
+ Hits          2405     2406       +1     
- Misses        2103     2333     +230     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jun 10 '24 09:06 codecov-commenter