omdev 0.0.0.dev155__py3-none-any.whl → 0.0.0.dev157__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/interp/inspect.py CHANGED
@@ -5,7 +5,7 @@ import logging
5
5
  import sys
6
6
  import typing as ta
7
7
 
8
- from omlish.lite.asyncio.subprocesses import asyncio_subprocess_check_output
8
+ from omlish.lite.asyncio.subprocesses import asyncio_subprocesses
9
9
  from omlish.lite.logs import log
10
10
 
11
11
  from ..packaging.versions import Version
@@ -83,7 +83,7 @@ class InterpInspector:
83
83
  return cls._build_inspection(sys.executable, eval(cls._INSPECTION_CODE)) # noqa
84
84
 
85
85
  async def _inspect(self, exe: str) -> InterpInspection:
86
- output = await asyncio_subprocess_check_output(exe, '-c', f'print({self._INSPECTION_CODE})', quiet=True)
86
+ output = await asyncio_subprocesses.check_output(exe, '-c', f'print({self._INSPECTION_CODE})', quiet=True)
87
87
  return self._build_inspection(exe, output.decode())
88
88
 
89
89
  async def inspect(self, exe: str) -> ta.Optional[InterpInspection]:
omdev/interp/pyenv.py CHANGED
@@ -18,9 +18,7 @@ import shutil
18
18
  import sys
19
19
  import typing as ta
20
20
 
21
- from omlish.lite.asyncio.subprocesses import asyncio_subprocess_check_call
22
- from omlish.lite.asyncio.subprocesses import asyncio_subprocess_check_output_str
23
- from omlish.lite.asyncio.subprocesses import asyncio_subprocess_try_output
21
+ from omlish.lite.asyncio.subprocesses import asyncio_subprocesses
24
22
  from omlish.lite.cached import async_cached_nullary
25
23
  from omlish.lite.cached import cached_nullary
26
24
  from omlish.lite.check import check
@@ -59,7 +57,7 @@ class Pyenv:
59
57
  return self._root_kw
60
58
 
61
59
  if shutil.which('pyenv'):
62
- return await asyncio_subprocess_check_output_str('pyenv', 'root')
60
+ return await asyncio_subprocesses.check_output_str('pyenv', 'root')
63
61
 
64
62
  d = os.path.expanduser('~/.pyenv')
65
63
  if os.path.isdir(d) and os.path.isfile(os.path.join(d, 'bin', 'pyenv')):
@@ -88,7 +86,7 @@ class Pyenv:
88
86
  if await self.root() is None:
89
87
  return []
90
88
  ret = []
91
- s = await asyncio_subprocess_check_output_str(await self.exe(), 'install', '--list')
89
+ s = await asyncio_subprocesses.check_output_str(await self.exe(), 'install', '--list')
92
90
  for l in s.splitlines():
93
91
  if not l.startswith(' '):
94
92
  continue
@@ -103,7 +101,7 @@ class Pyenv:
103
101
  return False
104
102
  if not os.path.isdir(os.path.join(root, '.git')):
105
103
  return False
106
- await asyncio_subprocess_check_call('git', 'pull', cwd=root)
104
+ await asyncio_subprocesses.check_call('git', 'pull', cwd=root)
107
105
  return True
108
106
 
109
107
 
@@ -194,7 +192,7 @@ class DarwinPyenvInstallOpts(PyenvInstallOptsProvider):
194
192
  cflags = []
195
193
  ldflags = []
196
194
  for dep in self.BREW_DEPS:
197
- dep_prefix = await asyncio_subprocess_check_output_str('brew', '--prefix', dep)
195
+ dep_prefix = await asyncio_subprocesses.check_output_str('brew', '--prefix', dep)
198
196
  cflags.append(f'-I{dep_prefix}/include')
199
197
  ldflags.append(f'-L{dep_prefix}/lib')
