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

Add back in explicit windows and mac testing #953

Draft
wants to merge 9 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/workflows/continuous-integration-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: [ubuntu-latest] #, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest, windows-latest]
fail-fast: False
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
10 changes: 5 additions & 5 deletions floris/type_dec.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,22 +163,22 @@ def convert_to_path(fn: str | Path) -> Path:
# located (e.g., testing via pytest), and [-1] is where a direct call to the function via an
# analysis script will be located (e.g., running an example).
base_fn_script = Path(inspect.stack()[-1].filename).resolve().parent
base_fn_sys = Path(inspect.stack()[1].filename).resolve().parent
# base_fn_sys = Path(inspect.stack()[1].filename).resolve().parent

if isinstance(fn, Path):
absolute_fn = fn.resolve()
relative_fn_script = (base_fn_script / fn).resolve()
relative_fn_sys = (base_fn_sys / fn).resolve()
# relative_fn_sys = (base_fn_sys / fn).resolve()
if absolute_fn.exists():
return absolute_fn
if relative_fn_script.exists():
return relative_fn_script
if relative_fn_sys.exists():
return relative_fn_sys
# if relative_fn_sys.exists():
# return relative_fn_sys
raise FileExistsError(
f"{fn} could not be found as either a\n"
f" - relative file path from a script: {relative_fn_script}\n"
f" - relative file path from a system location: {relative_fn_sys}\n"
# f" - relative file path from a system location: {relative_fn_sys}\n"
f" - or absolute file path: {absolute_fn}"
)
raise TypeError(f"The passed input: {fn} could not be converted to a pathlib.Path object")
Expand Down
4 changes: 2 additions & 2 deletions tests/type_dec_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ def test_numeric_dict_converter():
floris_numeric_dict_converter(test_dict)

def test_convert_to_path():
str_input = "../tests"
expected_path = (Path(__file__).parent / str_input).resolve()
str_input = Path(__file__)
expected_path = str_input.resolve()

# Test that a string works
test_str_input = convert_to_path(str_input)
Expand Down
Loading