[+] improve modules support
This commit is contained in:
parent
3459ee237e
commit
3d023ceba3
@ -481,7 +481,7 @@ class CLI(abc.ABC):
|
||||
def venv_compile(
|
||||
self,
|
||||
project_name: str,
|
||||
force: bool,
|
||||
# force: bool,
|
||||
argv: Optional[list[str]] = None,
|
||||
) -> None:
|
||||
from . import cli_bootstrap
|
||||
@ -549,3 +549,46 @@ class CLI(abc.ABC):
|
||||
project.source_dir / 'requirements.in',
|
||||
'-o', project.source_dir / 'requirements.txt',
|
||||
])
|
||||
|
||||
def module_switch(
|
||||
self,
|
||||
project_name: str,
|
||||
# force: bool,
|
||||
argv: Optional[list[str]] = None,
|
||||
) -> None:
|
||||
from . import cli_bootstrap
|
||||
from . import argparse as pr34_argparse
|
||||
|
||||
project = self.projects[project_name]
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument(
|
||||
'-m',
|
||||
dest='module',
|
||||
choices=[
|
||||
o.name
|
||||
for o in project.modules
|
||||
],
|
||||
required=True,
|
||||
# type=pathlib.Path,
|
||||
type=str,
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
'-f',
|
||||
dest='file',
|
||||
default='pyproject.common.toml',
|
||||
default=[],
|
||||
# type=pathlib.Path,
|
||||
type=pathlib.Path,
|
||||
)
|
||||
|
||||
options, args = pr34_argparse.parse_args(
|
||||
parser,
|
||||
argv,
|
||||
)
|
||||
|
||||
if not options.file.is_abs():
|
||||
options.file = project.source_dir / options.file
|
||||
|
||||
raise NotImplementedError
|
||||
|
Loading…
Reference in New Issue
Block a user