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 924b175
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
7 changes: 2 additions & 5 deletions tutorpicasso/commands/enable_private_packages.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import os
import subprocess

from typing import Any, Dict
from packaging.version import Version

import click
from packaging.version import Version
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 +24,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 @@ -5,7 +5,9 @@

import click
import importlib_resources
from packaging.version import Version
from tutor import hooks
from tutor.__about__ import __version__ as tutor_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 924b175

Please sign in to comment.