Skip to content

chore: Update error handling of unsupported FluentVersions in get_fluent_version.#5012

Merged
prmukherj merged 9 commits intomainfrom
maint/update_error_handling_for_get_fluent_exe_path
Mar 27, 2026
Merged

chore: Update error handling of unsupported FluentVersions in get_fluent_version.#5012
prmukherj merged 9 commits intomainfrom
maint/update_error_handling_for_get_fluent_exe_path

Conversation

@prmukherj
Copy link
Copy Markdown
Collaborator

@prmukherj prmukherj commented Mar 24, 2026

Context

There was a low level key error raised from this method that was percolating elsewhere to the user of this code.

Change Summary

Properly documented "FileNotFoundError" is raised now.

Impact

It gives user of this method a proper error when the particular Fluent installation is not found. Test has been added for the same.

@github-actions github-actions bot added the enhancement Improve any current implemented feature label Mar 24, 2026
@prmukherj prmukherj linked an issue Mar 24, 2026 that may be closed by this pull request
2 tasks
@prmukherj prmukherj changed the title chore: Update error handling of unsupported FluentVersions in get_flu… chore: Update error handling of unsupported FluentVersions in get_fluent_version. Mar 26, 2026
@prmukherj prmukherj marked this pull request as ready for review March 26, 2026 11:58
@prmukherj prmukherj requested a review from mkundu1 as a code owner March 26, 2026 11:58
Copilot AI review requested due to automatic review settings March 26, 2026 11:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the developer/user-facing error behavior when resolving a Fluent executable path from an AWP_ROOTnnn environment variable by replacing a low-level KeyError with a clearer FileNotFoundError, and adds a regression test to cover the missing-env-var case.

Changes:

  • Raise a FileNotFoundError with a descriptive message when FluentVersion.get_fluent_exe_path() is called and the corresponding AWP_ROOTnnn environment variable is not set.
  • Add a unit test verifying the new exception type/message behavior.
  • Add a maintenance changelog entry (currently phrased inconsistently with the actual change).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/ansys/fluent/core/utils/fluent_version.py Switches env var lookup from os.environ[...] to os.getenv(...) and raises FileNotFoundError when missing.
tests/test_fluent_version.py Adds coverage for the missing AWP_ROOTnnn env var case.
doc/changelog.d/5012.maintenance.md Documents the change (but currently references the wrong API/behavior).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 14:31
@prmukherj prmukherj marked this pull request as draft March 26, 2026 14:35
@prmukherj prmukherj review requested due to automatic review settings March 26, 2026 14:35
@prmukherj prmukherj marked this pull request as ready for review March 26, 2026 14:45
Copilot AI review requested due to automatic review settings March 26, 2026 14:45
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 26, 2026 14:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@hpohekar
Copy link
Copy Markdown
Collaborator

Looks good.

Copilot AI review requested due to automatic review settings March 27, 2026 10:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@prmukherj prmukherj merged commit 480a116 into main Mar 27, 2026
39 checks passed
@prmukherj prmukherj deleted the maint/update_error_handling_for_get_fluent_exe_path branch March 27, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Improve any current implemented feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyError: 'AWP_ROOT252' - Pyansys Cannot Detect Installed Fluent 24R2 (v242)

6 participants