Skip to content

Commit

Permalink
2025-01-10T15:14:28Z
Browse files Browse the repository at this point in the history
  • Loading branch information
wrmsr committed Jan 10, 2025
1 parent b9349fd commit 88b8ff7
Show file tree
Hide file tree
Showing 6 changed files with 1,194 additions and 22 deletions.
4 changes: 2 additions & 2 deletions omdev/.manifests.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"module": ".cexts.cmake",
"attr": "_CLI_MODULE",
"file": "omdev/cexts/cmake.py",
"line": 323,
"line": 331,
"value": {
"$.cli.types.CliModule": {
"cmd_name": "cmake",
Expand All @@ -51,7 +51,7 @@
"module": ".cli.clicli",
"attr": "_CLI_MODULE",
"file": "omdev/cli/clicli.py",
"line": 138,
"line": 156,
"value": {
"$.cli.types.CliModule": {
"cmd_name": "cli",
Expand Down
16 changes: 12 additions & 4 deletions omdev/cexts/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@
- symlink headers, included src files (hamt_impl, ...)
- point / copy output to dst dirs
- libs
- ..
- pybind
- catch2?
- json? https://github.com/nlohmann/json
- FindPackages? FetchContent? built_ext won't have that
- move omml git / data retriever stuff into omdev, get just the one header file from git via sha?
- support local built pys
Libs:
- py
- pybind https://github.com/pybind/pybind11
- nanobind https://github.com/wjakob/nanobind
- test
- catch2 https://github.com/catchorg/Catch2
- ut https://github.com/boost-ext/ut
- json
- nlohmann https://github.com/nlohmann/json
- log
- spdlog https://github.com/gabime/spdlog
==
Done:
Expand Down
18 changes: 18 additions & 0 deletions omdev/cli/clicli.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import inspect
import os
import subprocess
import sys
import typing as ta
import urllib.parse
import urllib.request

from omlish import __about__
from omlish import lang
from omlish.argparse import all as ap

from ..pip import get_root_dists
Expand Down Expand Up @@ -88,6 +90,22 @@ def reinstall(self) -> None:

#

if lang.can_import('pip'):
print('Checking pip install')
subprocess.check_call([
sys.executable,
'-m',
'pip',
'install',
'--dry-run',
*deps,
])
print('Pip install check successful')
else:
print('Pip not present, cannot check install')

#

if deps:
print('Reinstalling with following additional dependencies:')
print('\n'.join(' ' + d for d in deps))
Expand Down
31 changes: 22 additions & 9 deletions ominfra/clouds/aws/models/gen/gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,38 @@ def get_referenced_shape_names(

#

PRIMITIVE_SHAPE_TYPES: ta.ClassVar[ta.Mapping[str, str]] = {
'boolean': 'bool',

'integer': 'int',
'long': 'int',

'double': 'float',

'blob': 'bytes',

'timestamp': '_base.Timestamp',
}

#

BASE_TYPE_ANNS: ta.ClassVar[ta.Mapping[str, str]] = {
'Boolean': 'bool',

'Integer': 'int',

'String': 'str',

'DateTime': '_base.DateTime',
'MillisecondDateTime': '_base.MillisecondDateTime',

'TagList': '_base.TagList',
}

BASE_SHAPE_NAMES: ta.ClassVar[ta.AbstractSet[str]] = set(BASE_TYPE_ANNS)

#

def get_type_ann(
self,
name: str,
Expand Down Expand Up @@ -230,7 +251,7 @@ def demangle_name(self, n: str) -> str:
def sanitize_class_name(self, n: str) -> str:
if hasattr(builtins, n):
n += '_'
return n
return n[0].upper() + n[1:]

#

Expand All @@ -255,14 +276,6 @@ def gen_preamble(self) -> str:

#

PRIMITIVE_SHAPE_TYPES: ta.ClassVar[ta.Mapping[str, str]] = {
'integer': 'int',
'long': 'int',
'blob': 'bytes',
'boolean': 'bool',
'timestamp': '_base.Timestamp',
}

@dc.dataclass(frozen=True)
class ShapeSrc:
src: str
Expand Down
Loading

0 comments on commit 88b8ff7

Please sign in to comment.