korml 0.0.1__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.
- korml-0.0.1/.gitignore.local +6 -0
- korml-0.0.1/.nvimrc +130 -0
- korml-0.0.1/.ycm_extra_conf.py +79 -0
- korml-0.0.1/PKG-INFO +18 -0
- korml-0.0.1/pyproject.toml +90 -0
- korml-0.0.1/readme.md +7 -0
- korml-0.0.1/src/korml/metadata.py +7 -0
korml-0.0.1/.nvimrc
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
function! s:insert_license_slash()
|
|
2
|
+
set formatoptions-=cro
|
|
3
|
+
execute "normal! i// -----------------------------------------------------------------------------"
|
|
4
|
+
execute "normal! o// SPDX-License-Identifier: Apache-2.0"
|
|
5
|
+
execute "normal! o// Copyright (C) 2025 Jayesh Badwaik <j.badwaik@fz-juelich.de>"
|
|
6
|
+
execute "normal! o// -----------------------------------------------------------------------------"
|
|
7
|
+
normal! o
|
|
8
|
+
set formatoptions+=cro
|
|
9
|
+
endfunction
|
|
10
|
+
|
|
11
|
+
function! s:insert_license_hash()
|
|
12
|
+
set formatoptions-=cro
|
|
13
|
+
execute "normal! i# ------------------------------------------------------------------------------"
|
|
14
|
+
execute "normal! o# SPDX-License-Identifier: Apache-2.0"
|
|
15
|
+
execute "normal! o# Copyright (C) 2025 Jayesh Badwaik <j.badwaik@fz-juelich.de>"
|
|
16
|
+
execute "normal! o# ------------------------------------------------------------------------------"
|
|
17
|
+
set formatoptions+=cro
|
|
18
|
+
endfunction
|
|
19
|
+
|
|
20
|
+
function! s:insert_license_percent()
|
|
21
|
+
set formatoptions-=cro
|
|
22
|
+
execute "normal! i% ------------------------------------------------------------------------------"
|
|
23
|
+
execute "normal! o% SPDX-License-Identifier: Apache-2.0"
|
|
24
|
+
execute "normal! o% Copyright (C) 2025 Jayesh Badwaik <j.badwaik@fz-juelich.de>"
|
|
25
|
+
execute "normal! o% ------------------------------------------------------------------------------"
|
|
26
|
+
set formatoptions+=cro
|
|
27
|
+
endfunction
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
function! s:insert_license_quote()
|
|
31
|
+
set formatoptions-=cro
|
|
32
|
+
execute "normal! i\" -----------------------------------------------------------------------------"
|
|
33
|
+
execute "normal! o\" SPDX-License-Identifier: Apache-2.0"
|
|
34
|
+
execute "normal! o\" Copyright (C) 2025 Jayesh Badwaik <j.badwaik@fz-juelich.de>"
|
|
35
|
+
execute "normal! o\" -----------------------------------------------------------------------------"
|
|
36
|
+
set formatoptions+=cro
|
|
37
|
+
endfunction
|
|
38
|
+
|
|
39
|
+
function! s:insert_license_html()
|
|
40
|
+
set formatoptions-=cro
|
|
41
|
+
execute "normal! i<!--"
|
|
42
|
+
execute "normal! o- SPDX-License-Identifier: Apache-2.0"
|
|
43
|
+
execute "normal! o- Copyright (C) 2025 Jayesh Badwaik <j.badwaik@fz-juelich.de>"
|
|
44
|
+
execute "normal! o-->"
|
|
45
|
+
set formatoptions+=cro
|
|
46
|
+
endfunction
|
|
47
|
+
|
|
48
|
+
function! Insert_license_slash()
|
|
49
|
+
execute "normal! O"
|
|
50
|
+
call s:insert_license_cpp()
|
|
51
|
+
endfunction
|
|
52
|
+
|
|
53
|
+
function! Insert_license_hash()
|
|
54
|
+
execute "normal! O"
|
|
55
|
+
call s:insert_license_hash()
|
|
56
|
+
endfunction
|
|
57
|
+
|
|
58
|
+
function! Insert_license_percent()
|
|
59
|
+
execute "normal! O"
|
|
60
|
+
call s:insert_license_percent()
|
|
61
|
+
endfunction
|
|
62
|
+
|
|
63
|
+
function! Insert_license_quote()
|
|
64
|
+
execute "normal! O"
|
|
65
|
+
call s:insert_license_quote()
|
|
66
|
+
endfunction
|
|
67
|
+
|
|
68
|
+
function! Insert_license_html()
|
|
69
|
+
execute "normal! O"
|
|
70
|
+
call s:insert_license_html()
|
|
71
|
+
endfunction
|
|
72
|
+
|
|
73
|
+
autocmd BufNewFile *.{cuh} call <SID>insert_license_slash()
|
|
74
|
+
autocmd BufNewFile *.{cuhpp} call <SID>insert_license_slash()
|
|
75
|
+
autocmd BufNewFile *.{h} call <SID>insert_license_slash()
|
|
76
|
+
autocmd BufNewFile *.{c} call <SID>insert_license_slash()
|
|
77
|
+
autocmd BufNewFile *.{hpp} call <SID>insert_license_slash()
|
|
78
|
+
autocmd BufNewFile *.{cpp} call <SID>insert_license_slash()
|
|
79
|
+
autocmd BufNewFile *.{cu} call <SID>insert_license_slash()
|
|
80
|
+
autocmd BufNewFile *.{ipp} call <SID>insert_license_slash()
|
|
81
|
+
autocmd BufNewFile *.{rs} call <SID>insert_license_slash()
|
|
82
|
+
|
|
83
|
+
autocmd BufNewFile CMakeLists.txt call <SID>insert_license_hash()
|
|
84
|
+
autocmd BufNewFile *.cmake call <SID>insert_license_hash()
|
|
85
|
+
autocmd BufNewFile *.{sh} call <SID>insert_license_hash()
|
|
86
|
+
autocmd BufNewFile *.{py} call <SID>insert_license_hash()
|
|
87
|
+
autocmd BufNewFile *.{toml} call <SID>insert_license_hash()
|
|
88
|
+
autocmd BufNewFile *.{yml} call <SID>insert_license_hash()
|
|
89
|
+
|
|
90
|
+
autocmd BufNewFile *.{md} call <SID>insert_license_html()
|
|
91
|
+
|
|
92
|
+
autocmd BufNewFile *.{tex} call <SID>insert_license_percent()
|
|
93
|
+
autocmd BufNewFile *.{sty} call <SID>insert_license_percent()
|
|
94
|
+
autocmd BufNewFile *.{cls} call <SID>insert_license_percent()
|
|
95
|
+
|
|
96
|
+
" Remove Trailing Whitespace on Save
|
|
97
|
+
autocmd BufWritePre * %s/\s\+$//e
|
|
98
|
+
|
|
99
|
+
" Show trailing whitespace:
|
|
100
|
+
highlight ExtraWhitespace ctermbg=red guibg=red
|
|
101
|
+
autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=red
|
|
102
|
+
match ExtraWhitespace /\s\+$/
|
|
103
|
+
|
|
104
|
+
function! Insert_header_guard()
|
|
105
|
+
execute "normal! O"
|
|
106
|
+
call s:insert_header_guard()
|
|
107
|
+
endfunction
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
autocmd BufNewFile *.{cuh} call <SID>insert_header_guard()
|
|
111
|
+
autocmd BufNewFile *.{cuhpp} call <SID>insert_header_guard()
|
|
112
|
+
autocmd BufNewFile *.{h} call <SID>insert_header_guard()
|
|
113
|
+
autocmd BufNewFile *.{hpp} call <SID>insert_header_guard()
|
|
114
|
+
autocmd BufNewFile *.{hip} call <SID>insert_header_guard()
|
|
115
|
+
|
|
116
|
+
" Automatic C / C++ header guards
|
|
117
|
+
function! s:insert_header_guard()
|
|
118
|
+
set formatoptions-=cro
|
|
119
|
+
let gatename_0 = substitute(substitute(toupper(@%), "\\.", "_", "g"), "/", "_", "g")
|
|
120
|
+
let gatename_1 = substitute(gatename_0, "SRC_INCLUDE_", "", "g")
|
|
121
|
+
let gatename_2 = substitute(gatename_1, "TEST_COMMON_INCLUDE_", "", "g")
|
|
122
|
+
let gatename_3 = substitute(gatename_2, "BENCH_COMMON_INCLUDE_", "", "g")
|
|
123
|
+
let gatename = gatename_3
|
|
124
|
+
execute "normal! o#ifndef " . gatename
|
|
125
|
+
execute "normal! o#define " . gatename
|
|
126
|
+
normal! o
|
|
127
|
+
execute "normal! Go#endif // " . gatename
|
|
128
|
+
set formatoptions-=cro
|
|
129
|
+
normal! k
|
|
130
|
+
endfunction
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import ycm_core
|
|
3
|
+
import subprocess
|
|
4
|
+
import glob
|
|
5
|
+
|
|
6
|
+
cxxflags = [
|
|
7
|
+
"-Weverything",
|
|
8
|
+
"-Wno-c++98-compat",
|
|
9
|
+
"-Wno-c++98-compat-pedantic",
|
|
10
|
+
"-Wno-covered-switch-default",
|
|
11
|
+
"-Wno-padded",
|
|
12
|
+
"-Wno-weak-vtables",
|
|
13
|
+
"-Wno-exit-time-destructors",
|
|
14
|
+
"-Wno-global-constructors",
|
|
15
|
+
# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
|
|
16
|
+
# source code needs it.
|
|
17
|
+
"-DUSE_CLANG_COMPLETER",
|
|
18
|
+
"-std=c++20",
|
|
19
|
+
"-x",
|
|
20
|
+
"c++",
|
|
21
|
+
"-stdlib=libc++",
|
|
22
|
+
"-Isrc/include/",
|
|
23
|
+
"-Itest/common/include/",
|
|
24
|
+
"-DDGALE_RUN_CLANG_TIDY",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
cflags = [
|
|
28
|
+
"-Wextra",
|
|
29
|
+
"-Wall",
|
|
30
|
+
# You 100% do NOT need -DUSE_CLANG_COMPLETER in your flags; only the YCM
|
|
31
|
+
# source code needs it.
|
|
32
|
+
"-DUSE_CLANG_COMPLETER",
|
|
33
|
+
"-std=c11",
|
|
34
|
+
"-x",
|
|
35
|
+
"c",
|
|
36
|
+
"-Isrc/include/",
|
|
37
|
+
"-Itest/common/include/",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
def MakeRelativePathsInFlagsAbsolute(flags, working_directory):
|
|
41
|
+
if not working_directory:
|
|
42
|
+
return list(flags)
|
|
43
|
+
new_flags = []
|
|
44
|
+
make_next_absolute = False
|
|
45
|
+
path_flags = ["-isystem", "-I", "-iquote", "--sysroot="]
|
|
46
|
+
for flag in flags:
|
|
47
|
+
new_flag = flag
|
|
48
|
+
|
|
49
|
+
if make_next_absolute:
|
|
50
|
+
make_next_absolute = False
|
|
51
|
+
if not flag.startswith("/"):
|
|
52
|
+
new_flag = os.path.join(working_directory, flag)
|
|
53
|
+
|
|
54
|
+
for path_flag in path_flags:
|
|
55
|
+
if flag == path_flag:
|
|
56
|
+
make_next_absolute = True
|
|
57
|
+
break
|
|
58
|
+
|
|
59
|
+
if flag.startswith(path_flag):
|
|
60
|
+
path = flag[len(path_flag) :]
|
|
61
|
+
new_flag = path_flag + os.path.join(working_directory, path)
|
|
62
|
+
break
|
|
63
|
+
|
|
64
|
+
if new_flag:
|
|
65
|
+
new_flags.append(new_flag)
|
|
66
|
+
return new_flags
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def Settings(filename, **kwargs):
|
|
70
|
+
relative_to = os.path.dirname(os.path.abspath(__file__))
|
|
71
|
+
extension = os.path.splitext(filename)[1]
|
|
72
|
+
flags = []
|
|
73
|
+
print(extension)
|
|
74
|
+
if extension == ".c" or extension == ".h":
|
|
75
|
+
flags = cflags
|
|
76
|
+
else:
|
|
77
|
+
flags = cxxflags
|
|
78
|
+
final_flags = MakeRelativePathsInFlagsAbsolute(flags, relative_to)
|
|
79
|
+
return {"flags": final_flags}
|
korml-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: korml
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A korml Parser and Emitter
|
|
5
|
+
Project-URL: Source, https://ambhora.codes/software/korml
|
|
6
|
+
Author-email: Jayesh Badwaik <j.badwaik@fz-juelich.de>
|
|
7
|
+
License-Expression: Apache-2.0
|
|
8
|
+
Requires-Dist: pexpect
|
|
9
|
+
Requires-Dist: semver
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
<!--
|
|
13
|
+
- SPDX-License-Identifier: Apache-2.0
|
|
14
|
+
- Copyright (C) 2025 Jayesh Badwaik <j.badwaik@fz-juelich.de>
|
|
15
|
+
-->
|
|
16
|
+
|
|
17
|
+
# kaml - A kaml Parser and Emitter in Python
|
|
18
|
+
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
# Copyright (C) 2025 Jayesh Badwaik <j.badwaik@fz-juelich.de>
|
|
4
|
+
# ------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
[project]
|
|
7
|
+
name = "korml"
|
|
8
|
+
dynamic = ["version"]
|
|
9
|
+
description = 'A korml Parser and Emitter'
|
|
10
|
+
readme = "readme.md"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Jayesh Badwaik", email = "j.badwaik@fz-juelich.de" },
|
|
14
|
+
]
|
|
15
|
+
dependencies = [
|
|
16
|
+
"semver",
|
|
17
|
+
"pexpect"
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
Source = "https://ambhora.codes/software/korml"
|
|
22
|
+
|
|
23
|
+
[project.scripts]
|
|
24
|
+
korml = "korml.cli:main"
|
|
25
|
+
|
|
26
|
+
# --------------------------------------------------------------------------------------------------
|
|
27
|
+
# Hatch configuration
|
|
28
|
+
# --------------------------------------------------------------------------------------------------
|
|
29
|
+
[tool.hatch.version]
|
|
30
|
+
path = "src/korml/metadata.py"
|
|
31
|
+
|
|
32
|
+
[build-system]
|
|
33
|
+
requires = ["hatchling"]
|
|
34
|
+
build-backend = "hatchling.build"
|
|
35
|
+
|
|
36
|
+
[tool.hatch.build.targets.wheel]
|
|
37
|
+
packages = ["src/korml"]
|
|
38
|
+
|
|
39
|
+
[tool.hatch.build.targets.wheel.shared-data]
|
|
40
|
+
"share"="share"
|
|
41
|
+
|
|
42
|
+
# --------------------------------------------------------------------------------------------------
|
|
43
|
+
# PyTest configuration
|
|
44
|
+
# --------------------------------------------------------------------------------------------------
|
|
45
|
+
[tool.pytest.ini_options]
|
|
46
|
+
pythonpath = ["src"]
|
|
47
|
+
addopts = "--cov --cov-report term-missing --cov-fail-under=10"
|
|
48
|
+
|
|
49
|
+
[tool.black]
|
|
50
|
+
line-length = 100
|
|
51
|
+
|
|
52
|
+
[tool.hatch.envs.test]
|
|
53
|
+
dependencies = [
|
|
54
|
+
"pytest>=6.3",
|
|
55
|
+
"pytest-cov"
|
|
56
|
+
]
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
[tool.hatch.envs.mypy]
|
|
60
|
+
dependencies = [
|
|
61
|
+
"types-PyYAML",
|
|
62
|
+
"mypy",
|
|
63
|
+
"semver",
|
|
64
|
+
"pytest",
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
[tool.hatch.envs.doc]
|
|
68
|
+
dependencies = [
|
|
69
|
+
"mkdocs-material",
|
|
70
|
+
"mkdocstrings[python]",
|
|
71
|
+
"mkdocs-awesome-nav",
|
|
72
|
+
"mkdocs-add-number-plugin",
|
|
73
|
+
"gitpython",
|
|
74
|
+
"pyyaml",
|
|
75
|
+
"pymdown-extensions",
|
|
76
|
+
"mkdocs-gen-files",
|
|
77
|
+
"mkdocs-awesome-pages-plugin",
|
|
78
|
+
"mkdocs-macros-plugin",
|
|
79
|
+
"mkdocs-pagetree-plugin",
|
|
80
|
+
"mkdocs-git-authors-plugin",
|
|
81
|
+
"mkdocs-git-revision-date-localized-plugin"
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
[tool.hatch.envs.format]
|
|
86
|
+
dependencies = [
|
|
87
|
+
"black"
|
|
88
|
+
]
|
|
89
|
+
|
|
90
|
+
|
korml-0.0.1/readme.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# ------------------------------------------------------------------------------
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
# Copyright (C) 2025 Jayesh Badwaik <j.badwaik@fz-juelich.de>
|
|
4
|
+
# ------------------------------------------------------------------------------
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
__version__ = "0.0.1"
|