Skip to content

Commit

Permalink
Ensure gFTL is installed with Pyccel (#1809)
Browse files Browse the repository at this point in the history
- Add `https://github.com/Goddard-Fortran-Ecosystem/gFTL` as a git
submodule.
- Update the `pyproject.toml` file to include essential files from gFTL.
- Implement a GitHub Action in `check_for_gftl` to verify gFTL
installation.

This fixes #1656.

---------

Co-authored-by: Yaman Güçlü <yaman.guclu@gmail.com>
  • Loading branch information
mustapha-belbiad and yguclu committed Apr 17, 2024
1 parent 78d56de commit c5b7e3e
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 9 deletions.
19 changes: 19 additions & 0 deletions .github/actions/check_for_gftl/action.yml
@@ -0,0 +1,19 @@
name: 'Ensure gFTL is installed with Pyccel'
inputs:
not_editable:
description: 'not_editable installation'
default: 'True'
runs:
using: "composite"
steps:
- name: check gFTL installation
shell: python
run: |
import pyccel
from os.path import exists, join
pyccel_loc = pyccel.__path__[0]
print(pyccel_loc)
assert exists(join(pyccel_loc,'extensions/gFTL/include/v2'))
if ${{ inputs.not_editable }}:
assert not exists(join(pyccel_loc,'extensions/gFTL/doc'))
5 changes: 3 additions & 2 deletions .github/actions/check_for_stc/action.yml
Expand Up @@ -14,6 +14,7 @@ runs:
pyccel_loc = pyccel.__path__[0]
print(pyccel_loc)
print("${{ inputs.not_editable }}")
assert(exists(join(pyccel_loc,'extensions/STC/include/stc')))
assert exists(join(pyccel_loc,'extensions/STC/include/stc'))
if ${{ inputs.not_editable }}:
assert(not exists(join(pyccel_loc,'extensions/STC/docs')))
assert not exists(join(pyccel_loc,'extensions/STC/docs'))
9 changes: 7 additions & 2 deletions .github/workflows/pickle.yml
Expand Up @@ -93,8 +93,13 @@ jobs:
uses: ./.github/actions/check_for_stc
with:
not_editable: "${{ matrix.editable_string == '-e' && 'False' || 'True'}}"
- name: Check for gFTL installation
id: gFTL_check
uses: ./.github/actions/check_for_gftl
with:
not_editable: "${{ matrix.editable_string == '-e' && 'False' || 'True' }}"
- name: "Post completed"
if: always()
run: |
python ci_tools/basic_json_check_output.py --statuses ${{ steps.pickle.outcome }} ${{ steps.pickle_check.outcome }} ${{ steps.stc_check.outcome }} --reasons "Installation failed." "Pickled files were not found in installaion." "STC was not found during installation."
python ci_tools/complete_check_run.py ${{ steps.pickle.outcome }} ${{ steps.pickle_check.outcome }} ${{ steps.stc_check.outcome }}
python ci_tools/basic_json_check_output.py --statuses ${{ steps.pickle.outcome }} ${{ steps.pickle_check.outcome }} ${{ steps.stc_check.outcome }} ${{ steps.gFTL_check.outcome}} --reasons "Installation failed." "Pickled files were not found in installaion." "STC was not found during installation." "gFTL was not found during installation."
python ci_tools/complete_check_run.py ${{ steps.pickle.outcome }} ${{ steps.pickle_check.outcome }} ${{ steps.stc_check.outcome }} ${{ steps.gFTL_check.outcome}}
7 changes: 5 additions & 2 deletions .github/workflows/pickle_wheel.yml
Expand Up @@ -82,8 +82,11 @@ jobs:
- name: Check for STC installation
id: stc_check
uses: ./.github/actions/check_for_stc
- name: Check for gFTL installation
id: gFTL_check
uses: ./.github/actions/check_for_gftl
- name: "Post completed"
if: always()
run: |
python ci_tools/basic_json_check_output.py --statuses ${{ steps.pickle.outcome }} ${{ steps.pickle_check.outcome }} ${{ steps.stc_check.outcome }} --reasons "Installation failed." "Pickled files were not found in installaion." "STC was not found during installation."
python ci_tools/complete_check_run.py ${{ steps.pickle.outcome }} ${{ steps.pickle_check.outcome }} ${{ steps.stc_check.outcome }}
python ci_tools/basic_json_check_output.py --statuses ${{ steps.pickle.outcome }} ${{ steps.pickle_check.outcome }} ${{ steps.stc_check.outcome }} ${{ steps.gFTL_check.outcome}} --reasons "Installation failed." "Pickled files were not found in installaion." "STC was not found during installation." "gFTL was not found during installation."
python ci_tools/complete_check_run.py ${{ steps.pickle.outcome }} ${{ steps.pickle_check.outcome }} ${{ steps.stc_check.outcome }} ${{ steps.gFTL_check.outcome}}
3 changes: 3 additions & 0 deletions .gitmodules
@@ -1,3 +1,6 @@
[submodule "pyccel/extensions/STC"]
path = pyccel/extensions/STC
url = https://github.com/Stclib/STC/
[submodule "pyccel/extensions/gFTL"]
path = pyccel/extensions/gFTL
url = https://github.com/Goddard-Fortran-Ecosystem/gFTL
3 changes: 2 additions & 1 deletion CHANGELOG.md
Expand Up @@ -12,8 +12,9 @@ All notable changes to this project will be documented in this file.
- #1739 : Add Python support for set method `clear()`.
- #1740 : Add Python support for set method `copy()`.
- #1750 : Add Python support for set method `remove()`.
- #1787 : Ensure `STC` is installed with Pyccel.
- #1743 : Add Python support for set method `discard()`.
- #1787 : Ensure `STC` is installed with Pyccel.
- #1656 : Ensure `gFTL` is installed with Pyccel.
- #1830 : Add a `pyccel.lambdify.lambdify` function to accelerate SymPy expressions.
- \[INTERNALS\] Added `container_rank` property to `ast.datatypes.PyccelType` objects.
- \[DEVELOPER\] Added an improved traceback to the developer-mode errors for errors in function calls.
Expand Down
1 change: 1 addition & 0 deletions pyccel/extensions/gFTL
Submodule gFTL added at 536770
4 changes: 2 additions & 2 deletions pyproject.toml
Expand Up @@ -50,15 +50,15 @@ artifacts = [
"*.pyccel",
]
include = [
"include",
"*.py",
"*.pyh",
"*.pyccel",
"pyccel/parser/grammar/*.tx",
"pyccel/stdlib/*/*.h",
"pyccel/stdlib/*/*.c",
"pyccel/stdlib/*/*.f90",
"pyccel/extensions/STC/include/*/*.c"
"pyccel/extensions/STC/include",
"pyccel/extensions/gFTL/include/v2"
]
exclude = [
"pyccel/extensions/STC/src",
Expand Down

0 comments on commit c5b7e3e

Please sign in to comment.