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

CI Failure: Black Formatting & TensorFlow Import Error #145

Open
jeipollack opened this issue Mar 3, 2025 · 2 comments
Open

CI Failure: Black Formatting & TensorFlow Import Error #145

jeipollack opened this issue Mar 3, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@jeipollack
Copy link
Contributor

Black Formatting Issues

The Black formatter reports that several files need reformatting, even after running black . locally. The relevant error from CI:

would reformat /github/workspace/src/wf_psf/training/train.py
would reformat /github/workspace/src/wf_psf/utils/ccd_missalignments.py
would reformat /github/workspace/src/wf_psf/utils/configs_handler.py

Oh no! 💥 💔 💥
3 files would be reformatted, 45 files would be left unchanged.

Steps Taken:

Ran black . locally, but CI still fails.

Going to check what version of black is used during GHA

TensorFlow Error

Another failure occurs when attempting to import TensorFlow in CI:

/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/tensorflow/python/eager/execute.py:23: in <module>
    from tensorflow.python.framework import dtypes
/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/tensorflow/python/framework/dtypes.py:29: in <module>
    _np_bfloat16 = _pywrap_bfloat16.TF_bfloat16_type()
E   TypeError: Unable to convert function return value to a Python type! The signature was
E    	() -> handle

Steps Taken:

Verified Python version in CI (3.10.16).

Confirmed TensorFlow installation locally and in requirements.txt.

Next Steps:

Test running the CI workflow with a different Python or TensorFlow version.

Verify if missing shared libraries (libtensorflow.so) might be the cause.

@jeipollack jeipollack added the bug Something isn't working label Mar 3, 2025
@jeipollack jeipollack self-assigned this Mar 3, 2025
@jeipollack
Copy link
Contributor Author

jeipollack commented Mar 3, 2025

Hi @sfarrens I have two CI bugs. One that involves the black and the other has to with tensorflow. Given that pytest-black is no longer maintained I am thinking to switch to ruff: https://docs.astral.sh/ruff/ . It encompasses both formatting and linting. It has to get done, so why not now? Do you think this is a bad idea?

p.s. this would be part of the PR I have set to draft.

p.s.s. I may also set up pre-commit hook which would run Ruff before every commit.

@jeipollack
Copy link
Contributor Author

After some investigation, I see that there are some unit tests that require an update due to changes in the configuration settings and handlers.

I am currently updating the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant