omdev 0.0.0.dev68__tar.gz → 0.0.0.dev70__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.
Potentially problematic release.
This version of omdev might be problematic. Click here for more details.
- {omdev-0.0.0.dev68/omdev.egg-info → omdev-0.0.0.dev70}/PKG-INFO +8 -2
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/.manifests.json +25 -1
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/__about__.py +8 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cli/managers.py +1 -1
- omdev-0.0.0.dev70/omdev/tools/nbtools.py +120 -0
- omdev-0.0.0.dev70/omdev/tools/proftools.py +55 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tools/rst.py +6 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70/omdev.egg-info}/PKG-INFO +8 -2
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev.egg-info/SOURCES.txt +1 -1
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev.egg-info/requires.txt +9 -1
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/pyproject.toml +10 -2
- omdev-0.0.0.dev68/omdev/tools/nbtools.py +0 -49
- omdev-0.0.0.dev68/omdev/tools/proftools.py +0 -4
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/LICENSE +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/MANIFEST.in +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/README.rst +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/amalg/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/amalg/__main__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/amalg/amalg.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/antlr/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/antlr/_antlr/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/antlr/consts.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/antlr/gen.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/bracepy.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/compute/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/compute/cache.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/compute/contexts.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/compute/currents.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/compute/fns.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/compute/resolvers.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/compute/storage.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/compute/types.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/data/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/data/actions.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/data/cache.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/data/consts.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/data/defaults.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/data/manifests.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cache/data/specs.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_boilerplate.cc +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/LICENSE +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/build_ext.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/compilers/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/compilers/ccompiler.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/compilers/options.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/compilers/unixccompiler.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/dir_util.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/errors.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/extension.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/file_util.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/modified.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/spawn.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/sysconfig.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/util.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/_distutils/version.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/build.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/cmake.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/importhook.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/magic.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cexts/scan.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/classdot.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cli/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cli/__main__.py +0 -0
- /omdev-0.0.0.dev68/omdev/cli/pathhack.py → /omdev-0.0.0.dev70/omdev/cli/_pathhack.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cli/clicli.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cli/install.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cli/main.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cli/types.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/cmake.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/findimports.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/findmagic.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/git.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/__main__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/cli.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/inspect.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/providers.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/pyenv.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/resolvers.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/standalone.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/system.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/interp/types.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/manifests/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/manifests/build.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/manifests/load.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/manifests/types.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/mypy/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/mypy/debug.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/packaging/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/packaging/names.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/packaging/requires.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/packaging/specifiers.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/packaging/versions.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/precheck/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/precheck/__main__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/precheck/base.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/precheck/git.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/precheck/lite.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/precheck/precheck.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/precheck/scripts.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/pyproject/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/pyproject/__main__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/pyproject/cexts.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/pyproject/cli.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/pyproject/configs.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/pyproject/pkg.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/pyproject/reqs.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/revisions.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/scripts/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/scripts/bumpversion.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/scripts/execrss.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/scripts/exectime.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/scripts/importtrace.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/scripts/interp.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/scripts/pyproject.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/secrets.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tokens.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/toml/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/toml/parser.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/toml/writer.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tools/__init__.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tools/dockertools.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tools/gittools.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tools/importscan.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tools/mkrelimp.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tools/piptools.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/tools/sqlrepl.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev/wheelfile.py +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev.egg-info/dependency_links.txt +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev.egg-info/entry_points.txt +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/omdev.egg-info/top_level.txt +0 -0
- {omdev-0.0.0.dev68 → omdev-0.0.0.dev70}/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.dev70
|
|
4
4
|
Summary: omdev
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -12,15 +12,19 @@ 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.dev70
|
|
16
16
|
Provides-Extra: all
|
|
17
|
+
Requires-Dist: black~=24.10; extra == "all"
|
|
17
18
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
|
18
19
|
Requires-Dist: cffi~=1.17; extra == "all"
|
|
19
20
|
Requires-Dist: pcpp~=1.30; extra == "all"
|
|
20
21
|
Requires-Dist: docutils~=0.21; extra == "all"
|
|
21
22
|
Requires-Dist: mypy~=1.11; extra == "all"
|
|
23
|
+
Requires-Dist: gprof2dot~=2024.6; extra == "all"
|
|
22
24
|
Requires-Dist: tokenize_rt~=6.0; extra == "all"
|
|
23
25
|
Requires-Dist: wheel~=0.44; extra == "all"
|
|
26
|
+
Provides-Extra: black
|
|
27
|
+
Requires-Dist: black~=24.10; extra == "black"
|
|
24
28
|
Provides-Extra: c
|
|
25
29
|
Requires-Dist: pycparser~=2.22; extra == "c"
|
|
26
30
|
Requires-Dist: cffi~=1.17; extra == "c"
|
|
@@ -29,6 +33,8 @@ Provides-Extra: docutils
|
|
|
29
33
|
Requires-Dist: docutils~=0.21; extra == "docutils"
|
|
30
34
|
Provides-Extra: mypy
|
|
31
35
|
Requires-Dist: mypy~=1.11; extra == "mypy"
|
|
36
|
+
Provides-Extra: prof
|
|
37
|
+
Requires-Dist: gprof2dot~=2024.6; extra == "prof"
|
|
32
38
|
Provides-Extra: tokens
|
|
33
39
|
Requires-Dist: tokenize_rt~=6.0; extra == "tokens"
|
|
34
40
|
Provides-Extra: wheel
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
"module": ".tools.nbtools",
|
|
172
172
|
"attr": "_CLI_MODULE",
|
|
173
173
|
"file": "omdev/tools/nbtools.py",
|
|
174
|
-
"line":
|
|
174
|
+
"line": 115,
|
|
175
175
|
"value": {
|
|
176
176
|
"$.cli.types.CliModule": {
|
|
177
177
|
"cmd_name": [
|
|
@@ -194,6 +194,30 @@
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
},
|
|
197
|
+
{
|
|
198
|
+
"module": ".tools.proftools",
|
|
199
|
+
"attr": "_CLI_MODULE",
|
|
200
|
+
"file": "omdev/tools/proftools.py",
|
|
201
|
+
"line": 50,
|
|
202
|
+
"value": {
|
|
203
|
+
"$.cli.types.CliModule": {
|
|
204
|
+
"cmd_name": "prof",
|
|
205
|
+
"mod_name": "omdev.tools.proftools"
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"module": ".tools.rst",
|
|
211
|
+
"attr": "_CLI_MODULE",
|
|
212
|
+
"file": "omdev/tools/rst.py",
|
|
213
|
+
"line": 45,
|
|
214
|
+
"value": {
|
|
215
|
+
"$.cli.types.CliModule": {
|
|
216
|
+
"cmd_name": "rst",
|
|
217
|
+
"mod_name": "omdev.tools.rst"
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
},
|
|
197
221
|
{
|
|
198
222
|
"module": ".tools.sqlrepl",
|
|
199
223
|
"attr": "_CLI_MODULE",
|
|
@@ -12,6 +12,10 @@ class Project(ProjectBase):
|
|
|
12
12
|
]
|
|
13
13
|
|
|
14
14
|
optional_dependencies = {
|
|
15
|
+
'black': [
|
|
16
|
+
'black ~= 24.10',
|
|
17
|
+
],
|
|
18
|
+
|
|
15
19
|
'c': [
|
|
16
20
|
'pycparser ~= 2.22',
|
|
17
21
|
'cffi ~= 1.17',
|
|
@@ -26,6 +30,10 @@ class Project(ProjectBase):
|
|
|
26
30
|
'mypy ~= 1.11',
|
|
27
31
|
],
|
|
28
32
|
|
|
33
|
+
'prof': [
|
|
34
|
+
'gprof2dot ~= 2024.6',
|
|
35
|
+
],
|
|
36
|
+
|
|
29
37
|
'tokens': [
|
|
30
38
|
'tokenize_rt ~= 6.0',
|
|
31
39
|
],
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import io
|
|
2
|
+
import json
|
|
3
|
+
import os.path
|
|
4
|
+
import subprocess
|
|
5
|
+
import sys
|
|
6
|
+
import urllib.parse
|
|
7
|
+
import urllib.request
|
|
8
|
+
|
|
9
|
+
from omlish import argparse as ap
|
|
10
|
+
from omlish import check
|
|
11
|
+
|
|
12
|
+
from ..cli import CliModule
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class Cli(ap.Cli):
|
|
16
|
+
@ap.command(
|
|
17
|
+
ap.arg('file'),
|
|
18
|
+
ap.arg('-w', '--write', action='store_true'),
|
|
19
|
+
ap.arg('-o', '--overwrite', action='store_true'),
|
|
20
|
+
ap.arg('--no-header', action='store_true'),
|
|
21
|
+
ap.arg('--keep-bangs', action='store_true'),
|
|
22
|
+
ap.arg('--black', action='store_true'),
|
|
23
|
+
)
|
|
24
|
+
def strip_code(self) -> None:
|
|
25
|
+
out_file: str | None = None
|
|
26
|
+
out_header: list[str] = []
|
|
27
|
+
|
|
28
|
+
if ':' in self.args.file:
|
|
29
|
+
url = self.args.file
|
|
30
|
+
pu = urllib.parse.urlparse(url)
|
|
31
|
+
check.equal(pu.scheme, 'https')
|
|
32
|
+
|
|
33
|
+
out_header.append(f'# Origin: {url}')
|
|
34
|
+
|
|
35
|
+
if pu.hostname == 'github.com':
|
|
36
|
+
_, user, repo, blob, *rest = pu.path.split('/')
|
|
37
|
+
check.equal(blob, 'blob')
|
|
38
|
+
url = f'https://raw.githubusercontent.com/{user}/{repo}/refs/heads/{"/".join(rest)}'
|
|
39
|
+
|
|
40
|
+
elif pu.hostname == 'raw.githubusercontent.com':
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
else:
|
|
44
|
+
raise ValueError(pu.hostname)
|
|
45
|
+
|
|
46
|
+
file = pu.path.split('/')[-1]
|
|
47
|
+
check.state(file.endswith('.ipynb'))
|
|
48
|
+
|
|
49
|
+
if self.args.write:
|
|
50
|
+
out_file = file.rpartition('.')[0] + '.py'
|
|
51
|
+
|
|
52
|
+
with urllib.request.urlopen(url) as resp: # noqa
|
|
53
|
+
buf = resp.read()
|
|
54
|
+
|
|
55
|
+
dct = json.loads(buf.decode('utf-8'))
|
|
56
|
+
|
|
57
|
+
elif self.args.file == '-':
|
|
58
|
+
if self.args.write:
|
|
59
|
+
raise Exception('Write not supported with stdin')
|
|
60
|
+
|
|
61
|
+
dct = json.load(sys.stdin)
|
|
62
|
+
|
|
63
|
+
else:
|
|
64
|
+
with open(self.args.file) as f:
|
|
65
|
+
dct = json.load(f)
|
|
66
|
+
|
|
67
|
+
if self.args.write:
|
|
68
|
+
out_file = self.args.file.rpartition('.')[0] + '.py'
|
|
69
|
+
|
|
70
|
+
if out_file is not None and os.path.isfile(out_file) and not self.args.overwrite:
|
|
71
|
+
raise OSError(f'File exists: {out_file}')
|
|
72
|
+
|
|
73
|
+
delim = '\n##\n\n'
|
|
74
|
+
|
|
75
|
+
out = io.StringIO()
|
|
76
|
+
if not self.args.no_header and out_header:
|
|
77
|
+
out.write('\n'.join(out_header))
|
|
78
|
+
out.write(delim)
|
|
79
|
+
|
|
80
|
+
code_cells = [c for c in dct['cells'] if c['cell_type'] == 'code']
|
|
81
|
+
for i, c in enumerate(code_cells):
|
|
82
|
+
if i:
|
|
83
|
+
out.write(delim)
|
|
84
|
+
|
|
85
|
+
src = ''.join(c['source'])
|
|
86
|
+
if not self.args.keep_bangs:
|
|
87
|
+
src = ''.join(
|
|
88
|
+
('# ' + l) if l.startswith('!') else l
|
|
89
|
+
for l in src.splitlines(keepends=True)
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
out.write(src)
|
|
93
|
+
out.write('\n')
|
|
94
|
+
|
|
95
|
+
out_src = out.getvalue()
|
|
96
|
+
|
|
97
|
+
if self.args.black:
|
|
98
|
+
proc = subprocess.run(
|
|
99
|
+
[sys.executable, '-m', 'black', '-'],
|
|
100
|
+
input=out_src.encode('utf-8'),
|
|
101
|
+
stdout=subprocess.PIPE,
|
|
102
|
+
check=True,
|
|
103
|
+
)
|
|
104
|
+
out_src = proc.stdout.decode('utf-8')
|
|
105
|
+
|
|
106
|
+
if out_file is not None:
|
|
107
|
+
with open(out_file, 'w') as f:
|
|
108
|
+
f.write(out_src)
|
|
109
|
+
print(f'Wrote {out_file}')
|
|
110
|
+
|
|
111
|
+
else:
|
|
112
|
+
sys.stdout.write(out_src)
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# @omlish-manifest
|
|
116
|
+
_CLI_MODULE = CliModule(['notebook', 'nb'], __name__)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
if __name__ == '__main__':
|
|
120
|
+
Cli()()
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import os.path
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
import tempfile
|
|
5
|
+
|
|
6
|
+
from omlish import argparse as ap
|
|
7
|
+
|
|
8
|
+
from ..cli import CliModule
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class Cli(ap.Cli):
|
|
12
|
+
@ap.command(
|
|
13
|
+
ap.arg('file'),
|
|
14
|
+
ap.arg('out-file', nargs='?'),
|
|
15
|
+
ap.arg('-w', '--write', action='store_true'),
|
|
16
|
+
ap.arg('-o', '--overwrite', action='store_true'),
|
|
17
|
+
ap.arg('-O', '--open', action='store_true'),
|
|
18
|
+
)
|
|
19
|
+
def pstats_pdf(self) -> None:
|
|
20
|
+
out_file = self.args.out_file
|
|
21
|
+
if out_file is None and self.args.write:
|
|
22
|
+
out_file = self.args.file + '.pdf'
|
|
23
|
+
|
|
24
|
+
if out_file is not None:
|
|
25
|
+
if os.path.exists(out_file) and not self.args.overwrite:
|
|
26
|
+
raise OSError(f'File exists: {out_file}')
|
|
27
|
+
else:
|
|
28
|
+
out_file = tempfile.mktemp(suffix=os.path.basename(self.args.file) + '.pdf') # noqa
|
|
29
|
+
|
|
30
|
+
dot = subprocess.check_output([
|
|
31
|
+
sys.executable,
|
|
32
|
+
'-m', 'gprof2dot',
|
|
33
|
+
'-f', 'pstats',
|
|
34
|
+
self.args.file,
|
|
35
|
+
])
|
|
36
|
+
|
|
37
|
+
pdf = subprocess.check_output(
|
|
38
|
+
['dot', '-Tpdf'],
|
|
39
|
+
input=dot,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
with open(out_file, 'wb') as f:
|
|
43
|
+
f.write(pdf)
|
|
44
|
+
print(out_file)
|
|
45
|
+
|
|
46
|
+
if self.args.open:
|
|
47
|
+
subprocess.check_call(['open', out_file])
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
# @omlish-manifest
|
|
51
|
+
_CLI_MODULE = CliModule('prof', __name__)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
if __name__ == '__main__':
|
|
55
|
+
Cli()()
|
|
@@ -5,6 +5,8 @@ import sys
|
|
|
5
5
|
|
|
6
6
|
import docutils.core
|
|
7
7
|
|
|
8
|
+
from ..cli import CliModule
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
def rst2html(rst, report_level=None):
|
|
10
12
|
kwargs = {
|
|
@@ -40,5 +42,9 @@ def _main() -> None:
|
|
|
40
42
|
print(html)
|
|
41
43
|
|
|
42
44
|
|
|
45
|
+
# @omlish-manifest
|
|
46
|
+
_CLI_MODULE = CliModule('rst', __name__)
|
|
47
|
+
|
|
48
|
+
|
|
43
49
|
if __name__ == '__main__':
|
|
44
50
|
_main()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: omdev
|
|
3
|
-
Version: 0.0.0.
|
|
3
|
+
Version: 0.0.0.dev70
|
|
4
4
|
Summary: omdev
|
|
5
5
|
Author: wrmsr
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -12,15 +12,19 @@ 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.dev70
|
|
16
16
|
Provides-Extra: all
|
|
17
|
+
Requires-Dist: black~=24.10; extra == "all"
|
|
17
18
|
Requires-Dist: pycparser~=2.22; extra == "all"
|
|
18
19
|
Requires-Dist: cffi~=1.17; extra == "all"
|
|
19
20
|
Requires-Dist: pcpp~=1.30; extra == "all"
|
|
20
21
|
Requires-Dist: docutils~=0.21; extra == "all"
|
|
21
22
|
Requires-Dist: mypy~=1.11; extra == "all"
|
|
23
|
+
Requires-Dist: gprof2dot~=2024.6; extra == "all"
|
|
22
24
|
Requires-Dist: tokenize_rt~=6.0; extra == "all"
|
|
23
25
|
Requires-Dist: wheel~=0.44; extra == "all"
|
|
26
|
+
Provides-Extra: black
|
|
27
|
+
Requires-Dist: black~=24.10; extra == "black"
|
|
24
28
|
Provides-Extra: c
|
|
25
29
|
Requires-Dist: pycparser~=2.22; extra == "c"
|
|
26
30
|
Requires-Dist: cffi~=1.17; extra == "c"
|
|
@@ -29,6 +33,8 @@ Provides-Extra: docutils
|
|
|
29
33
|
Requires-Dist: docutils~=0.21; extra == "docutils"
|
|
30
34
|
Provides-Extra: mypy
|
|
31
35
|
Requires-Dist: mypy~=1.11; extra == "mypy"
|
|
36
|
+
Provides-Extra: prof
|
|
37
|
+
Requires-Dist: gprof2dot~=2024.6; extra == "prof"
|
|
32
38
|
Provides-Extra: tokens
|
|
33
39
|
Requires-Dist: tokenize_rt~=6.0; extra == "tokens"
|
|
34
40
|
Provides-Extra: wheel
|
|
@@ -69,11 +69,11 @@ omdev/cexts/_distutils/compilers/options.py
|
|
|
69
69
|
omdev/cexts/_distutils/compilers/unixccompiler.py
|
|
70
70
|
omdev/cli/__init__.py
|
|
71
71
|
omdev/cli/__main__.py
|
|
72
|
+
omdev/cli/_pathhack.py
|
|
72
73
|
omdev/cli/clicli.py
|
|
73
74
|
omdev/cli/install.py
|
|
74
75
|
omdev/cli/main.py
|
|
75
76
|
omdev/cli/managers.py
|
|
76
|
-
omdev/cli/pathhack.py
|
|
77
77
|
omdev/cli/types.py
|
|
78
78
|
omdev/interp/__init__.py
|
|
79
79
|
omdev/interp/__main__.py
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
omlish==0.0.0.
|
|
1
|
+
omlish==0.0.0.dev70
|
|
2
2
|
|
|
3
3
|
[all]
|
|
4
|
+
black~=24.10
|
|
4
5
|
pycparser~=2.22
|
|
5
6
|
cffi~=1.17
|
|
6
7
|
pcpp~=1.30
|
|
7
8
|
docutils~=0.21
|
|
8
9
|
mypy~=1.11
|
|
10
|
+
gprof2dot~=2024.6
|
|
9
11
|
tokenize_rt~=6.0
|
|
10
12
|
wheel~=0.44
|
|
11
13
|
|
|
14
|
+
[black]
|
|
15
|
+
black~=24.10
|
|
16
|
+
|
|
12
17
|
[c]
|
|
13
18
|
pycparser~=2.22
|
|
14
19
|
cffi~=1.17
|
|
@@ -20,6 +25,9 @@ docutils~=0.21
|
|
|
20
25
|
[mypy]
|
|
21
26
|
mypy~=1.11
|
|
22
27
|
|
|
28
|
+
[prof]
|
|
29
|
+
gprof2dot~=2024.6
|
|
30
|
+
|
|
23
31
|
[tokens]
|
|
24
32
|
tokenize_rt~=6.0
|
|
25
33
|
|
|
@@ -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.dev70'
|
|
16
16
|
classifiers = [
|
|
17
17
|
'License :: OSI Approved :: BSD License',
|
|
18
18
|
'Development Status :: 2 - Pre-Alpha',
|
|
@@ -22,19 +22,24 @@ classifiers = [
|
|
|
22
22
|
]
|
|
23
23
|
description = 'omdev'
|
|
24
24
|
dependencies = [
|
|
25
|
-
'omlish == 0.0.0.
|
|
25
|
+
'omlish == 0.0.0.dev70',
|
|
26
26
|
]
|
|
27
27
|
|
|
28
28
|
[project.optional-dependencies]
|
|
29
29
|
all = [
|
|
30
|
+
'black ~= 24.10',
|
|
30
31
|
'pycparser ~= 2.22',
|
|
31
32
|
'cffi ~= 1.17',
|
|
32
33
|
'pcpp ~= 1.30',
|
|
33
34
|
'docutils ~= 0.21',
|
|
34
35
|
'mypy ~= 1.11',
|
|
36
|
+
'gprof2dot ~= 2024.6',
|
|
35
37
|
'tokenize_rt ~= 6.0',
|
|
36
38
|
'wheel ~= 0.44',
|
|
37
39
|
]
|
|
40
|
+
black = [
|
|
41
|
+
'black ~= 24.10',
|
|
42
|
+
]
|
|
38
43
|
c = [
|
|
39
44
|
'pycparser ~= 2.22',
|
|
40
45
|
'cffi ~= 1.17',
|
|
@@ -46,6 +51,9 @@ docutils = [
|
|
|
46
51
|
mypy = [
|
|
47
52
|
'mypy ~= 1.11',
|
|
48
53
|
]
|
|
54
|
+
prof = [
|
|
55
|
+
'gprof2dot ~= 2024.6',
|
|
56
|
+
]
|
|
49
57
|
tokens = [
|
|
50
58
|
'tokenize_rt ~= 6.0',
|
|
51
59
|
]
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import io
|
|
2
|
-
import json
|
|
3
|
-
import os.path
|
|
4
|
-
import sys
|
|
5
|
-
|
|
6
|
-
from omlish import argparse as ap
|
|
7
|
-
|
|
8
|
-
from ..cli import CliModule
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class Cli(ap.Cli):
|
|
12
|
-
@ap.command(
|
|
13
|
-
ap.arg('file'),
|
|
14
|
-
ap.arg('-w', '--write', action='store_true'),
|
|
15
|
-
ap.arg('-o', '--overwrite', action='store_true'),
|
|
16
|
-
)
|
|
17
|
-
def code(self) -> None:
|
|
18
|
-
if self.args.write:
|
|
19
|
-
out_file = self.args.file.rpartition('.')[0] + '.py'
|
|
20
|
-
if os.path.isfile(out_file) and not self.args.overwrite:
|
|
21
|
-
raise OSError(f'File exists: {out_file}')
|
|
22
|
-
else:
|
|
23
|
-
out_file = None
|
|
24
|
-
|
|
25
|
-
with open(self.args.file) as f:
|
|
26
|
-
dct = json.load(f)
|
|
27
|
-
|
|
28
|
-
out = io.StringIO()
|
|
29
|
-
code_cells = [c for c in dct['cells'] if c['cell_type'] == 'code']
|
|
30
|
-
for i, c in enumerate(code_cells):
|
|
31
|
-
if i:
|
|
32
|
-
out.write('\n##\n\n')
|
|
33
|
-
out.write(''.join(c['source']))
|
|
34
|
-
out.write('\n')
|
|
35
|
-
|
|
36
|
-
if out_file is not None:
|
|
37
|
-
with open(out_file, 'w') as f:
|
|
38
|
-
f.write(out.getvalue())
|
|
39
|
-
print(f'Wrote {out_file}')
|
|
40
|
-
else:
|
|
41
|
-
sys.stdout.write(out.getvalue())
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
# @omlish-manifest
|
|
45
|
-
_CLI_MODULE = CliModule(['notebook', 'nb'], __name__)
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if __name__ == '__main__':
|
|
49
|
-
Cli()()
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|