lmod-toolkit 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.
@@ -0,0 +1,88 @@
1
+ # Adapted from:
2
+ # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
3
+
4
+ name: Publish Python 🐍 distribution 📦 to PyPI and TestPyPI
5
+
6
+ on:
7
+ push:
8
+ workflow_dispatch:
9
+
10
+ jobs:
11
+ build:
12
+ name: Build distribution 📦
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ with:
18
+ persist-credentials: false
19
+ fetch-depth: 0 # Fetch all history for all branches and tags
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: "3.x"
25
+
26
+ - name: Install pypa/build
27
+ run: >-
28
+ python3 -m
29
+ pip install
30
+ build
31
+ --user
32
+
33
+ - name: Build a binary wheel and a source tarball
34
+ run: python3 -m build
35
+
36
+ - name: Store the distribution packages
37
+ uses: actions/upload-artifact@v4
38
+ with:
39
+ name: python-package-distributions
40
+ path: dist/
41
+
42
+
43
+ publish-to-pypi:
44
+ name: >-
45
+ Publish Python 🐍 distribution 📦 to PyPI
46
+ if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
47
+ needs:
48
+ - build
49
+ runs-on: ubuntu-latest
50
+ environment:
51
+ name: pypi
52
+ url: https://pypi.org/p/ipf
53
+ permissions:
54
+ id-token: write # IMPORTANT: mandatory for trusted publishing
55
+ steps:
56
+ - name: Download all the dists
57
+ uses: actions/download-artifact@v4
58
+ with:
59
+ name: python-package-distributions
60
+ path: dist/
61
+
62
+ - name: Publish distribution 📦 to PyPI
63
+ uses: pypa/gh-action-pypi-publish@release/v1
64
+
65
+
66
+ publish-to-testpypi:
67
+ name: Publish Python 🐍 distribution 📦 to TestPyPI
68
+ needs:
69
+ - build
70
+ runs-on: ubuntu-latest
71
+
72
+ environment:
73
+ name: testpypi
74
+ url: https://test.pypi.org/p/ipf
75
+
76
+ permissions:
77
+ id-token: write # IMPORTANT: mandatory for trusted publishing
78
+
79
+ steps:
80
+ - name: Download all the dists
81
+ uses: actions/download-artifact@v4
82
+ with:
83
+ name: python-package-distributions
84
+ path: dist/
85
+ - name: Publish distribution 📦 to TestPyPI
86
+ uses: pypa/gh-action-pypi-publish@release/v1
87
+ with:
88
+ repository-url: https://test.pypi.org/legacy/
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: lmod_toolkit
3
+ Version: 0.0.1
4
+ Summary: ACCESS Lmod Toolkit
5
+ Author-email: Andy Loftus <aloftus@illinois.com>, Eric Blau <blau@globus.org>
6
+ Project-URL: Repository, https://github.com/access-ci-org/lmod-toolkit
7
+ Keywords: monitoring,information,gathering,publishing
8
+ Classifier: Development Status :: 1 - Planning
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Topic :: System :: Monitoring
11
+ Requires-Python: ==3.15.*
12
+ Description-Content-Type: text/markdown
13
+
14
+ # lmod toolkit (LMTK)
15
+ Tools for working with lmod
16
+
17
+ ## Project Home
18
+ https://github.com/access-ci-org/lmod-toolkit
19
+
20
+ ## Quick Install
21
+ 1. ` curl -o lmtk-setup.sh
22
+ https://raw.githubusercontent.com/access-ci-org/lmod-toolkit/refs/heads/main/setup.sh
23
+ `
24
+ 1. bash lmtk-setup.sh
25
+
26
+ ## Installation Guide
27
+ https://github.com/access-ci-org/lmod-toolkit
@@ -0,0 +1,7 @@
1
+ # lmod toolkit
2
+ Tools for working with lmod
3
+
4
+ ## Install
5
+ ` curl -o lmtk-setup.sh
6
+ https://raw.githubusercontent.com/access-ci-org/lmod-toolkit/refs/heads/main/setup.sh
7
+ `
@@ -0,0 +1,14 @@
1
+ # lmod toolkit (LMTK)
2
+ Tools for working with lmod
3
+
4
+ ## Project Home
5
+ https://github.com/access-ci-org/lmod-toolkit
6
+
7
+ ## Quick Install
8
+ 1. ` curl -o lmtk-setup.sh
9
+ https://raw.githubusercontent.com/access-ci-org/lmod-toolkit/refs/heads/main/setup.sh
10
+ `
11
+ 1. bash lmtk-setup.sh
12
+
13
+ ## Installation Guide
14
+ https://github.com/access-ci-org/lmod-toolkit
@@ -0,0 +1,43 @@
1
+ [build-system]
2
+ requires = [ "setuptools >= 80", "setuptools-scm >= 8.3", "ipf >= 1.9" ]
3
+ build-backend = "setuptools.build_meta:__legacy__"
4
+ # __legacy__ enables access to function in the local package
5
+ # see also https://setuptools-git-versioning.readthedocs.io/en/stable/options/version_callback.html
6
+
7
+ [project]
8
+ name = "lmod_toolkit"
9
+ requires-python = "==3.15.*"
10
+ dependencies = [
11
+ ]
12
+ dynamic = [
13
+ "version",
14
+ "readme",
15
+ ]
16
+ description = "ACCESS Lmod Toolkit"
17
+ license-files = ["LICEN[CS]E*"]
18
+ classifiers = [
19
+ "Development Status :: 1 - Planning",
20
+ "Programming Language :: Python :: 3",
21
+ "Topic :: System :: Monitoring",
22
+ ]
23
+ keywords = [
24
+ "monitoring",
25
+ "information",
26
+ "gathering",
27
+ "publishing",
28
+ ]
29
+ authors = [
30
+ {name = "Andy Loftus", email = "aloftus@illinois.com"},
31
+ {name = "Eric Blau", email = "blau@globus.org"},
32
+ ]
33
+
34
+ [project.urls]
35
+ Repository = "https://github.com/access-ci-org/lmod-toolkit"
36
+
37
+ [tool.setuptools.dynamic]
38
+ readme = {file = ["README.pypi"], content-type = "text/markdown"}
39
+
40
+ [tool.setuptools_scm]
41
+ version_file = "lmod_toolkit/_version.py"
42
+ version_scheme = "ipf.build_helper:mk_version"
43
+ local_scheme = "no-local-version" # local version component not allowed on pypi
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,183 @@
1
+ #!/bin/bash
2
+
3
+ YES=0 #no touchee
4
+ NO=1 #no touchee
5
+
6
+
7
+ # ###
8
+ # User might want to change these, though should use environment vars
9
+
10
+ INSTALL_DIR="${LMTK_INSTALL_DIR:-$HOME/lmod-toolkit}"
11
+ DEBUG=$YES
12
+ VERBOSE=$YES
13
+
14
+ # END OF USER CONFIGURABLE SECTION
15
+ # ###
16
+
17
+
18
+ # NO USER CHANGES AFTER THIS
19
+
20
+ GH_USER=access-ci-org
21
+ GH_REPO=lmod-toolkit
22
+ GH_BRANCH=main
23
+ UV_PYTHON=3.15 #python version preferred by lmod-toolkit
24
+ UV_DIR="${INSTALL_DIR}"/uv
25
+ UV="${UV_DIR}"/uv
26
+ VENV="$INSTALL_DIR"/.venv
27
+ V_PYTHON="$VENV"/bin/python
28
+ # SITE_PACKAGES= #created by mk_venv()
29
+ # LMTK_PATH= #created by mk_venv()
30
+ GREEN='\033[0;32m'
31
+ RED='\033[0;31m'
32
+ NC='\033[0m' # No Color
33
+
34
+
35
+ err() {
36
+ echo -e "${RED}✗ ERROR: $*${NC}"
37
+ }
38
+
39
+
40
+ success() {
41
+ echo -e "${GREEN}✓ $*${NC}"
42
+ }
43
+
44
+
45
+ die() {
46
+ err "$*"
47
+ echo "from (${BASH_SOURCE[1]} [${BASH_LINENO[0]}] ${FUNCNAME[1]})"
48
+ kill 0
49
+ exit 99
50
+ }
51
+
52
+
53
+ log() {
54
+ [[ $VERBOSE -eq $YES ]] || return 0
55
+ echo "INFO $*" >&2
56
+ }
57
+
58
+
59
+ debug() {
60
+ [[ $DEBUG -eq $YES ]] || return 0
61
+ echo "DEBUG (${BASH_SOURCE[1]} [${BASH_LINENO[0]}] ${FUNCNAME[1]}) $*"
62
+ }
63
+
64
+
65
+ install_uv() {
66
+ [[ $DEBUG -eq $YES ]] && set -x
67
+ [[ -f "${UV}" ]] || {
68
+ export UV_UNMANAGED_INSTALL="${UV_DIR}"
69
+ UV_URL=https://raw.githubusercontent.com/"${GH_USER}"/"${GH_REPO}"/refs/heads/"${GH_BRANCH}"/utils/uv_installer.sh
70
+ # allow override of UV_URL (uv installer script)
71
+ # [[ -n "${IPF_UV_URL}" ]] && UV_URL="${IPF_UV_URL}"
72
+ UV_INSTALLER="${UV_DIR}"/uv_installer.sh
73
+ curl -LsSf --create-dirs "${UV_URL}" -o "${UV_INSTALLER}"
74
+ sh "${UV_INSTALLER}" || die 'failed to install uv'
75
+ }
76
+ }
77
+
78
+
79
+ mk_venv() {
80
+ [[ $DEBUG -eq $YES ]] && set -x
81
+ [[ -d "$VENV" ]] || {
82
+ export UV_PYTHON_INSTALL_DIR="${UV_DIR}"/python
83
+ export UV_NO_CACHE=1
84
+ export UV_MANAGED_PYTHON=1
85
+ # allow override python version
86
+ # [[ -n "${IPF_UV_PYTHON}" ]] && UV_PYTHON="${IPF_UV_PYTHON}"
87
+ export UV_PYTHON
88
+ "$UV" venv "$VENV"
89
+ success "Python venv created at '$VENV'"
90
+ # "${V_PYTHON}" -m ensurepip
91
+ # success "Ensure native pip is available"
92
+ # "${V_PYTHON}" -m pip install --upgrade pip
93
+ # success "Updated to latest pip version"
94
+ }
95
+ SITE_PACKAGES=$(
96
+ "$V_PYTHON" -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])'
97
+ )
98
+ LMTK_PATH="$SITE_PACKAGES"/lmod_toolkit
99
+ }
100
+
101
+
102
+ is_pre_release_allowed() {
103
+ # to install the latest pre-release version: export LMTK_ALLOW_PRE_RELEASE=yes
104
+ [[ $DEBUG -eq $YES ]] && set -x
105
+ local _retval=$NO
106
+ if [[ "$LMTK_ALLOW_PRE_RELEASE" == "yes" \
107
+ || "$LMTK_ALLOW_PRE_RELEASE" == "YES" \
108
+ || "$LMTK_ALLOW_PRE_RELEASE" == "Y" \
109
+ || "$LMTK_ALLOW_PRE_RELEASE" == "y" \
110
+ || "$LMTK_ALLOW_PRE_RELEASE" -eq 1
111
+ ]] ; then
112
+ _retval=$YES
113
+ fi
114
+ return $_retval
115
+ }
116
+
117
+
118
+ install_pre_release() {
119
+ [[ $DEBUG -eq $YES ]] && set -x
120
+ is_pre_release_allowed || return
121
+ "${V_PYTHON}" -m pip install \
122
+ --upgrade \
123
+ --no-cache-dir \
124
+ --pre \
125
+ --no-deps \
126
+ --index-url https://test.pypi.org/simple/ \
127
+ lmod_toolkit"${LMTK_INSTALL_VERSION:+==$LMTK_INSTALL_VERSION}" \
128
+ && success "Installed dev version of lmod_toolkit"
129
+ }
130
+
131
+
132
+ install_lmod_toolkit() {
133
+ [[ $DEBUG -eq $YES ]] && set -x
134
+ "${V_PYTHON}" -m pip install \
135
+ --upgrade \
136
+ lmod_toolkit"${LMTK_INSTALL_VERSION:+==$LMTK_INSTALL_VERSION}" \
137
+ && success "Ipf and dependencies installed"
138
+ }
139
+
140
+
141
+ update_files() {
142
+ [[ $DEBUG -eq $YES ]] && set -x
143
+ # Update any files that need INSTALL_DIR
144
+ local _pattern='___INSTALL_DIR___'
145
+ local _replacement="$INSTALL_DIR"
146
+ grep -r --files-with-matches -F "$_pattern" "$LMTK_PATH" \
147
+ | while read; do
148
+ sed -i -e "s?$_pattern?$_replacement?" "$REPLY"
149
+ done
150
+ }
151
+
152
+
153
+ mk_symlinks() {
154
+ [[ $DEBUG -eq $YES ]] && set -x
155
+ pushd "$INSTALL_DIR"
156
+ local _symlink_dirs=( bin etc configure lib var )
157
+ # for d in "${_symlink_dirs[@]}"; do
158
+ # [[ -L $d ]] || ln -s "$LMTK_PATH"/$d
159
+ # done
160
+ popd
161
+ pushd "$INSTALL_DIR"/bin
162
+ ln -s "${V_PYTHON}"
163
+ popd
164
+ }
165
+
166
+
167
+ restore_config_links() {
168
+ [[ $DEBUG -eq $YES ]] && set -x
169
+ /bin/bash "$INSTALL_DIR"/bin/save_configs.sh
170
+ }
171
+
172
+
173
+ [[ $DEBUG -eq $YES ]] && set -x
174
+
175
+ install_uv
176
+
177
+ mk_venv
178
+
179
+ # update_files
180
+
181
+ # mk_symlinks
182
+
183
+ # restore_config_links
File without changes
@@ -0,0 +1,23 @@
1
+ from setuptools_scm.version import ScmVersion, guess_next_version
2
+ import time
3
+ def mk_version( version: ScmVersion ) -> str:
4
+ # setuptools_scm template options
5
+ # see also https://github.com/pypa/setuptools-scm/blob/main/setuptools-scm/src/setuptools_scm/version.py especially "def meta( ... )"
6
+ # '{branch}',
7
+ # '{dirty}',
8
+ # '{distance}',
9
+ # '{node}',
10
+ # '{node_date}',
11
+ # '{time}',
12
+ # SPEACIAL NAMES
13
+ # '{guessed}', #from version.py:format_next_version(...)
14
+
15
+ final = 'unknown'
16
+ if version.exact :
17
+ final = version.format_with( '{tag}' )
18
+ else :
19
+ # unix timestamp as dev qualifier, ensures it's always unique
20
+ # to comply with test.pypi.org requirement to NEVER re-use a version
21
+ fmt_str = '{guessed}.dev' + str(int(time.time()))
22
+ final = version.format_next_version( guess_next_version, fmt_str )
23
+ return final
@@ -0,0 +1,4 @@
1
+ import json
2
+
3
+ if __name__ == '__main__':
4
+ pass
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.4
2
+ Name: lmod_toolkit
3
+ Version: 0.0.1
4
+ Summary: ACCESS Lmod Toolkit
5
+ Author-email: Andy Loftus <aloftus@illinois.com>, Eric Blau <blau@globus.org>
6
+ Project-URL: Repository, https://github.com/access-ci-org/lmod-toolkit
7
+ Keywords: monitoring,information,gathering,publishing
8
+ Classifier: Development Status :: 1 - Planning
9
+ Classifier: Programming Language :: Python :: 3
10
+ Classifier: Topic :: System :: Monitoring
11
+ Requires-Python: ==3.15.*
12
+ Description-Content-Type: text/markdown
13
+
14
+ # lmod toolkit (LMTK)
15
+ Tools for working with lmod
16
+
17
+ ## Project Home
18
+ https://github.com/access-ci-org/lmod-toolkit
19
+
20
+ ## Quick Install
21
+ 1. ` curl -o lmtk-setup.sh
22
+ https://raw.githubusercontent.com/access-ci-org/lmod-toolkit/refs/heads/main/setup.sh
23
+ `
24
+ 1. bash lmtk-setup.sh
25
+
26
+ ## Installation Guide
27
+ https://github.com/access-ci-org/lmod-toolkit
@@ -0,0 +1,15 @@
1
+ README.md
2
+ README.pypi
3
+ pyproject.toml
4
+ setup.sh
5
+ .github/workflows/publish-to-test-pypi.yml
6
+ src/lmod-toolkit/__init__.py
7
+ src/lmod-toolkit/build_helper.py
8
+ src/lmod-toolkit/lmod_config.py
9
+ src/lmod_toolkit.egg-info/PKG-INFO
10
+ src/lmod_toolkit.egg-info/SOURCES.txt
11
+ src/lmod_toolkit.egg-info/dependency_links.txt
12
+ src/lmod_toolkit.egg-info/scm_file_list.json
13
+ src/lmod_toolkit.egg-info/scm_version.json
14
+ src/lmod_toolkit.egg-info/top_level.txt
15
+ utils/uv_installer.sh
@@ -0,0 +1,13 @@
1
+ {
2
+ "files": [
3
+ ".github/workflows/publish-to-test-pypi.yml",
4
+ "README.md",
5
+ "README.pypi",
6
+ "pyproject.toml",
7
+ "setup.sh",
8
+ "src/lmod-toolkit/__init__.py",
9
+ "src/lmod-toolkit/build_helper.py",
10
+ "src/lmod-toolkit/lmod_config.py",
11
+ "utils/uv_installer.sh"
12
+ ]
13
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "0.0.1",
3
+ "distance": 0,
4
+ "node": "g7caa8c7349c61bcde9f19609377db4f72366ff84",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-11-10"
8
+ }
@@ -0,0 +1 @@
1
+ lmod-toolkit