lmod-toolkit 0.0.2__tar.gz → 0.0.4__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.
Files changed (24) hide show
  1. {lmod_toolkit-0.0.2/src/lmod_toolkit.egg-info → lmod_toolkit-0.0.4}/PKG-INFO +1 -1
  2. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/pyproject.toml +3 -3
  3. lmod_toolkit-0.0.4/src/lmod_toolkit/__init__.py +1 -0
  4. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/src/lmod_toolkit/_version.py +3 -3
  5. lmod_toolkit-0.0.4/src/lmod_toolkit/lmod_config.py +36 -0
  6. lmod_toolkit-0.0.4/src/lmod_toolkit/lmod_spider.py +54 -0
  7. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4/src/lmod_toolkit.egg-info}/PKG-INFO +1 -1
  8. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/src/lmod_toolkit.egg-info/SOURCES.txt +1 -0
  9. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/src/lmod_toolkit.egg-info/scm_file_list.json +1 -0
  10. lmod_toolkit-0.0.4/src/lmod_toolkit.egg-info/scm_version.json +8 -0
  11. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/utils/quickstart.sh +3 -3
  12. lmod_toolkit-0.0.2/src/lmod_toolkit/__init__.py +0 -1
  13. lmod_toolkit-0.0.2/src/lmod_toolkit/lmod_config.py +0 -34
  14. lmod_toolkit-0.0.2/src/lmod_toolkit.egg-info/scm_version.json +0 -8
  15. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/.github/workflows/publish-to-test-pypi.yml +0 -0
  16. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/.gitignore +0 -0
  17. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/README.md +0 -0
  18. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/README.pypi +0 -0
  19. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/setup.cfg +0 -0
  20. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/setup.sh +0 -0
  21. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/src/lmod_toolkit/build_helper.py +0 -0
  22. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/src/lmod_toolkit.egg-info/dependency_links.txt +0 -0
  23. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/src/lmod_toolkit.egg-info/top_level.txt +0 -0
  24. {lmod_toolkit-0.0.2 → lmod_toolkit-0.0.4}/utils/uv_installer.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lmod-toolkit
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: ACCESS Lmod Toolkit
5
5
  Author-email: Andy Loftus <aloftus@illinois.edu>, Eric Blau <blau@globus.org>
6
6
  Project-URL: Repository, https://github.com/access-ci-org/lmod-toolkit
@@ -1,5 +1,5 @@
1
1
  [build-system]
2
- requires = [ "setuptools >= 80", "setuptools-scm >= 8.3", "ipf >= 1.9" ]
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 = "ipf.build_helper:mk_version" # a published version must exist in pypi
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
@@ -0,0 +1 @@
1
+ from . import lmod_config, lmod_spider
@@ -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.2'
22
- __version_tuple__ = version_tuple = (0, 0, 2)
21
+ __version__ = version = '0.0.4'
22
+ __version_tuple__ = version_tuple = (0, 0, 4)
23
23
 
24
- __commit_id__ = commit_id = 'gdfb2970e9'
24
+ __commit_id__ = commit_id = 'g9727bc061'
@@ -0,0 +1,36 @@
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
+ return val
33
+
34
+
35
+ if __name__ == '__main__':
36
+ pprint.pprint( get_config() )
@@ -0,0 +1,54 @@
1
+ import functools
2
+ import json
3
+ import os
4
+ import pprint
5
+ import subprocess
6
+
7
+ from pathlib import Path
8
+
9
+ from lmod_toolkit import lmod_config
10
+
11
+
12
+ __all__ = [
13
+ 'as_json',
14
+ 'get_module_data',
15
+ 'get_module_files',
16
+ 'get_module_names',
17
+ ]
18
+
19
+
20
+ @functools.cache
21
+ def get_module_data():
22
+ prefix = lmod_config.prefix
23
+ libexec = Path( prefix , 'lmod' , 'lmod' , 'libexec' )
24
+ spider = libexec / 'spider'
25
+ try:
26
+ MODULEPATH = os.environ[ 'MODULEPATH' ] #will fail with KeyError if not found
27
+ except KeyError as e:
28
+ raise SystemExit( f"Missing environment variable 'MODULEPATH'\n{e}" )
29
+ cmds = [ 'bash', '-l', '-c', f"{spider} -o jsonSoftwarePage \"{MODULEPATH}\"" ]
30
+ result = subprocess.run(
31
+ cmds,
32
+ capture_output=True, # Captures both stdout and stderr
33
+ text=True # Returns strings instead of bytes
34
+ )
35
+ return json.loads( result.stdout )
36
+
37
+
38
+ def get_module_names():
39
+ return get_module_data().keys()
40
+
41
+
42
+ def get_module_files():
43
+ return [
44
+ v.keys()
45
+ for v in get_module_data().values()
46
+ ]
47
+
48
+
49
+ def as_json():
50
+ return json.dumps( get_module_data() )
51
+
52
+
53
+ if __name__ == '__main__':
54
+ pprint.pprint( get_module_data() )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lmod-toolkit
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: ACCESS Lmod Toolkit
5
5
  Author-email: Andy Loftus <aloftus@illinois.edu>, Eric Blau <blau@globus.org>
6
6
  Project-URL: Repository, https://github.com/access-ci-org/lmod-toolkit
@@ -8,6 +8,7 @@ src/lmod_toolkit/__init__.py
8
8
  src/lmod_toolkit/_version.py
9
9
  src/lmod_toolkit/build_helper.py
10
10
  src/lmod_toolkit/lmod_config.py
11
+ src/lmod_toolkit/lmod_spider.py
11
12
  src/lmod_toolkit.egg-info/PKG-INFO
12
13
  src/lmod_toolkit.egg-info/SOURCES.txt
13
14
  src/lmod_toolkit.egg-info/dependency_links.txt
@@ -9,6 +9,7 @@
9
9
  "src/lmod_toolkit/__init__.py",
10
10
  "src/lmod_toolkit/build_helper.py",
11
11
  "src/lmod_toolkit/lmod_config.py",
12
+ "src/lmod_toolkit/lmod_spider.py",
12
13
  "utils/quickstart.sh",
13
14
  "utils/uv_installer.sh"
14
15
  ]
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.0.4",
3
+ "distance": 0,
4
+ "node": "g9727bc061151dfc0466b13bd7510e0a30aeb40d1",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-11-13"
8
+ }
@@ -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/ipf)
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 +0,0 @@
1
- from . import lmod_config
@@ -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 )
@@ -1,8 +0,0 @@
1
- {
2
- "tag": "0.0.2",
3
- "distance": 0,
4
- "node": "gdfb2970e9e02eaebf8fa0c5fdb108c4ea816f8a7",
5
- "dirty": false,
6
- "branch": "HEAD",
7
- "node_date": "2026-11-12"
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes