cmeel 0.54.2__py3-none-any.whl → 0.55.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of cmeel might be problematic. Click here for more details.
- cmeel/config.py +17 -14
- {cmeel-0.54.2.dist-info → cmeel-0.55.0.dist-info}/METADATA +1 -1
- {cmeel-0.54.2.dist-info → cmeel-0.55.0.dist-info}/RECORD +6 -6
- {cmeel-0.54.2.dist-info → cmeel-0.55.0.dist-info}/WHEEL +0 -0
- {cmeel-0.54.2.dist-info → cmeel-0.55.0.dist-info}/entry_points.txt +0 -0
- {cmeel-0.54.2.dist-info → cmeel-0.55.0.dist-info}/licenses/LICENSE +0 -0
cmeel/config.py
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Parse various configuration files and environment variables.
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
-
import os
|
|
7
6
|
import sys
|
|
7
|
+
from os import environ, pathsep
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
from tempfile import TemporaryDirectory
|
|
10
10
|
from typing import Any, Dict, List, Optional, Union
|
|
@@ -15,6 +15,7 @@ except ModuleNotFoundError:
|
|
|
15
15
|
import tomli as tomllib # type: ignore
|
|
16
16
|
|
|
17
17
|
from .consts import CMEEL_PREFIX, SITELIB
|
|
18
|
+
from .env import get_paths
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
class CmeelConfig:
|
|
@@ -23,7 +24,7 @@ class CmeelConfig:
|
|
|
23
24
|
def __init__(self) -> None:
|
|
24
25
|
"""Get config variables from environment, local, and global config files."""
|
|
25
26
|
config_home = Path("~/.config").expanduser()
|
|
26
|
-
config_home = Path(
|
|
27
|
+
config_home = Path(environ.get("XDG_CONFIG_HOME", config_home))
|
|
27
28
|
config_path = config_home / "cmeel"
|
|
28
29
|
config_file = config_path / "cmeel.toml"
|
|
29
30
|
|
|
@@ -32,9 +33,9 @@ class CmeelConfig:
|
|
|
32
33
|
with config_file.open("rb") as f:
|
|
33
34
|
self.conf = tomllib.load(f)
|
|
34
35
|
if self.conf.get("default-env", True):
|
|
35
|
-
self.env =
|
|
36
|
+
self.env = environ.copy()
|
|
36
37
|
else:
|
|
37
|
-
self.env = {p:
|
|
38
|
+
self.env = {p: environ[p] for p in ["PATH", "PYTHONPATH"]}
|
|
38
39
|
self.jobs = int(self.conf.get("jobs", self.env.get("CMEEL_JOBS", "4")))
|
|
39
40
|
self.test_jobs = self.conf.get(
|
|
40
41
|
"test-jobs",
|
|
@@ -90,22 +91,24 @@ class CmeelConfig:
|
|
|
90
91
|
available = self._get_available_prefix()
|
|
91
92
|
if available:
|
|
92
93
|
cpp = ret.get("CMAKE_PREFIX_PATH", "")
|
|
93
|
-
if str(available) not in cpp.split(
|
|
94
|
-
ret["CMAKE_PREFIX_PATH"] = f"{available}
|
|
94
|
+
if str(available) not in cpp.split(pathsep):
|
|
95
|
+
ret["CMAKE_PREFIX_PATH"] = f"{available}{pathsep}{cpp}".strip(pathsep)
|
|
95
96
|
pcp = ret.get("PKG_CONFIG_PATH", "")
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
pcp = f"{spcp}:{pcp}"
|
|
102
|
-
ret["PKG_CONFIG_PATH"] = pcp.strip(":")
|
|
97
|
+
for subdir in ("lib", "share"):
|
|
98
|
+
lpcp = available / subdir / "pkgconfig"
|
|
99
|
+
if lpcp.is_dir() and str(lpcp) not in pcp.split(pathsep):
|
|
100
|
+
pcp = f"{lpcp}{pathsep}{pcp}"
|
|
101
|
+
ret["PKG_CONFIG_PATH"] = pcp.strip(pathsep)
|
|
103
102
|
return ret
|
|
104
103
|
|
|
105
104
|
def get_test_env(self) -> Dict[str, str]:
|
|
106
105
|
"""Get test environment."""
|
|
107
106
|
ret = self.env.copy()
|
|
108
|
-
ret.update(
|
|
107
|
+
ret.update(
|
|
108
|
+
CTEST_OUTPUT_ON_FAILURE="1",
|
|
109
|
+
CTEST_PARALLEL_LEVEL=self.test_jobs,
|
|
110
|
+
LD_LIBRARY_PATH=get_paths("lib"),
|
|
111
|
+
)
|
|
109
112
|
return ret
|
|
110
113
|
|
|
111
114
|
def _get_available_prefix(self) -> Optional[Path]:
|
|
@@ -5,7 +5,7 @@ cmeel/__main__.py,sha256=gLQ5_di07raiL6u75jpE36QydXlsbBzSdff9mVKtbg4,2042
|
|
|
5
5
|
cmeel/backports.py,sha256=ZJ34NDWgrlrSkq8AGrKof9SQexQH8sver2HmJIur80c,1473
|
|
6
6
|
cmeel/build.py,sha256=iYcKI1CCiRry2ESee1gUrL71N8-6rC_yie97hCfKgz0,867
|
|
7
7
|
cmeel/cmeel.py,sha256=inrhra_VOA0005ExK4oFNX4EWljbgS4pnx6S0dkvxoA,249
|
|
8
|
-
cmeel/config.py,sha256=
|
|
8
|
+
cmeel/config.py,sha256=sdELrlIzhND4KcxSaEUTdxxJWX3cF_J35jTCd9YmRRw,4107
|
|
9
9
|
cmeel/consts.py,sha256=ol8loHUtvIkuINu4Go5ko7Sfkb7Ht9XBjjmPP-Sjcoo,252
|
|
10
10
|
cmeel/docker.py,sha256=wT-VZuGKj1wcdldwgsYcWmJK_rjo2Eh1USEDMOmlsBU,2775
|
|
11
11
|
cmeel/env.py,sha256=4AymbjlT3iNqYeeI70u3ZQMpiQfYo2vbNoZ4F15QbYQ,1235
|
|
@@ -15,8 +15,8 @@ cmeel/release.py,sha256=svN_mQwu9HeKTF3517zNd0XPkbZeNS21aps6NiW-e7A,1357
|
|
|
15
15
|
cmeel/run.py,sha256=AaXiEvM7DhI0gbAzjBmBKt7KoHRAD8jrxWRghxXmeec,744
|
|
16
16
|
cmeel/sdist.py,sha256=DA5h9IrQfhuoQucYfv73S8jpKNY2ThfIrVSKSvsJ5ec,1961
|
|
17
17
|
cmeel/utils.py,sha256=1q-iQdhxNXluQoUPME1k34YClFUQ4KSwMcIHpREYHEY,8114
|
|
18
|
-
cmeel-0.
|
|
19
|
-
cmeel-0.
|
|
20
|
-
cmeel-0.
|
|
21
|
-
cmeel-0.
|
|
22
|
-
cmeel-0.
|
|
18
|
+
cmeel-0.55.0.dist-info/METADATA,sha256=kqn21BGzeTJQoJ3PviM9U1WLlAZTvVyrizi_oOKQCK0,4818
|
|
19
|
+
cmeel-0.55.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
20
|
+
cmeel-0.55.0.dist-info/entry_points.txt,sha256=xtIRc5QUYVGuGehxx2BrMEs3qoQ44cXF7D96_tfpZDM,46
|
|
21
|
+
cmeel-0.55.0.dist-info/licenses/LICENSE,sha256=4QHEuqIDbscybBc21CcazwRjix-rV-AH2QAZ4IqxlzQ,1324
|
|
22
|
+
cmeel-0.55.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|