[+] update module_switch
1. allow per module tool array; 2. partially fix deploy:wheel;
This commit is contained in:
parent
0166dc4756
commit
9a12e71493
@ -27,6 +27,7 @@ class Command(enum.StrEnum):
|
|||||||
mypy = 'mypy'
|
mypy = 'mypy'
|
||||||
deploy_wheel = 'deploy:wheel'
|
deploy_wheel = 'deploy:wheel'
|
||||||
tests = 'tests'
|
tests = 'tests'
|
||||||
|
meson_setup = 'meson:setup'
|
||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
class Settings(
|
class Settings(
|
||||||
@ -143,6 +144,14 @@ class CLI(_cli.CLI):
|
|||||||
output_dir=options.output_dir,
|
output_dir=options.output_dir,
|
||||||
mypy=True,
|
mypy=True,
|
||||||
)
|
)
|
||||||
|
elif options.command is Command.meson_setup:
|
||||||
|
assert not options.project is None
|
||||||
|
|
||||||
|
self.meson_setup(
|
||||||
|
project_name=options.project,
|
||||||
|
argv=args,
|
||||||
|
force=options.force,
|
||||||
|
)
|
||||||
elif options.command is Command.mypy:
|
elif options.command is Command.mypy:
|
||||||
self.mypy(
|
self.mypy(
|
||||||
argv=args,
|
argv=args,
|
||||||
|
@ -5,7 +5,7 @@ project(
|
|||||||
).stdout().strip('\n'),
|
).stdout().strip('\n'),
|
||||||
# 'online.fxreader.uv',
|
# 'online.fxreader.uv',
|
||||||
# ['c', 'cpp'],
|
# ['c', 'cpp'],
|
||||||
version: '0.1.5.16+27.7',
|
version: '0.1.5.16+27.8',
|
||||||
# default_options: [
|
# default_options: [
|
||||||
# 'cpp_std=c++23',
|
# 'cpp_std=c++23',
|
||||||
# # 'prefer_static=true',
|
# # 'prefer_static=true',
|
||||||
|
2
python/meson_options.txt
Normal file
2
python/meson_options.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
option('modes', type: 'array', choices: ['meson', 'pyproject'], value: ['pyproject'])
|
||||||
|
option('install_path', type : 'string', value: '')
|
@ -624,7 +624,16 @@ class CLI(abc.ABC):
|
|||||||
assert isinstance(p, tomlkit.items.Table)
|
assert isinstance(p, tomlkit.items.Table)
|
||||||
p['name'] = module.name
|
p['name'] = module.name
|
||||||
|
|
||||||
|
if not pyproject2['tool']:
|
||||||
|
pyproject2['tool'] = []
|
||||||
|
|
||||||
|
pyproject_tool = pyproject2['tool']
|
||||||
|
assert isinstance(pyproject_tool, tomlkit.items.Array)
|
||||||
|
|
||||||
|
pyproject_tool.extend(module.tool)
|
||||||
|
|
||||||
del p
|
del p
|
||||||
|
del pyproject_tool
|
||||||
|
|
||||||
tomlkit.dump(
|
tomlkit.dump(
|
||||||
pyproject2,
|
pyproject2,
|
||||||
|
@ -39,7 +39,7 @@ class PyProject:
|
|||||||
class Module:
|
class Module:
|
||||||
name: str
|
name: str
|
||||||
meson: Optional[pathlib.Path] = None
|
meson: Optional[pathlib.Path] = None
|
||||||
|
tool: list[Any] = dataclasses.field(default_factory=lambda : [])
|
||||||
|
|
||||||
path: pathlib.Path
|
path: pathlib.Path
|
||||||
dependencies: dict[str, list[str]]
|
dependencies: dict[str, list[str]]
|
||||||
@ -149,6 +149,11 @@ def pyproject_load(
|
|||||||
|
|
||||||
module.meson = pathlib.Path(o['meson'])
|
module.meson = pathlib.Path(o['meson'])
|
||||||
|
|
||||||
|
if 'tool' in o:
|
||||||
|
assert isinstance(o['tool'], list)
|
||||||
|
|
||||||
|
module.tool.extend(o['tool'])
|
||||||
|
|
||||||
res.modules.append(module)
|
res.modules.append(module)
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
Loading…
Reference in New Issue
Block a user