Skip to content

Commit

Permalink
fix: add condition before MOUNTED_DIRECTORIES
Browse files Browse the repository at this point in the history
  • Loading branch information
MaferMazu committed Aug 16, 2024
1 parent 1a5d0b5 commit 8d842b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
4 changes: 1 addition & 3 deletions tutorpicasso/commands/enable_private_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import click
from tutor import config as tutor_config
from tutor.__about__ import __version__ as tutor_version


@click.command(name="enable-private-packages", help="Enable picasso private packages")
Expand All @@ -24,9 +25,6 @@ def enable_private_packages() -> None:
.decode("utf-8")
.strip()
)
tutor_version = (
subprocess.check_output("tutor --version", shell=True).decode("utf-8").strip()
).split()[-1]
tutor_version_obj = Version(tutor_version)
# Define Quince version as the method for installing private packages changes from this version
quince_version_obj = Version("v17.0.0")
Expand Down
17 changes: 12 additions & 5 deletions tutorpicasso/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import click
import importlib_resources
from tutor import hooks
from tutor.__about__ import __version__ as tutor_version
from packaging.version import Version

from tutorpicasso.commands.cli import picasso

Expand All @@ -14,11 +16,16 @@
########################################
# CONFIGURATION
########################################
hooks.Filters.MOUNTED_DIRECTORIES.add_items(
[
("openedx", r"eox-.*"),
]
)

# In the latest Palm version, Tutor introduces the MOUNTED_DIRECTORIES.
latest_palm_version = "16.1.8"
if Version(tutor_version) > Version(latest_palm_version):
hooks.Filters.MOUNTED_DIRECTORIES.add_items(
[
("openedx", r"eox-.*"),
]
)

hooks.Filters.CONFIG_DEFAULTS.add_items(
[
# Add your new settings that have default values here.
Expand Down

0 comments on commit 8d842b4

Please sign in to comment.