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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants