[+] add default third_party_roots
This commit is contained in:
parent
520ea4211a
commit
4474e08e10
@ -5,7 +5,7 @@ project(
|
||||
).stdout().strip('\n'),
|
||||
# 'online.fxreader.uv',
|
||||
# ['c', 'cpp'],
|
||||
version: '0.1.5.17+27.17',
|
||||
version: '0.1.5.17+27.18',
|
||||
# default_options: [
|
||||
# 'cpp_std=c++23',
|
||||
# # 'prefer_static=true',
|
||||
|
@ -561,7 +561,30 @@ class CLI(abc.ABC):
|
||||
self,
|
||||
project_name: Optional[str] = None,
|
||||
) -> list[pathlib.Path]:
|
||||
return []
|
||||
from . import cli_bootstrap
|
||||
from .pip import pip_show
|
||||
|
||||
res: list[pathlib.Path] = []
|
||||
|
||||
if not project_name is None:
|
||||
pyproject = cli_bootstrap.pyproject_load(self.projects[project_name].source_dir / 'pyproject.toml')
|
||||
|
||||
for third_party_root in pyproject.third_party_roots:
|
||||
if third_party_root.package:
|
||||
if not third_party_root.module_root:
|
||||
third_party_root.module_root = third_party_root.package.replace('.', os.path.sep)
|
||||
if not third_party_root.path:
|
||||
packages = pip_show([third_party_root.package])
|
||||
assert len(packages) == 1
|
||||
third_party_root.path = str(pathlib.Path(packages[0].location) / third_party_root.module_root / 'lib')
|
||||
else:
|
||||
assert not third_party_root.package and not third_party_root.module_root and third_party_root.path
|
||||
|
||||
res.append(pathlib.Path(third_party_root.path))
|
||||
|
||||
# res.append(self.projects[project_name].dest_dir / 'lib')
|
||||
|
||||
return res
|
||||
|
||||
class meson_toolchains_t:
|
||||
class res_t:
|
||||
|
@ -68,7 +68,14 @@ class PyProject:
|
||||
pip_find_links: Optional[list[pathlib.Path]] = None
|
||||
runtime_libdirs: Optional[list[pathlib.Path]] = None
|
||||
runtime_preload: Optional[list[pathlib.Path]] = None
|
||||
third_party_roots: list[str] = dataclasses.field(
|
||||
|
||||
@dataclasses.dataclass
|
||||
class ThirdPartyRoot:
|
||||
package: Optional[str] = None
|
||||
module_root: Optional[str] = None
|
||||
path: Optional[str] = None
|
||||
|
||||
third_party_roots: list[ThirdPartyRoot] = dataclasses.field(
|
||||
default_factory=lambda: [],
|
||||
)
|
||||
requirements: dict[str, pathlib.Path] = dataclasses.field(default_factory=lambda: dict())
|
||||
@ -241,11 +248,17 @@ def pyproject_load(
|
||||
]
|
||||
|
||||
if 'third_party_roots' in pr34_tool:
|
||||
res.third_party_roots = [
|
||||
o
|
||||
# pathlib.Path(o)
|
||||
for o in check_list(pr34_tool['third_party_roots'], str)
|
||||
]
|
||||
for o in check_list(pr34_tool['third_party_roots']):
|
||||
o2 = check_dict(o, str, str)
|
||||
assert all([k in {'package', 'module_root', 'path'} for k in o2])
|
||||
|
||||
res.third_party_roots.append(
|
||||
PyProject.ThirdPartyRoot(
|
||||
package=o2.get('package'),
|
||||
module_root=o2.get('module_root'),
|
||||
path=o2.get('path'),
|
||||
)
|
||||
)
|
||||
|
||||
if 'requirements' in pr34_tool:
|
||||
res.requirements = {
|
||||
|
BIN
releases/whl/online_fxreader_pr34-0.1.5.17+27.18-py3-none-any.whl
(Stored with Git LFS)
Normal file
BIN
releases/whl/online_fxreader_pr34-0.1.5.17+27.18-py3-none-any.whl
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user