Skip to content

Commit

Permalink
remove depracated code paths (#2349)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam-D-Lewis authored Mar 19, 2024
1 parent c2528dd commit d698630
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
3 changes: 1 addition & 2 deletions src/_nebari/render.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from rich.table import Table

from _nebari.deprecate import DEPRECATED_FILE_PATHS
from _nebari.utils import is_relative_to
from nebari import hookspecs, schema


Expand Down Expand Up @@ -89,7 +88,7 @@ def render_template(
for path in deleted:
abs_path = (output_directory / path).resolve()

if not is_relative_to(abs_path, output_directory):
if not abs_path.is_relative_to(output_directory):
raise Exception(
f"[ERROR] SHOULD NOT HAPPEN filename was about to be deleted but path={abs_path} is outside of output_directory"
)
Expand Down
12 changes: 0 additions & 12 deletions src/_nebari/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,18 +268,6 @@ def random_secure_string(
return "".join(secrets.choice(chars) for i in range(length))


def is_relative_to(self: Path, other: Path, /) -> bool:
"""Compatibility function to bring ``Path.is_relative_to`` to Python 3.8"""
if sys.version_info[:2] >= (3, 9):
return self.is_relative_to(other)

try:
self.relative_to(other)
return True
except ValueError:
return False


def set_do_environment():
os.environ["AWS_ACCESS_KEY_ID"] = os.environ["SPACES_ACCESS_KEY_ID"]
os.environ["AWS_SECRET_ACCESS_KEY"] = os.environ["SPACES_SECRET_ACCESS_KEY"]
Expand Down

0 comments on commit d698630

Please sign in to comment.