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

feat: adding step for importing library #353

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion build-wheelhouse/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,21 @@ runs:
run: |
python -m pip install ${{ env.install_target }}

- name: "Verify library is properly installed"
shell: bash
run: |
library_name=${{ inputs.library-name }}

library_name="${library_name//-/.}"
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if this will always work. 90% of the cases it will... but I'm guessing some will fail

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kind of agree.. but I cannot come up with something better 🤷🏻‍♂️

echo "Modified the library name for importing: '$library_name'"

if python -c "import $library_name"; then
echo "Python module '$library_name' successfully imported."
else
echo "Failed to import Python module '$library_name': Something went wrong."
exit 1
fi

- name: "Verify if importlib-metadata needs to be installed"
shell: bash
run: |
Expand All @@ -112,7 +127,8 @@ runs:
run: |
python -m pip install importlib-metadata

- name: "Verify library is properly installed and get its version number"

- name: "Get library version number"
shell: bash
run: |
library_name=${{ inputs.library-name }}
Expand Down
Loading