200
198
  return PyenvInstallOpts(
@@ -204,11 +202,11 @@ class DarwinPyenvInstallOpts(PyenvInstallOptsProvider):
204
202
 
205
203
  @async_cached_nullary
206
204
  async def brew_tcl_opts(self) -> PyenvInstallOpts:
207
- if await asyncio_subprocess_try_output('brew', '--prefix', 'tcl-tk') is None:
205
+ if await asyncio_subprocesses.try_output('brew', '--prefix', 'tcl-tk') is None:
208
206
  return PyenvInstallOpts()
209
207
 
210
- tcl_tk_prefix = await asyncio_subprocess_check_output_str('brew', '--prefix', 'tcl-tk')
211
- tcl_tk_ver_str = await asyncio_subprocess_check_output_str('brew', 'ls', '--versions', 'tcl-tk')
208
+ tcl_tk_prefix = await asyncio_subprocesses.check_output_str('brew', '--prefix', 'tcl-tk')
209
+ tcl_tk_ver_str = await asyncio_subprocesses.check_output_str('brew', 'ls', '--versions', 'tcl-tk')
212
210
  tcl_tk_ver = '.'.join(tcl_tk_ver_str.split()[1].split('.')[:2])
213
211
 
214
212
  return PyenvInstallOpts(conf_opts=[
@@ -316,6 +314,7 @@ class PyenvVersionInstaller:
316
314
  self._version,
317
315
  ]
318
316
 
317
+ full_args: ta.List[str]
319
318
  if self._given_install_name is not None:
320
319
  full_args = [
321
320
  os.path.join(check.not_none(await self._pyenv.root()), 'plugins', 'python-build', 'bin', 'python-build'), # noqa
@@ -329,7 +328,7 @@ class PyenvVersionInstaller:
329
328
  *conf_args,
330
329
  ]
331
330
 
332
- await asyncio_subprocess_check_call(
331
+ await asyncio_subprocesses.check_call(
333
332
  *full_args,
334
333
  env=env,
335
334
  )
omdev/pyproject/cli.py CHANGED
@@ -36,7 +36,7 @@ import typing as ta
36
36
  from omlish.argparse.cli import ArgparseCli
37
37
  from omlish.argparse.cli import argparse_arg
38
38
  from omlish.argparse.cli import argparse_command
39
- from omlish.lite.asyncio.subprocesses import asyncio_subprocess_check_call
39
+ from omlish.lite.asyncio.subprocesses import asyncio_subprocesses
40
40
  from omlish.lite.cached import cached_nullary
41
41
  from omlish.lite.check import check
42
42
  from omlish.lite.logs import configure_standard_logging
@@ -167,7 +167,7 @@ class PyprojectCli(ArgparseCli):
167
167
  else:
168
168
  docker_env[e] = os.environ.get(e, '')
169
169
 
170
- await asyncio_subprocess_check_call(
170
+ await asyncio_subprocesses.check_call(
171
171
  'docker',
172
172
  'compose',
173
173
  '-f', 'docker/compose.yml',
@@ -218,7 +218,7 @@ class PyprojectCli(ArgparseCli):
218
218
 
219
219
  elif cmd == 'test':
220
220
  await venv.create()
221
- await asyncio_subprocess_check_call(venv.exe(), '-m', 'pytest', *(self.args.args or []), *venv.srcs())
221
+ await asyncio_subprocesses.check_call(venv.exe(), '-m', 'pytest', *(self.args.args or []), *venv.srcs())
222
222
 
223
223
  else:
224
224
  raise Exception(f'unknown subcommand: {cmd}')
omdev/pyproject/pkg.py CHANGED
@@ -37,7 +37,7 @@ import typing as ta
37
37
 
38
38
  from omlish.lite.cached import cached_nullary
39
39
  from omlish.lite.logs import log
40
- from omlish.lite.subprocesses import subprocess_check_call
40
+ from omlish.lite.subprocesses import subprocesses
41
41
 
42
42
  from ..cexts.magic import CextMagic
43
43
  from ..magic.find import find_magic_files
@@ -214,7 +214,7 @@ class BasePyprojectPackageGenerator(abc.ABC):
214
214
  output_dir: ta.Optional[str] = None,
215
215
  opts: BuildOpts = BuildOpts(),
216
216
  ) -> None:
217
- subprocess_check_call(
217
+ subprocesses.check_call(
218
218
  sys.executable,
219
219
  '-m',
220
220
  'build',
@@ -230,14 +230,14 @@ class BasePyprojectPackageGenerator(abc.ABC):
230
230
  for fn in os.listdir(dist_dir):
231
231
  tmp_dir = tempfile.mkdtemp()
232
232
 
233
- subprocess_check_call(
233
+ subprocesses.check_call(
234
234
  sys.executable,
235
235
  '-m', 'venv',
236
236
  'test-install',
237
237
  cwd=tmp_dir,
238
238
  )
239
239
 
240
- subprocess_check_call(
240
+ subprocesses.check_call(
241
241
  os.path.join(tmp_dir, 'test-install', 'bin', 'python3'),
242
242
  '-m', 'pip',
243
243
  'install',
omdev/pyproject/venvs.py CHANGED
@@ -3,7 +3,7 @@ import glob
3
3
  import os.path
4
4
  import typing as ta
5
5
 
6
- from omlish.lite.asyncio.subprocesses import asyncio_subprocess_check_call
6
+ from omlish.lite.asyncio.subprocesses import asyncio_subprocesses
7
7
  from omlish.lite.cached import async_cached_nullary
8
8
  from omlish.lite.cached import cached_nullary
9
9
  from omlish.lite.check import check
@@ -58,12 +58,12 @@ class Venv:
58
58
  return False
59
59
 
60
60
  log.info('Using interpreter %s', (ie := await self.interp_exe()))
61
- await asyncio_subprocess_check_call(ie, '-m', 'venv', dn)
61
+ await asyncio_subprocesses.check_call(ie, '-m', 'venv', dn)
62
62
 
63
63
  ve = self.exe()
64
64
  uv = self._cfg.use_uv
65
65
 
66
- await asyncio_subprocess_check_call(
66
+ await asyncio_subprocesses.check_call(
67
67
  ve,
68
68
  '-m', 'pip',
69
69
  'install', '-v', '--upgrade',
@@ -81,7 +81,7 @@ class Venv:
81
81
  # Caused by: Failed to download distribution due to network timeout. Try increasing UV_HTTP_TIMEOUT (current value: 30s). # noqa
82
82
  # UV_CONCURRENT_DOWNLOADS=4 UV_HTTP_TIMEOUT=3600
83
83
 
84
- await asyncio_subprocess_check_call(
84
+ await asyncio_subprocesses.check_call(
85
85
  ve,
86
86
  '-m',
87
87
  *(['uv'] if uv else []),