-
Notifications
You must be signed in to change notification settings - Fork 15
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
Install python virtual environment with contributed ruamel.yaml #39
Conversation
It looks like we need to support CMake 3.18 |
cmake/fckit_install_venv.cmake
Outdated
set( Python3_FIND_VIRTUALENV STANDARD ) | ||
find_package( Python3 COMPONENTS Interpreter REQUIRED ) | ||
|
||
# Create a loki virtualenv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Create a loki virtualenv | |
# Create a virtualenv |
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 gnu@ubuntu-22.04 tests. This runner seems to have a very barebones python installation:
I think to fix this error we will have to update to the runner config. |
93422d8
to
7ebddc8
Compare
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice improvements! Just a few minor edits requested.
cmake/fckit_install_venv.cmake
Outdated
|
||
# Create a virtualenv | ||
set( VENV_PATH ${CMAKE_CURRENT_BINARY_DIR}/fckit_venv ) | ||
message( STATUS "Create Python virtual environment ${VENV_PATH}" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use ecbuild_info()
here and below for logging.
cmake/fckit_install_venv.cmake
Outdated
@@ -0,0 +1,68 @@ | |||
# (C) Copyright 2013 ECMWF. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# (C) Copyright 2013 ECMWF. | |
# (C) Copyright 2024 ECMWF. |
src/tests/test_yaml_reader.py
Outdated
@@ -0,0 +1,72 @@ | |||
#!/usr/bin/env python3 | |||
|
|||
# (C) Copyright 2013 ECMWF. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# (C) Copyright 2013 ECMWF. | |
# (C) Copyright 2024 ECMWF. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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 ☔ View full report in Codecov by Sentry. |
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 pyyamlyaml.safe_load
andyaml.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.