lmod-toolkit 0.0.2__tar.gz → 0.0.3__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.
- {lmod_toolkit-0.0.2/src/lmod_toolkit.egg-info → lmod_toolkit-0.0.3}/PKG-INFO +1 -1
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/pyproject.toml +3 -3
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/src/lmod_toolkit/_version.py +3 -3
- lmod_toolkit-0.0.3/src/lmod_toolkit/lmod_config.py +35 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3/src/lmod_toolkit.egg-info}/PKG-INFO +1 -1
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/src/lmod_toolkit.egg-info/scm_version.json +2 -2
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/utils/quickstart.sh +3 -3
- lmod_toolkit-0.0.2/src/lmod_toolkit/lmod_config.py +0 -34
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/.github/workflows/publish-to-test-pypi.yml +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/.gitignore +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/README.md +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/README.pypi +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/setup.cfg +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/setup.sh +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/src/lmod_toolkit/__init__.py +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/src/lmod_toolkit/build_helper.py +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/src/lmod_toolkit.egg-info/SOURCES.txt +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/src/lmod_toolkit.egg-info/dependency_links.txt +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/src/lmod_toolkit.egg-info/scm_file_list.json +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/src/lmod_toolkit.egg-info/top_level.txt +0 -0
- {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.3}/utils/uv_installer.sh +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = [ "setuptools >= 80", "setuptools-scm >= 8.3", "
|
|
2
|
+
requires = [ "setuptools >= 80", "setuptools-scm >= 8.3", "lmod-toolkit >= 0.0.2" ]
|
|
3
3
|
build-backend = "setuptools.build_meta:__legacy__"
|
|
4
4
|
# __legacy__ enables access to function in the local package
|
|
5
5
|
# see also https://setuptools-git-versioning.readthedocs.io/en/stable/options/version_callback.html
|
|
@@ -48,6 +48,6 @@ package-dir = {"" = "src"}
|
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
[tool.setuptools_scm]
|
|
51
|
-
version_file = "src/lmod_toolkit/_version.py"
|
|
52
|
-
version_scheme = "
|
|
51
|
+
version_file = "src/lmod_toolkit/_version.py" # path is relevant to repo top dir
|
|
52
|
+
version_scheme = "lmod_toolkit.build_helper:mk_version" # a published version must exist in pypi
|
|
53
53
|
local_scheme = "no-local-version" # local version component not allowed on pypi
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 0,
|
|
21
|
+
__version__ = version = '0.0.3'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 0, 3)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g82ce27c8d'
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
import json
|
|
3
|
+
import pprint
|
|
4
|
+
import subprocess
|
|
5
|
+
|
|
6
|
+
__all__ = [
|
|
7
|
+
'as_json',
|
|
8
|
+
'get_config',
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
@functools.cache
|
|
12
|
+
def get_config():
|
|
13
|
+
cmds = [ 'bash', '-l', '-c', 'module --config_json' ]
|
|
14
|
+
result = subprocess.run(
|
|
15
|
+
cmds,
|
|
16
|
+
capture_output=True, # Captures both stdout and stderr
|
|
17
|
+
text=True # Returns strings instead of bytes
|
|
18
|
+
)
|
|
19
|
+
return json.loads( result.stderr )
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def as_json():
|
|
23
|
+
return json.dumps( get_config() )
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def __getattr__( name ):
|
|
27
|
+
cfg = get_config()
|
|
28
|
+
try:
|
|
29
|
+
val = cfg['configT'][name]
|
|
30
|
+
except KeyError as e:
|
|
31
|
+
raise AttributeError( f"'{name}' not found" )
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
if __name__ == '__main__':
|
|
35
|
+
pprint.pprint( get_config() )
|
|
@@ -9,7 +9,7 @@ set -x
|
|
|
9
9
|
# where to save the installer script
|
|
10
10
|
LMTK_SETUP="${HOME}"/lmtk-setup.sh
|
|
11
11
|
|
|
12
|
-
# set to an absolute path (default is $HOME/
|
|
12
|
+
# set to an absolute path (default is $HOME/lmod-toolkit)
|
|
13
13
|
LMTK_INSTALL_DIR="${HOME}"/lmod-toolkit
|
|
14
14
|
|
|
15
15
|
# dont actually do anything, just print out a list of commands
|
|
@@ -17,7 +17,7 @@ LMTK_INSTALL_DIR="${HOME}"/lmod-toolkit
|
|
|
17
17
|
# MANUAL=yes
|
|
18
18
|
|
|
19
19
|
# set to "yes" or leave unset (defaults to latest)
|
|
20
|
-
LMTK_ALLOW_PRE_RELEASE=yes
|
|
20
|
+
# LMTK_ALLOW_PRE_RELEASE=yes
|
|
21
21
|
|
|
22
22
|
# specify an exact version of LMTK
|
|
23
23
|
# get version string from
|
|
@@ -27,7 +27,7 @@ LMTK_ALLOW_PRE_RELEASE=yes
|
|
|
27
27
|
# LMTK_INSTALL_VERSION=0.0.2
|
|
28
28
|
|
|
29
29
|
# either a branch name or leave unset (defaults to main)
|
|
30
|
-
LMTK_GIT_BRANCH=poc
|
|
30
|
+
# LMTK_GIT_BRANCH=poc
|
|
31
31
|
|
|
32
32
|
# specify a specific version of python if needed
|
|
33
33
|
# LMTK_UV_PYTHON=3.15
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import json
|
|
2
|
-
import subprocess
|
|
3
|
-
import pprint
|
|
4
|
-
import functools
|
|
5
|
-
|
|
6
|
-
__all__ = [
|
|
7
|
-
'Lmod_Config',
|
|
8
|
-
]
|
|
9
|
-
|
|
10
|
-
class Lmod_Config :
|
|
11
|
-
def __init__( self ):
|
|
12
|
-
self.raw = None
|
|
13
|
-
self.config = None
|
|
14
|
-
self._load()
|
|
15
|
-
|
|
16
|
-
def _load( self ):
|
|
17
|
-
cmds = [ 'bash', '-l', '-c', 'module --config_json' ]
|
|
18
|
-
result = subprocess.run(
|
|
19
|
-
cmds,
|
|
20
|
-
capture_output=True, # Captures both stdout and stderr
|
|
21
|
-
text=True # Returns strings instead of bytes
|
|
22
|
-
)
|
|
23
|
-
# pprint.pprint( ['STDOUT', result.stdout] )
|
|
24
|
-
# pprint.pprint( ['STDERR', result.stderr] )
|
|
25
|
-
self.config = json.loads( result.stderr )
|
|
26
|
-
|
|
27
|
-
@functools.cached_property
|
|
28
|
-
def get_key( self, key ):
|
|
29
|
-
return self.config[ key ]
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
if __name__ == '__main__':
|
|
33
|
-
lmc = Lmod_Config()
|
|
34
|
-
pprint.pprint( lmc.config )
|
|
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
|