omdev 0.0.0.dev203__py3-none-any.whl → 0.0.0.dev205__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- omdev/.manifests.json +14 -14
- omdev/amalg/__main__.py +1 -1
- omdev/cache/data/cache.py +2 -5
- omdev/cache/data/specs.py +1 -1
- omdev/cc/__init__.py +0 -0
- omdev/cc/__main__.py +11 -0
- omdev/cc/cli.py +143 -0
- omdev/cexts/cmake.py +12 -4
- omdev/cli/clicli.py +18 -0
- omdev/git/{subtrees.py → shallow.py} +18 -17
- omdev/pyproject/resources/python.sh +5 -2
- {omdev-0.0.0.dev203.dist-info → omdev-0.0.0.dev205.dist-info}/METADATA +2 -2
- {omdev-0.0.0.dev203.dist-info → omdev-0.0.0.dev205.dist-info}/RECORD +17 -15
- omdev/tools/cc.py +0 -81
- {omdev-0.0.0.dev203.dist-info → omdev-0.0.0.dev205.dist-info}/LICENSE +0 -0
- {omdev-0.0.0.dev203.dist-info → omdev-0.0.0.dev205.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev203.dist-info → omdev-0.0.0.dev205.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev203.dist-info → omdev-0.0.0.dev205.dist-info}/top_level.txt +0 -0
omdev/.manifests.json
CHANGED
@@ -23,11 +23,23 @@
|
|
23
23
|
}
|
24
24
|
}
|
25
25
|
},
|
26
|
+
{
|
27
|
+
"module": ".cc.__main__",
|
28
|
+
"attr": "_CLI_MODULE",
|
29
|
+
"file": "omdev/cc/__main__.py",
|
30
|
+
"line": 4,
|
31
|
+
"value": {
|
32
|
+
"$.cli.types.CliModule": {
|
33
|
+
"cmd_name": "cc",
|
34
|
+
"mod_name": "omdev.cc.__main__"
|
35
|
+
}
|
36
|
+
}
|
37
|
+
},
|
26
38
|
{
|
27
39
|
"module": ".cexts.cmake",
|
28
40
|
"attr": "_CLI_MODULE",
|
29
41
|
"file": "omdev/cexts/cmake.py",
|
30
|
-
"line":
|
42
|
+
"line": 331,
|
31
43
|
"value": {
|
32
44
|
"$.cli.types.CliModule": {
|
33
45
|
"cmd_name": "cmake",
|
@@ -51,7 +63,7 @@
|
|
51
63
|
"module": ".cli.clicli",
|
52
64
|
"attr": "_CLI_MODULE",
|
53
65
|
"file": "omdev/cli/clicli.py",
|
54
|
-
"line":
|
66
|
+
"line": 156,
|
55
67
|
"value": {
|
56
68
|
"$.cli.types.CliModule": {
|
57
69
|
"cmd_name": "cli",
|
@@ -227,18 +239,6 @@
|
|
227
239
|
}
|
228
240
|
}
|
229
241
|
},
|
230
|
-
{
|
231
|
-
"module": ".tools.cc",
|
232
|
-
"attr": "_CLI_MODULE",
|
233
|
-
"file": "omdev/tools/cc.py",
|
234
|
-
"line": 76,
|
235
|
-
"value": {
|
236
|
-
"$.cli.types.CliModule": {
|
237
|
-
"cmd_name": "cc",
|
238
|
-
"mod_name": "omdev.tools.cc"
|
239
|
-
}
|
240
|
-
}
|
241
|
-
},
|
242
242
|
{
|
243
243
|
"module": ".tools.cloc",
|
244
244
|
"attr": "_CLI_MODULE",
|
omdev/amalg/__main__.py
CHANGED
omdev/cache/data/cache.py
CHANGED
@@ -27,7 +27,7 @@ from omlish import marshal as msh
|
|
27
27
|
from omlish.formats import json
|
28
28
|
from omlish.os.files import touch
|
29
29
|
|
30
|
-
from ...git.
|
30
|
+
from ...git.shallow import git_shallow_clone
|
31
31
|
from .actions import Action
|
32
32
|
from .actions import ExtractAction
|
33
33
|
from .manifests import Manifest
|
@@ -141,14 +141,11 @@ class Cache:
|
|
141
141
|
self._fetch_url(url, os.path.join(data_dir, out_file))
|
142
142
|
|
143
143
|
elif isinstance(spec, GitSpec):
|
144
|
-
if not spec.subtrees:
|
145
|
-
raise NotImplementedError
|
146
|
-
|
147
144
|
tmp_dir = tempfile.mkdtemp()
|
148
145
|
|
149
146
|
log.info('Cloning git repo: %s -> %s', spec.url, tmp_dir)
|
150
147
|
|
151
|
-
|
148
|
+
git_shallow_clone(
|
152
149
|
base_dir=tmp_dir,
|
153
150
|
repo_url=spec.url,
|
154
151
|
repo_dir='data',
|
omdev/cache/data/specs.py
CHANGED
@@ -50,7 +50,7 @@ class GitSpec(Spec):
|
|
50
50
|
branch: str | None = dc.field(default=None, kw_only=True)
|
51
51
|
rev: str | None = dc.field(default=None, kw_only=True)
|
52
52
|
|
53
|
-
subtrees: ta.Sequence[str] = dc.xfield(default=None, kw_only=True, coerce=_maybe_sorted_strs)
|
53
|
+
subtrees: ta.Sequence[str] | None = dc.xfield(default=None, kw_only=True, coerce=_maybe_sorted_strs)
|
54
54
|
|
55
55
|
|
56
56
|
##
|
omdev/cc/__init__.py
ADDED
File without changes
|
omdev/cc/__main__.py
ADDED
omdev/cc/cli.py
ADDED
@@ -0,0 +1,143 @@
|
|
1
|
+
"""
|
2
|
+
//$(which true); exec om cc run "$0" "$@"
|
3
|
+
or
|
4
|
+
//usr/bin/true; exec om cc run "$0" "$@"
|
5
|
+
|
6
|
+
See: https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83a7aa4e2
|
7
|
+
|
8
|
+
==
|
9
|
+
|
10
|
+
Freestanding options:
|
11
|
+
|
12
|
+
//usr/bin/env clang++ -std=c++20 -o ${X=`mktemp`} "$0" && exec -a "$0" "$X" "$@"
|
13
|
+
//usr/bin/env clang++ -std=c++20 -o ${D=`mktemp -d`}/x "$0" && ${D}/x ${@:1}; R=$?; rm -rf ${D}; exit $R
|
14
|
+
//$(which true); clang++ -std=c++20 -o ${D=`mktemp -d`}/x ${0} && ${D}/x ${@:1}; R=${?}; rm -rf ${D}; exit ${R}
|
15
|
+
|
16
|
+
==
|
17
|
+
|
18
|
+
TODO:
|
19
|
+
- toplevel cc dir
|
20
|
+
- cext interop
|
21
|
+
- gen cmake
|
22
|
+
"""
|
23
|
+
import os
|
24
|
+
import shlex
|
25
|
+
import shutil
|
26
|
+
import subprocess
|
27
|
+
import tempfile
|
28
|
+
import typing as ta
|
29
|
+
|
30
|
+
from omlish import check
|
31
|
+
from omlish.argparse import all as ap
|
32
|
+
|
33
|
+
from .. import magic
|
34
|
+
from ..cache import data as dcache
|
35
|
+
|
36
|
+
|
37
|
+
class Cli(ap.Cli):
|
38
|
+
@ap.cmd(
|
39
|
+
ap.arg('--cwd'),
|
40
|
+
ap.arg('src-file'),
|
41
|
+
ap.arg('args', nargs=ap.REMAINDER),
|
42
|
+
)
|
43
|
+
def run(self) -> int:
|
44
|
+
src_file = self.args.src_file
|
45
|
+
|
46
|
+
#
|
47
|
+
|
48
|
+
with open(src_file) as f:
|
49
|
+
src = f.read()
|
50
|
+
|
51
|
+
src_magics = magic.find_magic( # noqa
|
52
|
+
magic.C_MAGIC_STYLE,
|
53
|
+
src.splitlines(),
|
54
|
+
file=src_file,
|
55
|
+
preparer=magic.json_magic_preparer,
|
56
|
+
)
|
57
|
+
|
58
|
+
include_dirs: list[str] = []
|
59
|
+
|
60
|
+
for src_magic in src_magics:
|
61
|
+
if src_magic.key == '@omlish-cdeps':
|
62
|
+
for dep in check.isinstance(src_magic.prepared, ta.Sequence):
|
63
|
+
dep_git = dep['git']
|
64
|
+
dep_spec = dcache.GitSpec(
|
65
|
+
url=dep_git['url'],
|
66
|
+
rev=dep_git['rev'],
|
67
|
+
subtrees=dep_git.get('subtrees'),
|
68
|
+
)
|
69
|
+
dep_dir = dcache.default().get(dep_spec)
|
70
|
+
for dep_inc in dep.get('include', []):
|
71
|
+
inc_dir = os.path.join(dep_dir, dep_inc)
|
72
|
+
check.state(os.path.isdir(inc_dir))
|
73
|
+
include_dirs.append(inc_dir)
|
74
|
+
|
75
|
+
else:
|
76
|
+
raise KeyError(src_magic.key)
|
77
|
+
|
78
|
+
#
|
79
|
+
|
80
|
+
src_file_name = os.path.basename(src_file)
|
81
|
+
|
82
|
+
sh_parts: list[str] = [
|
83
|
+
'clang++',
|
84
|
+
]
|
85
|
+
|
86
|
+
for inc_dir in include_dirs:
|
87
|
+
sh_parts.append(f'-I{shlex.quote(inc_dir)}')
|
88
|
+
|
89
|
+
if cflags := os.environ.get('CFLAGS'):
|
90
|
+
sh_parts.append(cflags) # Explicitly shell-unquoted
|
91
|
+
|
92
|
+
sh_parts.extend([
|
93
|
+
'-std=c++20',
|
94
|
+
shlex.quote(os.path.abspath(src_file)),
|
95
|
+
'-o',
|
96
|
+
shlex.quote(src_file_name),
|
97
|
+
])
|
98
|
+
|
99
|
+
#
|
100
|
+
|
101
|
+
tmp_dir = tempfile.mkdtemp()
|
102
|
+
try:
|
103
|
+
proc = subprocess.run( # noqa
|
104
|
+
' '.join(sh_parts),
|
105
|
+
cwd=tmp_dir,
|
106
|
+
shell=True,
|
107
|
+
check=False,
|
108
|
+
)
|
109
|
+
|
110
|
+
if rc := proc.returncode:
|
111
|
+
return rc
|
112
|
+
|
113
|
+
exe_file = os.path.join(tmp_dir, src_file_name)
|
114
|
+
check.state(os.path.isfile(exe_file))
|
115
|
+
|
116
|
+
proc = subprocess.run(
|
117
|
+
[
|
118
|
+
exe_file,
|
119
|
+
*self.args.args,
|
120
|
+
],
|
121
|
+
cwd=self.args.cwd,
|
122
|
+
check=False,
|
123
|
+
)
|
124
|
+
|
125
|
+
finally:
|
126
|
+
shutil.rmtree(tmp_dir)
|
127
|
+
|
128
|
+
return proc.returncode
|
129
|
+
|
130
|
+
# @ap.cmd(
|
131
|
+
# ap.arg('src-file', nargs='+'),
|
132
|
+
# )
|
133
|
+
# def add_shebang(self) -> None:
|
134
|
+
# # //$(which true); exec om cc run "$0" "$@"
|
135
|
+
# print(self.args.src_file)
|
136
|
+
|
137
|
+
|
138
|
+
def _main() -> None:
|
139
|
+
Cli().cli_run_and_exit()
|
140
|
+
|
141
|
+
|
142
|
+
if __name__ == '__main__':
|
143
|
+
_main()
|
omdev/cexts/cmake.py
CHANGED
@@ -7,14 +7,22 @@ TODO:
|
|
7
7
|
- symlink headers, included src files (hamt_impl, ...)
|
8
8
|
- point / copy output to dst dirs
|
9
9
|
- libs
|
10
|
-
- ..
|
11
|
-
- pybind
|
12
|
-
- catch2?
|
13
|
-
- json? https://github.com/nlohmann/json
|
14
10
|
- FindPackages? FetchContent? built_ext won't have that
|
15
11
|
- move omml git / data retriever stuff into omdev, get just the one header file from git via sha?
|
16
12
|
- support local built pys
|
17
13
|
|
14
|
+
Libs:
|
15
|
+
- py
|
16
|
+
- pybind https://github.com/pybind/pybind11
|
17
|
+
- nanobind https://github.com/wjakob/nanobind
|
18
|
+
- test
|
19
|
+
- catch2 https://github.com/catchorg/Catch2
|
20
|
+
- ut https://github.com/boost-ext/ut
|
21
|
+
- json
|
22
|
+
- nlohmann https://github.com/nlohmann/json
|
23
|
+
- log
|
24
|
+
- spdlog https://github.com/gabime/spdlog
|
25
|
+
|
18
26
|
==
|
19
27
|
|
20
28
|
Done:
|
omdev/cli/clicli.py
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
import inspect
|
2
2
|
import os
|
3
|
+
import subprocess
|
3
4
|
import sys
|
4
5
|
import typing as ta
|
5
6
|
import urllib.parse
|
6
7
|
import urllib.request
|
7
8
|
|
8
9
|
from omlish import __about__
|
10
|
+
from omlish import lang
|
9
11
|
from omlish.argparse import all as ap
|
10
12
|
|
11
13
|
from ..pip import get_root_dists
|
@@ -88,6 +90,22 @@ class CliCli(ap.Cli):
|
|
88
90
|
|
89
91
|
#
|
90
92
|
|
93
|
+
if lang.can_import('pip'):
|
94
|
+
print('Checking pip install')
|
95
|
+
subprocess.check_call([
|
96
|
+
sys.executable,
|
97
|
+
'-m',
|
98
|
+
'pip',
|
99
|
+
'install',
|
100
|
+
'--dry-run',
|
101
|
+
*deps,
|
102
|
+
])
|
103
|
+
print('Pip install check successful')
|
104
|
+
else:
|
105
|
+
print('Pip not present, cannot check install')
|
106
|
+
|
107
|
+
#
|
108
|
+
|
91
109
|
if deps:
|
92
110
|
print('Reinstalling with following additional dependencies:')
|
93
111
|
print('\n'.join(' ' + d for d in deps))
|
@@ -8,7 +8,7 @@ from omlish.subprocesses import subprocesses
|
|
8
8
|
|
9
9
|
|
10
10
|
@dc.dataclass(frozen=True)
|
11
|
-
class
|
11
|
+
class GitShallowCloner:
|
12
12
|
base_dir: str
|
13
13
|
repo_url: str
|
14
14
|
repo_dir: str
|
@@ -37,14 +37,14 @@ class GitSubtreeCloner:
|
|
37
37
|
'-c', 'advice.detachedHead=false',
|
38
38
|
]
|
39
39
|
|
40
|
-
yield
|
40
|
+
yield GitShallowCloner.Command(
|
41
41
|
cmd=(
|
42
42
|
'git',
|
43
43
|
*git_opts,
|
44
44
|
'clone',
|
45
45
|
'-n',
|
46
46
|
'--depth=1',
|
47
|
-
'--filter=tree:0',
|
47
|
+
*(['--filter=tree:0'] if self.repo_subtrees is not None else []),
|
48
48
|
*(['-b', self.branch] if self.branch else []),
|
49
49
|
'--single-branch',
|
50
50
|
self.repo_url,
|
@@ -54,19 +54,20 @@ class GitSubtreeCloner:
|
|
54
54
|
)
|
55
55
|
|
56
56
|
rd = os.path.join(self.base_dir, self.repo_dir)
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
57
|
+
if self.repo_subtrees is not None:
|
58
|
+
yield GitShallowCloner.Command(
|
59
|
+
cmd=(
|
60
|
+
'git',
|
61
|
+
*git_opts,
|
62
|
+
'sparse-checkout',
|
63
|
+
'set',
|
64
|
+
'--no-cone',
|
65
|
+
*self.repo_subtrees,
|
66
|
+
),
|
67
|
+
cwd=rd,
|
68
|
+
)
|
68
69
|
|
69
|
-
yield
|
70
|
+
yield GitShallowCloner.Command(
|
70
71
|
cmd=(
|
71
72
|
'git',
|
72
73
|
*git_opts,
|
@@ -77,7 +78,7 @@ class GitSubtreeCloner:
|
|
77
78
|
)
|
78
79
|
|
79
80
|
|
80
|
-
def
|
81
|
+
def git_shallow_clone(
|
81
82
|
*,
|
82
83
|
base_dir: str,
|
83
84
|
repo_url: str,
|
@@ -86,7 +87,7 @@ def git_clone_subtree(
|
|
86
87
|
rev: ta.Optional[str] = None,
|
87
88
|
repo_subtrees: ta.Optional[ta.Sequence[str]] = None,
|
88
89
|
) -> None:
|
89
|
-
for cmd in
|
90
|
+
for cmd in GitShallowCloner(
|
90
91
|
base_dir=base_dir,
|
91
92
|
repo_url=repo_url,
|
92
93
|
repo_dir=repo_dir,
|
@@ -9,7 +9,10 @@ if [ -z "${VENV}" ] ; then
|
|
9
9
|
fi
|
10
10
|
fi
|
11
11
|
|
12
|
-
|
12
|
+
SCRIPT_PATH=$(cd -- "$(dirname -- "$0")" && pwd)
|
13
|
+
SCRIPT_PATH="$SCRIPT_PATH/$(basename -- "$0")"
|
14
|
+
SCRIPT_DIR=$(dirname "$SCRIPT_PATH")
|
15
|
+
|
13
16
|
VENV_PYTHON_PATH="$SCRIPT_DIR/.venvs/$VENV/bin/python"
|
14
17
|
if [ -f "$VENV_PYTHON_PATH" ] ; then
|
15
18
|
PYTHON="$VENV_PYTHON_PATH"
|
@@ -19,7 +22,7 @@ else
|
|
19
22
|
PYTHON=python
|
20
23
|
fi
|
21
24
|
|
22
|
-
export PYTHONPATH="$PYTHONPATH:."
|
25
|
+
export PYTHONPATH="$PYTHONPATH:$SCRIPT_DIR:."
|
23
26
|
|
24
27
|
if [ $# -eq 0 ] && "$PYTHON" -c "import IPython" 2> /dev/null ; then
|
25
28
|
exec "$PYTHON" -m IPython
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.2
|
2
2
|
Name: omdev
|
3
|
-
Version: 0.0.0.
|
3
|
+
Version: 0.0.0.dev205
|
4
4
|
Summary: omdev
|
5
5
|
Author: wrmsr
|
6
6
|
License: BSD-3-Clause
|
@@ -12,7 +12,7 @@ Classifier: Operating System :: OS Independent
|
|
12
12
|
Classifier: Operating System :: POSIX
|
13
13
|
Requires-Python: >=3.12
|
14
14
|
License-File: LICENSE
|
15
|
-
Requires-Dist: omlish==0.0.0.
|
15
|
+
Requires-Dist: omlish==0.0.0.dev205
|
16
16
|
Provides-Extra: all
|
17
17
|
Requires-Dist: black~=24.10; extra == "all"
|
18
18
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
@@ -1,4 +1,4 @@
|
|
1
|
-
omdev/.manifests.json,sha256=
|
1
|
+
omdev/.manifests.json,sha256=bXzztz3aC_of83Npb51gvXmqTLHQlSxd2c3IcO5kkS4,8820
|
2
2
|
omdev/__about__.py,sha256=n5x-SO70OgbDQFzQ1d7sZDVMsnkQc4PxQZPFaIQFa0E,1281
|
3
3
|
omdev/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
4
|
omdev/bracepy.py,sha256=I8EdqtDvxzAi3I8TuMEW-RBfwXfqKbwp06CfOdj3L1o,2743
|
@@ -13,7 +13,7 @@ omdev/tagstrings.py,sha256=hrinoRmYCFMt4WYCZAYrocVYKQvIApNGKbJaGz8whqs,5334
|
|
13
13
|
omdev/tokens.py,sha256=zh2TCAfCbcq8ZnoVdQ824jrTiwNy3XJ_oCqlZpLpcCY,1574
|
14
14
|
omdev/wheelfile.py,sha256=yfupGcGkbFlmzGzKU64k_vmOKpaKnUlDWxeGn2KdekU,10005
|
15
15
|
omdev/amalg/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
|
-
omdev/amalg/__main__.py,sha256=
|
16
|
+
omdev/amalg/__main__.py,sha256=1sZH8SLAueWxMxK9ngvndUW3L_rw7f-s_jK3ZP1yAH8,170
|
17
17
|
omdev/amalg/gen.py,sha256=wp5CmwMUibcaIJrvwE_gQ1kInhWWgpvRntAI0ONKsQg,5995
|
18
18
|
omdev/amalg/imports.py,sha256=KNyuu0zWW63gOSsy4cl1mPs23YVAlICbaF1yEPF147o,2072
|
19
19
|
omdev/amalg/main.py,sha256=a3QoSRInHhbt1vwQmfB5MXJJnse2Ar9gIgWVxqK93lo,4031
|
@@ -37,15 +37,18 @@ omdev/cache/compute/storage.py,sha256=woCUqHg8ZrwLEejRG3zu1L5ZXxGNNXveh3E8FnlEkj
|
|
37
37
|
omdev/cache/compute/types.py,sha256=NpCTTJHDmpERjrbO6dh9TEzHuP6-vOuoX3ym9sA0ukc,2639
|
38
38
|
omdev/cache/data/__init__.py,sha256=SQXtugLceRif463rcoklpQ33pxYLgEIm0xiI6NvOI6M,301
|
39
39
|
omdev/cache/data/actions.py,sha256=KVYb3tBYP5c0g-wK1bXih_K7L0ER9UINKChhfc7mwKQ,1071
|
40
|
-
omdev/cache/data/cache.py,sha256=
|
40
|
+
omdev/cache/data/cache.py,sha256=aZJotj9kpVHBK7O0UdqMdeV7PtCqf9Rd8tqIwgWtQlQ,7664
|
41
41
|
omdev/cache/data/consts.py,sha256=d6W_aeMqgah6PmPYi9RA8Be54oQ4BcNCy8kDQ7FlB_Q,26
|
42
42
|
omdev/cache/data/defaults.py,sha256=HrapVUIf9Ozu3qSfRPyQj-vx-dz6Yyedjb-k3yV4CW8,277
|
43
43
|
omdev/cache/data/manifests.py,sha256=4BparztsMZo9DDVVPhv6iv5g4kK7QAi8Vqtj3PbKkco,989
|
44
|
-
omdev/cache/data/specs.py,sha256=
|
44
|
+
omdev/cache/data/specs.py,sha256=8o0b7goqvnezB_lD46w4ySp2KMZ8In3nqbtmfUT7v6c,2504
|
45
|
+
omdev/cc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
|
+
omdev/cc/__main__.py,sha256=n7gxSRYZ1QZOUxQPCT0_n9Xl26zi2UIvCwyGW_m67nA,166
|
47
|
+
omdev/cc/cli.py,sha256=crmHIay9J3kDsWJ7ODxk2xLSa0CDBHdD3TWN9liL1i4,3573
|
45
48
|
omdev/cexts/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
46
49
|
omdev/cexts/_boilerplate.cc,sha256=sbpXEgdFrkdzZXgaNWFFNN27fL9TZu6VrwvMY4-nnFM,1726
|
47
50
|
omdev/cexts/build.py,sha256=F3z1-CjDlEM-Gzi5IunKUBO52qdH_pMsFylobTdGJnI,2654
|
48
|
-
omdev/cexts/cmake.py,sha256=
|
51
|
+
omdev/cexts/cmake.py,sha256=x4WtT2OMQqrfdW-ZvE6JnbFDLpvVl6v_4qwqkb0Ks3E,10057
|
49
52
|
omdev/cexts/importhook.py,sha256=4f2nD531oSFQRcSzyOI_yz9ockQQgnEDhha2SQ-yMhk,3562
|
50
53
|
omdev/cexts/magic.py,sha256=MPmdhGANFVRaA3351BSTBrXm214dWXro1RMRHaJ2_O0,126
|
51
54
|
omdev/cexts/scan.py,sha256=KnwWtFgJ-vvsz6GyHVXI-ufPh8UsOCuNYPbwGm5_du4,1677
|
@@ -68,7 +71,7 @@ omdev/cexts/_distutils/compilers/unixccompiler.py,sha256=o1h8QuyupLntv4F21_XjzAZ
|
|
68
71
|
omdev/cli/__init__.py,sha256=V_l6VP1SZMlJbO-8CJwSuO9TThOy2S_oaPepNYgIrbE,37
|
69
72
|
omdev/cli/__main__.py,sha256=mOJpgc07o0r5luQ1DlX4tk2PqZkgmbwPbdzJ3KmtjgQ,138
|
70
73
|
omdev/cli/_pathhack.py,sha256=kxqb2kHap68Lkh8b211rDbcgj06hidBiAKA3f9posyc,2119
|
71
|
-
omdev/cli/clicli.py,sha256=
|
74
|
+
omdev/cli/clicli.py,sha256=UB6K-Hdgi8Y8DP3aXr4wKQfrU-C5iZHScHBC4pZYhmU,3945
|
72
75
|
omdev/cli/install.py,sha256=C-W171YlIHt4Cfok-nWSMbHwWhqF_PFqq2HixFttYx8,4460
|
73
76
|
omdev/cli/main.py,sha256=OY7ir2WWuDUM1Urmh-WdEv7uEhidRRGnE4FNYHaEN3s,7033
|
74
77
|
omdev/cli/managers.py,sha256=BV98_n30Jj63OJrFgRoVZRfICxMLXEZKoEn4rMj9LV4,1160
|
@@ -79,8 +82,8 @@ omdev/clipboard/darwin_cf.py,sha256=SDUMfQtT_IJeDEwmsnxe6YyrZS5tPh_7ujkk1dg65Hg,
|
|
79
82
|
omdev/clipboard/linux_x11.py,sha256=oa-mxMRNaZJOdBAZ8Nki-CAGIb63X8OFUTXKjmiwfSo,6718
|
80
83
|
omdev/git/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
81
84
|
omdev/git/revisions.py,sha256=1YY3Kf2WSalNVE2TgLXmOETct8HfiVEOqfV-qcvMVr4,1161
|
85
|
+
omdev/git/shallow.py,sha256=eCMbkOcjdpd6kNF1v4q5Y-iZO8P-ghLMUVZGbdUkg68,2572
|
82
86
|
omdev/git/status.py,sha256=s_5kzyaSO-ikimdi54A6DrjOQPMeM5SRXLTrb22Alp4,8106
|
83
|
-
omdev/git/subtrees.py,sha256=BuKbsNi74hp4Ki7w6y89Zq--4N71S129s4YZz3_8QWc,2446
|
84
87
|
omdev/interp/__init__.py,sha256=Y3l4WY4JRi2uLG6kgbGp93fuGfkxkKwZDvhsa0Rwgtk,15
|
85
88
|
omdev/interp/__main__.py,sha256=GMCqeGYltgt5dlJzHxY9gqisa8cRkrPfmZYuZnjg4WI,162
|
86
89
|
omdev/interp/cli.py,sha256=RMmMPYMbWnsb8mkmUaa2JKLoEvbLn201v41ExgZGfi0,2392
|
@@ -149,7 +152,7 @@ omdev/pyproject/reqs.py,sha256=8feZ71YnGzwKbLK4zO28CDQeNcZIIuq6cnkBhs6M-7E,2406
|
|
149
152
|
omdev/pyproject/venvs.py,sha256=GUurjC7qzGlFL-su4C0YPO_pxbwDAyl1CqyLOB3WLCA,1911
|
150
153
|
omdev/pyproject/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
151
154
|
omdev/pyproject/resources/docker-dev.sh,sha256=DHkz5D18jok_oDolfg2mqrvGRWFoCe9GQo04dR1czcc,838
|
152
|
-
omdev/pyproject/resources/python.sh,sha256=
|
155
|
+
omdev/pyproject/resources/python.sh,sha256=jvrwddYw2KNttpuImLbdCdJK0HsUNMrHtTnmLvhxQxg,757
|
153
156
|
omdev/scripts/__init__.py,sha256=MKCvUAEQwsIvwLixwtPlpBqmkMXLCnjjXyAXvVpDwVk,91
|
154
157
|
omdev/scripts/bumpversion.py,sha256=Kn7fo73Hs8uJh3Hi3EIyLOlzLPWAC6dwuD_lZ3cIzuY,1064
|
155
158
|
omdev/scripts/execrss.py,sha256=mR0G0wERBYtQmVIn63lCIIFb5zkCM6X_XOENDFYDBKc,651
|
@@ -160,7 +163,6 @@ omdev/scripts/pyproject.py,sha256=EEwu-5Fl0cCe0X6CaHOmjSt1vANXRFgsbvn487uKJnI,24
|
|
160
163
|
omdev/scripts/slowcat.py,sha256=lssv4yrgJHiWfOiHkUut2p8E8Tq32zB-ujXESQxFFHY,2728
|
161
164
|
omdev/scripts/tmpexec.py,sha256=WTYcf56Tj2qjYV14AWmV8SfT0u6Y8eIU6cKgQRvEK3c,1442
|
162
165
|
omdev/tools/__init__.py,sha256=iVJAOQ0viGTQOm0DLX4uZLro-9jOioYJGLg9s0kDx1A,78
|
163
|
-
omdev/tools/cc.py,sha256=ERi5pqcvqnGADS4wqbFIktJeUzSxKoAea4cGcCC6sSM,1920
|
164
166
|
omdev/tools/cloc.py,sha256=jYlMHBae9oGKN4VKeBGuqjiQNcM2be7KIoTF0oNwx_I,5205
|
165
167
|
omdev/tools/doc.py,sha256=wvgGhv6aFaV-Zl-Qivejx37i-lKQ207rZ-4K2fPf-Ss,2547
|
166
168
|
omdev/tools/docker.py,sha256=KVFckA8eAdiapFUr8xkfMw9Uv3Qy4oNq0e70Lqt1F7I,7352
|
@@ -184,9 +186,9 @@ omdev/tools/json/rendering.py,sha256=tMcjOW5edfozcMSTxxvF7WVTsbYLoe9bCKFh50qyaGw
|
|
184
186
|
omdev/tools/pawk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
185
187
|
omdev/tools/pawk/__main__.py,sha256=VCqeRVnqT1RPEoIrqHFSu4PXVMg4YEgF4qCQm90-eRI,66
|
186
188
|
omdev/tools/pawk/pawk.py,sha256=Eckymn22GfychCQcQi96BFqRo_LmiJ-EPhC8TTUJdB4,11446
|
187
|
-
omdev-0.0.0.
|
188
|
-
omdev-0.0.0.
|
189
|
-
omdev-0.0.0.
|
190
|
-
omdev-0.0.0.
|
191
|
-
omdev-0.0.0.
|
192
|
-
omdev-0.0.0.
|
189
|
+
omdev-0.0.0.dev205.dist-info/LICENSE,sha256=B_hVtavaA8zCYDW99DYdcpDLKz1n3BBRjZrcbv8uG8c,1451
|
190
|
+
omdev-0.0.0.dev205.dist-info/METADATA,sha256=D8u-17umNYoxgNjIkzCFeJlBNFzlCui_nK6xsmsFNKY,1760
|
191
|
+
omdev-0.0.0.dev205.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
192
|
+
omdev-0.0.0.dev205.dist-info/entry_points.txt,sha256=dHLXFmq5D9B8qUyhRtFqTGWGxlbx3t5ejedjrnXNYLU,33
|
193
|
+
omdev-0.0.0.dev205.dist-info/top_level.txt,sha256=1nr7j30fEWgLYHW3lGR9pkdHkb7knv1U1ES1XRNVQ6k,6
|
194
|
+
omdev-0.0.0.dev205.dist-info/RECORD,,
|
omdev/tools/cc.py
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
//$(which true); exec om cc run "$0" "$@"
|
3
|
-
or
|
4
|
-
//usr/bin/true; exec om cc run "$0" "$@"
|
5
|
-
|
6
|
-
See: https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83a7aa4e2
|
7
|
-
|
8
|
-
==
|
9
|
-
|
10
|
-
Freestanding options:
|
11
|
-
|
12
|
-
//usr/bin/env clang++ -std=c++20 -o ${X=`mktemp`} "$0" && exec -a "$0" "$X" "$@"
|
13
|
-
//usr/bin/env clang++ -std=c++20 -o ${D=`mktemp -d`}/x "$0" && ${D}/x ${@:1}; R=$?; rm -rf ${D}; exit $R
|
14
|
-
//$(which true); clang++ -std=c++20 -o ${D=`mktemp -d`}/x ${0} && ${D}/x ${@:1}; R=${?}; rm -rf ${D}; exit ${R}
|
15
|
-
"""
|
16
|
-
import os
|
17
|
-
import shutil
|
18
|
-
import subprocess
|
19
|
-
import tempfile
|
20
|
-
|
21
|
-
from omlish import check
|
22
|
-
from omlish.argparse import all as ap
|
23
|
-
|
24
|
-
from ..cli import CliModule
|
25
|
-
|
26
|
-
|
27
|
-
class Cli(ap.Cli):
|
28
|
-
@ap.cmd(
|
29
|
-
ap.arg('src-file'),
|
30
|
-
ap.arg('args', nargs=ap.REMAINDER),
|
31
|
-
)
|
32
|
-
def run(self) -> int:
|
33
|
-
src_file = self.args.src_file
|
34
|
-
check.state(os.path.isfile(src_file))
|
35
|
-
|
36
|
-
src_file_name = os.path.basename(src_file)
|
37
|
-
|
38
|
-
tmp_dir = tempfile.mkdtemp()
|
39
|
-
try:
|
40
|
-
proc = subprocess.run(
|
41
|
-
[
|
42
|
-
check.non_empty_str(shutil.which('clang++')),
|
43
|
-
'-std=c++20',
|
44
|
-
os.path.abspath(src_file),
|
45
|
-
'-o',
|
46
|
-
src_file_name,
|
47
|
-
],
|
48
|
-
cwd=tmp_dir,
|
49
|
-
check=False,
|
50
|
-
)
|
51
|
-
|
52
|
-
if rc := proc.returncode:
|
53
|
-
return rc
|
54
|
-
|
55
|
-
exe_file = os.path.join(tmp_dir, src_file_name)
|
56
|
-
check.state(os.path.isfile(exe_file))
|
57
|
-
|
58
|
-
proc = subprocess.run(
|
59
|
-
[
|
60
|
-
exe_file,
|
61
|
-
*self.args.args,
|
62
|
-
],
|
63
|
-
check=False,
|
64
|
-
)
|
65
|
-
|
66
|
-
finally:
|
67
|
-
shutil.rmtree(tmp_dir)
|
68
|
-
|
69
|
-
return proc.returncode
|
70
|
-
|
71
|
-
|
72
|
-
def _main() -> None:
|
73
|
-
Cli().cli_run_and_exit()
|
74
|
-
|
75
|
-
|
76
|
-
# @omlish-manifest
|
77
|
-
_CLI_MODULE = CliModule('cc', __name__)
|
78
|
-
|
79
|
-
|
80
|
-
if __name__ == '__main__':
|
81
|
-
_main()
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|