omdev 0.0.0.dev552__py3-none-any.whl → 0.0.0.dev554__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.
- omdev/__about__.py +1 -1
- omdev/ci/cli.py +7 -2
- omdev/ci/docker/cacheserved/cache.py +2 -0
- omdev/ci/docker/dataserver.py +10 -10
- omdev/dataserver/http.py +8 -8
- omdev/dockerdev/cli.py +8 -1
- omdev/dockerdev/resources/scripts/install-codex +4 -0
- omdev/irc/messages/messages.py +3 -3
- omdev/scripts/ci.py +22986 -15971
- omdev/scripts/lib/formats/goyaml.py +3 -3
- omdev/scripts/lib/io/pipelines.py +68 -12
- omdev/scripts/lib/io/streams.py +31 -1
- omdev/scripts/lib/logs.py +2 -2
- omdev/scripts/pyproject.py +2 -2
- {omdev-0.0.0.dev552.dist-info → omdev-0.0.0.dev554.dist-info}/METADATA +4 -4
- {omdev-0.0.0.dev552.dist-info → omdev-0.0.0.dev554.dist-info}/RECORD +20 -19
- {omdev-0.0.0.dev552.dist-info → omdev-0.0.0.dev554.dist-info}/WHEEL +0 -0
- {omdev-0.0.0.dev552.dist-info → omdev-0.0.0.dev554.dist-info}/entry_points.txt +0 -0
- {omdev-0.0.0.dev552.dist-info → omdev-0.0.0.dev554.dist-info}/licenses/LICENSE +0 -0
- {omdev-0.0.0.dev552.dist-info → omdev-0.0.0.dev554.dist-info}/top_level.txt +0 -0
omdev/__about__.py
CHANGED
omdev/ci/cli.py
CHANGED
|
@@ -8,8 +8,13 @@ Inputs:
|
|
|
8
8
|
|
|
9
9
|
==
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
run --cache-dir omdev/ci/tests/cache -e CI=1 omdev/ci/tests/project omlish-ci pytest tests
|
|
12
|
+
|
|
13
|
+
run --cache-dir omdev/ci/tests/cache --cache-served-docker --always-build -e CI=1 omdev/ci/tests/project omlish-ci pytest tests
|
|
14
|
+
run --cache-dir omdev/ci/tests/cache --cache-served-docker --always-build --always-pull -e CI=1 omdev/ci/tests/project omlish-ci pytest tests
|
|
15
|
+
|
|
16
|
+
run --cache-dir ~/.cache/omlish/ci . omlish-ci bash
|
|
17
|
+
""" # noqa
|
|
13
18
|
import argparse
|
|
14
19
|
import asyncio
|
|
15
20
|
import itertools
|
omdev/ci/docker/dataserver.py
CHANGED
|
@@ -7,17 +7,17 @@ import threading
|
|
|
7
7
|
import typing as ta
|
|
8
8
|
|
|
9
9
|
from omlish.docker.ports import DockerPortRelay
|
|
10
|
-
from omlish.http.
|
|
11
|
-
from omlish.http.handlers import
|
|
12
|
-
from omlish.http.
|
|
10
|
+
from omlish.http.simple.handlers import LoggingSimpleHttpHandler
|
|
11
|
+
from omlish.http.simple.handlers import SimpleHttpHandler
|
|
12
|
+
from omlish.http.simple.pipelines.sync import make_simple_http_server
|
|
13
13
|
from omlish.lite.cached import cached_nullary
|
|
14
14
|
from omlish.lite.check import check
|
|
15
15
|
from omlish.lite.contextmanagers import AsyncExitStacked
|
|
16
16
|
from omlish.logs.protocols import LoggerLike
|
|
17
17
|
from omlish.secrets.tempssl import generate_temp_localhost_ssl_cert
|
|
18
|
-
from omlish.sockets.handlers.server import
|
|
18
|
+
from omlish.sockets.handlers.server import SocketHandlerServer
|
|
19
19
|
|
|
20
|
-
from ...dataserver.http import
|
|
20
|
+
from ...dataserver.http import DataServerSimpleHttpHandler
|
|
21
21
|
from ...dataserver.server import DataServer
|
|
22
22
|
|
|
23
23
|
|
|
@@ -54,7 +54,7 @@ class AsyncioManagedSimpleHttpServer(AsyncExitStacked):
|
|
|
54
54
|
def __init__(
|
|
55
55
|
self,
|
|
56
56
|
port: int,
|
|
57
|
-
handler:
|
|
57
|
+
handler: SimpleHttpHandler,
|
|
58
58
|
*,
|
|
59
59
|
temp_ssl: bool = False,
|
|
60
60
|
) -> None:
|
|
@@ -70,7 +70,7 @@ class AsyncioManagedSimpleHttpServer(AsyncExitStacked):
|
|
|
70
70
|
self._loop: ta.Optional[asyncio.AbstractEventLoop] = None
|
|
71
71
|
self._thread: ta.Optional[threading.Thread] = None
|
|
72
72
|
self._thread_exit_event = asyncio.Event()
|
|
73
|
-
self._server: ta.Optional[
|
|
73
|
+
self._server: ta.Optional[SocketHandlerServer] = None
|
|
74
74
|
|
|
75
75
|
@cached_nullary
|
|
76
76
|
def _ssl_context(self) -> ta.Optional['ssl.SSLContext']:
|
|
@@ -88,7 +88,7 @@ class AsyncioManagedSimpleHttpServer(AsyncExitStacked):
|
|
|
88
88
|
return ssl_context
|
|
89
89
|
|
|
90
90
|
@contextlib.contextmanager
|
|
91
|
-
def _make_server(self) -> ta.Iterator[
|
|
91
|
+
def _make_server(self) -> ta.Iterator[SocketHandlerServer]:
|
|
92
92
|
with make_simple_http_server(
|
|
93
93
|
self._port,
|
|
94
94
|
self._handler,
|
|
@@ -180,10 +180,10 @@ class DockerDataServer(AsyncExitStacked):
|
|
|
180
180
|
|
|
181
181
|
#
|
|
182
182
|
|
|
183
|
-
handler:
|
|
183
|
+
handler: SimpleHttpHandler = DataServerSimpleHttpHandler(self._data_server)
|
|
184
184
|
|
|
185
185
|
if self._handler_log is not None:
|
|
186
|
-
handler =
|
|
186
|
+
handler = LoggingSimpleHttpHandler(
|
|
187
187
|
handler,
|
|
188
188
|
self._handler_log,
|
|
189
189
|
)
|
omdev/dataserver/http.py
CHANGED
|
@@ -7,10 +7,10 @@ TODO:
|
|
|
7
7
|
"""
|
|
8
8
|
import typing as ta
|
|
9
9
|
|
|
10
|
-
from omlish.http.handlers import
|
|
11
|
-
from omlish.http.handlers import
|
|
12
|
-
from omlish.http.handlers import
|
|
13
|
-
from omlish.http.handlers import
|
|
10
|
+
from omlish.http.simple.handlers import SimpleHttpHandler_
|
|
11
|
+
from omlish.http.simple.handlers import SimpleHttpHandlerRequest
|
|
12
|
+
from omlish.http.simple.handlers import SimpleHttpHandlerResponse
|
|
13
|
+
from omlish.http.simple.handlers import SimpleHttpHandlerResponseStreamedData
|
|
14
14
|
|
|
15
15
|
from .handlers import DataServerRequest
|
|
16
16
|
from .server import DataServer
|
|
@@ -19,7 +19,7 @@ from .server import DataServer
|
|
|
19
19
|
##
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
class
|
|
22
|
+
class DataServerSimpleHttpHandler(SimpleHttpHandler_):
|
|
23
23
|
DEFAULT_READ_CHUNK_SIZE = 0x10000
|
|
24
24
|
|
|
25
25
|
def __init__(
|
|
@@ -33,7 +33,7 @@ class DataServerHttpHandler(HttpHandler_):
|
|
|
33
33
|
self._ps = ps
|
|
34
34
|
self._read_chunk_size = read_chunk_size
|
|
35
35
|
|
|
36
|
-
def __call__(self, req:
|
|
36
|
+
def __call__(self, req: SimpleHttpHandlerRequest) -> SimpleHttpHandlerResponse:
|
|
37
37
|
p_req = DataServerRequest(
|
|
38
38
|
req.method,
|
|
39
39
|
req.path,
|
|
@@ -50,12 +50,12 @@ class DataServerHttpHandler(HttpHandler_):
|
|
|
50
50
|
finally:
|
|
51
51
|
p_body.close()
|
|
52
52
|
|
|
53
|
-
data =
|
|
53
|
+
data = SimpleHttpHandlerResponseStreamedData(stream_data())
|
|
54
54
|
|
|
55
55
|
else:
|
|
56
56
|
data = None
|
|
57
57
|
|
|
58
|
-
resp =
|
|
58
|
+
resp = SimpleHttpHandlerResponse(
|
|
59
59
|
status=p_resp.status,
|
|
60
60
|
headers=p_resp.headers,
|
|
61
61
|
data=data,
|
omdev/dockerdev/cli.py
CHANGED
|
@@ -10,11 +10,12 @@ TODO:
|
|
|
10
10
|
- launch / manage compose services
|
|
11
11
|
- more cache dirs
|
|
12
12
|
- --mount=type=bind,src="$(pwd)",dst=/omlish/pwd
|
|
13
|
-
- --mount=type=bind,src=/host/dir,dst=/container/dir,readonly (git)
|
|
14
13
|
- build --no-cache / cache bust
|
|
15
14
|
- build args
|
|
16
15
|
- auto go/zig vers
|
|
17
16
|
- `run --pull=never`, `build --pull=false`
|
|
17
|
+
- !! shadow config !!
|
|
18
|
+
- default autoexec, default env vars
|
|
18
19
|
|
|
19
20
|
====
|
|
20
21
|
|
|
@@ -180,6 +181,7 @@ class Cli(ap.Cli):
|
|
|
180
181
|
ap.arg('--mount', action='append'),
|
|
181
182
|
ap.arg('-C', '--mount-caches', action='store_true'),
|
|
182
183
|
ap.arg('-D', '--mount-docker-sock', action='store_true'),
|
|
184
|
+
ap.arg('-G', '--mount-git', action='store_true'),
|
|
183
185
|
|
|
184
186
|
ap.arg('-P', '--privileged', action='store_true'),
|
|
185
187
|
|
|
@@ -237,6 +239,11 @@ class Cli(ap.Cli):
|
|
|
237
239
|
os.makedirs(cld, exist_ok=True)
|
|
238
240
|
run_args.append(f'--mount=type=bind,src={cld},dst={cr}')
|
|
239
241
|
|
|
242
|
+
if self.args.mount_git:
|
|
243
|
+
git_path = os.path.join(os.getcwd(), '.git')
|
|
244
|
+
check.state(os.path.isdir(git_path))
|
|
245
|
+
run_args.append(f'--mount=type=bind,src={git_path},dst=/git,ro')
|
|
246
|
+
|
|
240
247
|
if not self.args.no_host_platform:
|
|
241
248
|
run_args.extend([f'--env=DOCKER_HOST_PLATFORM={platform.system().lower()}'])
|
|
242
249
|
|
omdev/irc/messages/messages.py
CHANGED
|
@@ -215,11 +215,11 @@ class JoinMessage(Message):
|
|
|
215
215
|
def _validate_channels(self) -> None:
|
|
216
216
|
check.not_isinstance(self.channels, str)
|
|
217
217
|
if self.has_keys:
|
|
218
|
-
for c, _ in self.channels: # type: ignore[
|
|
218
|
+
for c, _ in self.channels: # type: ignore[str-unpack]
|
|
219
219
|
check.non_empty_str(c)
|
|
220
220
|
else:
|
|
221
|
-
for c in self.channels:
|
|
222
|
-
check.non_empty_str(c)
|
|
221
|
+
for c in self.channels: # type: ignore[assignment]
|
|
222
|
+
check.non_empty_str(c)
|
|
223
223
|
|
|
224
224
|
|
|
225
225
|
@_register_irc_message
|