omdev 0.0.0.dev44__tar.gz → 0.0.0.dev46__tar.gz
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-0.0.0.dev44/omdev.egg-info → omdev-0.0.0.dev46}/PKG-INFO +2 -2
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cli/install.py +5 -1
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cli/main.py +2 -2
- omdev-0.0.0.dev46/omdev/cli/managers.py +95 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tools/piptools.py +1 -1
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46/omdev.egg-info}/PKG-INFO +2 -2
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev.egg-info/requires.txt +1 -1
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/pyproject.toml +2 -2
- omdev-0.0.0.dev44/omdev/cli/managers.py +0 -77
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/LICENSE +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/MANIFEST.in +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/README.rst +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/.manifests.json +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/__about__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/amalg/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/amalg/__main__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/amalg/amalg.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/bracepy.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/compute/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/compute/cache.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/compute/contexts.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/compute/currents.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/compute/fns.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/compute/resolvers.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/compute/storage.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/compute/types.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/data/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/data/actions.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/data/cache.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/data/consts.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/data/defaults.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/data/manifests.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cache/data/specs.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_boilerplate.cc +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/LICENSE +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/build_ext.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/compilers/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/compilers/ccompiler.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/compilers/options.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/compilers/unixccompiler.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/dir_util.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/errors.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/extension.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/file_util.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/modified.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/spawn.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/sysconfig.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/util.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/_distutils/version.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/build.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/cmake.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/importhook.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/magic.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cexts/scan.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/classdot.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cli/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cli/__main__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cli/clicli.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cli/types.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/cmake.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/findimports.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/findmagic.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/git.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/__main__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/cli.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/inspect.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/providers.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/pyenv.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/resolvers.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/standalone.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/system.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/interp/types.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/manifests/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/manifests/build.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/manifests/load.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/manifests/types.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/mypy/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/mypy/debug.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/packaging/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/packaging/names.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/packaging/requires.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/packaging/specifiers.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/packaging/versions.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/precheck/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/precheck/__main__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/precheck/base.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/precheck/git.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/precheck/lite.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/precheck/precheck.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/precheck/scripts.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/pyproject/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/pyproject/__main__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/pyproject/cexts.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/pyproject/cli.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/pyproject/configs.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/pyproject/pkg.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/pyproject/reqs.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/revisions.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/scripts/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/scripts/bumpversion.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/scripts/execrss.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/scripts/exectime.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/scripts/importtrace.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/scripts/interp.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/scripts/pyproject.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/secrets.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tokens.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/toml/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/toml/parser.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/toml/writer.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tools/__init__.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tools/dockertools.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tools/gittools.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tools/importscan.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tools/proftools.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tools/rst.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/tools/sqlrepl.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev/wheelfile.py +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev.egg-info/SOURCES.txt +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev.egg-info/dependency_links.txt +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev.egg-info/entry_points.txt +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/omdev.egg-info/top_level.txt +0 -0
- {omdev-0.0.0.dev44 → omdev-0.0.0.dev46}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev46
|
|
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.dev46
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
|
18
18
|
Requires-Dist: cffi~=1.17; extra == "all"
|
|
@@ -86,6 +86,7 @@ class UvxInstallManager(InstallManager):
|
|
|
86
86
|
'--from', opts.cli_pkg,
|
|
87
87
|
'om',
|
|
88
88
|
'_post_install',
|
|
89
|
+
opts.cli_pkg,
|
|
89
90
|
])
|
|
90
91
|
|
|
91
92
|
|
|
@@ -120,11 +121,12 @@ class PipxInstallManager(InstallManager):
|
|
|
120
121
|
|
|
121
122
|
dct = self._list_installed()
|
|
122
123
|
|
|
123
|
-
exe = dct[opts.cli_pkg]['metadata']['main_package']['app_paths'][0]['__Path__']
|
|
124
|
+
exe = dct['venvs'][opts.cli_pkg]['metadata']['main_package']['app_paths'][0]['__Path__']
|
|
124
125
|
|
|
125
126
|
subprocess.check_call([
|
|
126
127
|
exe,
|
|
127
128
|
'_post_install',
|
|
129
|
+
opts.cli_pkg,
|
|
128
130
|
])
|
|
129
131
|
|
|
130
132
|
|
|
@@ -148,6 +150,8 @@ def _main() -> None:
|
|
|
148
150
|
if not (cli := args.cli):
|
|
149
151
|
raise ValueError(f'Must specify cli')
|
|
150
152
|
|
|
153
|
+
cli = cli.lower().replace('_', '-')
|
|
154
|
+
|
|
151
155
|
if not (py := args.py):
|
|
152
156
|
raise ValueError(f'Must specify py')
|
|
153
157
|
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import enum
|
|
2
|
+
import os.path
|
|
3
|
+
import site
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
##
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _normalize_pkg_name(s: str) -> str:
|
|
11
|
+
return s.lower().replace('_', '-')
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
##
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ManagerType(enum.Enum):
|
|
18
|
+
UVX = 'uvx'
|
|
19
|
+
PIPX = 'pipx'
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def detect_install_manager(cli_pkg: str) -> ManagerType | None:
|
|
23
|
+
if os.path.isfile(fp := os.path.join(sys.prefix, 'uv-receipt.toml')):
|
|
24
|
+
import tomllib
|
|
25
|
+
|
|
26
|
+
with open(fp) as f:
|
|
27
|
+
dct = tomllib.loads(f.read())
|
|
28
|
+
|
|
29
|
+
reqs = dct.get('tool', {}).get('requirements')
|
|
30
|
+
main_pkg = _normalize_pkg_name(reqs[0].get('name', ''))
|
|
31
|
+
if reqs and main_pkg == cli_pkg:
|
|
32
|
+
return ManagerType.UVX
|
|
33
|
+
|
|
34
|
+
if os.path.isfile(fp := os.path.join(sys.prefix, 'pipx_metadata.json')):
|
|
35
|
+
import json
|
|
36
|
+
|
|
37
|
+
with open(fp) as f:
|
|
38
|
+
dct = json.loads(f.read())
|
|
39
|
+
|
|
40
|
+
main_pkg = _normalize_pkg_name(dct.get('main_package', {}).get('package_or_url', ''))
|
|
41
|
+
if main_pkg == cli_pkg:
|
|
42
|
+
return ManagerType.PIPX
|
|
43
|
+
|
|
44
|
+
return None
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
##
|
|
48
|
+
# Python is insistent in prepending sys.path with an empty string (translating to the current working directory),
|
|
49
|
+
# which leads to problems when using the cli in directories containing python packages (such as within this very
|
|
50
|
+
# source tree). This can't be done in cli main as the code frequently spawns other sys.executable processes which
|
|
51
|
+
# wouldn't know to do that, so a .pth file hack is used. Cleaning sys.path solely there is also insufficient as that
|
|
52
|
+
# code runs before the problematic empty string is added, so a sys.meta_path hook is prepended.
|
|
53
|
+
#
|
|
54
|
+
# See:
|
|
55
|
+
# https://github.com/python/cpython/blob/da1e5526aee674bb33c17a498aa3781587b9850c/Python/sysmodule.c#L3939
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def _remove_empty_from_sys_path() -> None:
|
|
59
|
+
while '' in sys.path:
|
|
60
|
+
sys.path.remove('')
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
class _PathHackMetaFinder:
|
|
64
|
+
def find_spec(self, fullname, path, target=None):
|
|
65
|
+
_remove_empty_from_sys_path()
|
|
66
|
+
return None # noqa
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _activate_path_hack() -> None:
|
|
70
|
+
if not any(isinstance(mp, _PathHackMetaFinder) for mp in sys.meta_path):
|
|
71
|
+
sys.meta_path.insert(0, _PathHackMetaFinder())
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
_PATH_HACK_FILE_NAME = f'{"-".join(__name__.split("."))}-path-hack.pth'
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _install_path_hack_file() -> None:
|
|
78
|
+
sp = site.getsitepackages()[0]
|
|
79
|
+
if os.path.isfile(fp := os.path.join(sp, _PATH_HACK_FILE_NAME)):
|
|
80
|
+
return
|
|
81
|
+
|
|
82
|
+
with open(fp, 'w') as f:
|
|
83
|
+
f.write(f'import {__name__}; {__name__}._activate_path_hack()')
|
|
84
|
+
|
|
85
|
+
_activate_path_hack()
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
##
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def setup_install_manager(cli_pkg: str) -> None:
|
|
92
|
+
if detect_install_manager(cli_pkg) is None:
|
|
93
|
+
return
|
|
94
|
+
|
|
95
|
+
_install_path_hack_file()
|
|
@@ -66,7 +66,7 @@ class Cli(ap.Cli):
|
|
|
66
66
|
dist_cn = canonicalize_name(dist.metadata['Name'], validate=True)
|
|
67
67
|
if dist_cn in dists:
|
|
68
68
|
# raise NameError(dist_cn)
|
|
69
|
-
print(f'!! duplicate dist: {dist_cn}', file=sys.stderr)
|
|
69
|
+
# print(f'!! duplicate dist: {dist_cn}', file=sys.stderr)
|
|
70
70
|
continue
|
|
71
71
|
|
|
72
72
|
dists.add(dist_cn)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev46
|
|
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.dev46
|
|
16
16
|
Provides-Extra: all
|
|
17
17
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
|
18
18
|
Requires-Dist: cffi~=1.17; extra == "all"
|
|
@@ -12,7 +12,7 @@ authors = [
|
|
|
12
12
|
urls = {source = 'https://github.com/wrmsr/omlish'}
|
|
13
13
|
license = {text = 'BSD-3-Clause'}
|
|
14
14
|
requires-python = '~=3.12'
|
|
15
|
-
version = '0.0.0.
|
|
15
|
+
version = '0.0.0.dev46'
|
|
16
16
|
classifiers = [
|
|
17
17
|
'License :: OSI Approved :: BSD License',
|
|
18
18
|
'Development Status :: 2 - Pre-Alpha',
|
|
@@ -22,7 +22,7 @@ classifiers = [
|
|
|
22
22
|
]
|
|
23
23
|
description = 'omdev'
|
|
24
24
|
dependencies = [
|
|
25
|
-
'omlish == 0.0.0.
|
|
25
|
+
'omlish == 0.0.0.dev46',
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
[project.optional-dependencies]
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import enum
|
|
2
|
-
import os.path
|
|
3
|
-
import site
|
|
4
|
-
import sys
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class ManagerType(enum.Enum):
|
|
11
|
-
UVX = 'uvx'
|
|
12
|
-
PIPX = 'pipx'
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def _detect_install_manager() -> ManagerType | None:
|
|
16
|
-
if os.path.isfile(fp := os.path.join(sys.prefix, 'uv-receipt.toml')):
|
|
17
|
-
with open(fp) as f:
|
|
18
|
-
if any(l.strip() == '[tool]' for l in f):
|
|
19
|
-
return ManagerType.UVX
|
|
20
|
-
|
|
21
|
-
if os.path.isfile(os.path.join(sys.prefix, 'pipx_metadata.json')):
|
|
22
|
-
return ManagerType.PIPX
|
|
23
|
-
|
|
24
|
-
return None
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def detect_install_manager() -> ManagerType | None:
|
|
28
|
-
try:
|
|
29
|
-
return globals()['_DETECTED_MANAGER_TYPE']
|
|
30
|
-
except KeyError:
|
|
31
|
-
pass
|
|
32
|
-
ret = globals()['_DETECTED_MANAGER_TYPE'] = _detect_install_manager()
|
|
33
|
-
return ret
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
##
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def _ensure_correct_path() -> None:
|
|
40
|
-
sp = site.getsitepackages()[0]
|
|
41
|
-
if sys.path[0] != sp:
|
|
42
|
-
sys.path.insert(0, sp)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
class _PathHackMetaFinder:
|
|
46
|
-
def find_spec(self, fullname, path, target=None):
|
|
47
|
-
_ensure_correct_path()
|
|
48
|
-
return None # noqa
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def _activate_path_hack() -> None:
|
|
52
|
-
if not any(isinstance(mp, _PathHackMetaFinder) for mp in sys.meta_path):
|
|
53
|
-
sys.meta_path.insert(0, _PathHackMetaFinder())
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
_PATH_HACK_FILE_NAME = f'{"-".join(__name__.split("."))}-path-hack.pth'
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
def _install_path_hack_file() -> None:
|
|
60
|
-
sp = site.getsitepackages()[0]
|
|
61
|
-
if os.path.isfile(fp := os.path.join(sp, _PATH_HACK_FILE_NAME)):
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
with open(fp, 'w') as f:
|
|
65
|
-
f.write(f'import {__name__}; {__name__}._activate_path_hack()')
|
|
66
|
-
|
|
67
|
-
_activate_path_hack()
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
##
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def setup_install_manager() -> None:
|
|
74
|
-
if detect_install_manager() is None:
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
_install_path_hack_file()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|