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

FIX: fix path suffix condition in core/read.py #641

Merged
merged 6 commits into from
Nov 12, 2024

Conversation

je-cook
Copy link
Contributor

@je-cook je-cook commented Oct 7, 2024

In #620 the path suffix operation was updated to fix a warning in sphinx 8. The effect was to only check the last suffix instead of all suffixes as was previously achieved. For a filename my_example.ex.py and a custom extension of '.ex.py' the old value of path.endswith(suffix) would be true whereas Path.suffix only returns '.py' therefore will return false here:

if Path(path).suffix == suffix:

I've added a test for this but I needed to do quite a bit of playing to get past some of the eccentricities of the test suite. let me know if I need to change anything

The reason for all of this on my end is to distinguish which files I want converted and not all python files in a given directory. For reference see where we do this

https://github.com/Fusion-Power-Plant-Framework/bluemira/blob/develop/documentation/source/conf.py#L130-L135

@agoose77 agoose77 changed the title Fix path suffix condition in core/read.py FIX: fix path suffix condition in core/read.py Oct 7, 2024
@bsipocz bsipocz added the bug Something isn't working label Nov 12, 2024
Copy link
Collaborator

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

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

Thank you @je-cook and I'm sorry for introducing this regression the first place.

@bsipocz bsipocz merged commit 72b415f into executablebooks:master Nov 12, 2024
14 checks passed
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
None yet
Development

Successfully merging this pull request may close these issues.

2 participants