5bb-task 3.42.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,207 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+ #poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ #pdm.lock
116
+ #pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ #pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,54 @@
1
+ Metadata-Version: 2.4
2
+ Name: 5bb-task
3
+ Version: 3.42.1
4
+ Summary: Task – a task runner / simpler Make alternative, packaged for easy installation via pip/uv
5
+ Project-URL: Homepage, https://github.com/5-bare-bones/toolbox__monorepo
6
+ Project-URL: Source, https://github.com/go-task/task
7
+ License: MIT
8
+ Keywords: automation,cli,make,task,taskfile
9
+ Classifier: Development Status :: 4 - Beta
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Software Development :: Build Tools
16
+ Classifier: Topic :: Utilities
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+
20
+ # 5bb-task
21
+
22
+ > **task** – a task runner / simpler Make alternative from [Taskfile.dev](https://taskfile.dev), distributed via PyPI/uv.
23
+
24
+ This package downloads and installs the [`task`](https://github.com/go-task/task) binary for your platform on first use. No compilation required.
25
+
26
+ ## Installation
27
+
28
+ ```bash
29
+ uv tool install 5bb-task
30
+ # or
31
+ pip install 5bb-task
32
+ ```
33
+
34
+ ## Usage
35
+
36
+ ```bash
37
+ task --list # list all available tasks
38
+ task build # run the 'build' task
39
+ task test # run the 'test' task
40
+ ```
41
+
42
+ The binary is downloaded from the official GitHub releases on first run and cached in `~/.cache/5bb-task/`.
43
+
44
+ ## Configuration
45
+
46
+ Set `BB_CACHE_DIR` to override the cache location:
47
+
48
+ ```bash
49
+ BB_CACHE_DIR=/opt/tools task build
50
+ ```
51
+
52
+ ## License
53
+
54
+ MIT – see the [LICENSE](../../LICENSE) file for details.
@@ -0,0 +1,35 @@
1
+ # 5bb-task
2
+
3
+ > **task** – a task runner / simpler Make alternative from [Taskfile.dev](https://taskfile.dev), distributed via PyPI/uv.
4
+
5
+ This package downloads and installs the [`task`](https://github.com/go-task/task) binary for your platform on first use. No compilation required.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ uv tool install 5bb-task
11
+ # or
12
+ pip install 5bb-task
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ ```bash
18
+ task --list # list all available tasks
19
+ task build # run the 'build' task
20
+ task test # run the 'test' task
21
+ ```
22
+
23
+ The binary is downloaded from the official GitHub releases on first run and cached in `~/.cache/5bb-task/`.
24
+
25
+ ## Configuration
26
+
27
+ Set `BB_CACHE_DIR` to override the cache location:
28
+
29
+ ```bash
30
+ BB_CACHE_DIR=/opt/tools task build
31
+ ```
32
+
33
+ ## License
34
+
35
+ MIT – see the [LICENSE](../../LICENSE) file for details.
@@ -0,0 +1,35 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "5bb-task"
7
+ version = "3.42.1"
8
+ description = "Task – a task runner / simpler Make alternative, packaged for easy installation via pip/uv"
9
+ readme = "README.md"
10
+ requires-python = ">=3.11"
11
+ license = { text = "MIT" }
12
+ keywords = ["task", "taskfile", "make", "automation", "cli"]
13
+ classifiers = [
14
+ "Development Status :: 4 - Beta",
15
+ "Environment :: Console",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Operating System :: OS Independent",
19
+ "Programming Language :: Python :: 3",
20
+ "Topic :: Software Development :: Build Tools",
21
+ "Topic :: Utilities",
22
+ ]
23
+
24
+ [project.urls]
25
+ Homepage = "https://github.com/5-bare-bones/toolbox__monorepo"
26
+ Source = "https://github.com/go-task/task"
27
+
28
+ [project.scripts]
29
+ task = "bb_task:run"
30
+
31
+ [tool.hatch.build.targets.wheel]
32
+ packages = ["src/bb_task"]
33
+
34
+ [tool.hatch.build.targets.sdist]
35
+ include = ["src/", "README.md"]
@@ -0,0 +1,129 @@
1
+ """
2
+ bb_task – thin Python wrapper around ``task``, the task runner from
3
+ Taskfile.dev (a simpler Make alternative written in Go).
4
+
5
+ On first use the appropriate pre-built binary is downloaded from the
6
+ official GitHub release page and cached in ``~/.cache/5bb-task/``.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import os
12
+ import platform
13
+ import stat
14
+ import subprocess
15
+ import sys
16
+ import tarfile
17
+ import urllib.request
18
+ from pathlib import Path
19
+
20
+ __version__ = "3.49.1"
21
+ _TASK_VERSION = __version__
22
+
23
+ # ---------------------------------------------------------------------------
24
+ # Platform detection helpers
25
+ # ---------------------------------------------------------------------------
26
+
27
+ def _arch() -> str:
28
+ machine = platform.machine().lower()
29
+ if machine in ("x86_64", "amd64"):
30
+ return "amd64"
31
+ if machine in ("i386", "i686"):
32
+ return "386"
33
+ if machine in ("aarch64", "arm64"):
34
+ return "arm64"
35
+ if machine.startswith("arm"):
36
+ return "arm"
37
+ return machine
38
+
39
+
40
+ def _os_name() -> str:
41
+ system = platform.system().lower()
42
+ if system == "darwin":
43
+ return "darwin"
44
+ if system == "windows":
45
+ return "windows"
46
+ return "linux"
47
+
48
+
49
+ def _binary_name() -> str:
50
+ return "task.exe" if platform.system().lower() == "windows" else "task"
51
+
52
+
53
+ def _asset_name() -> str:
54
+ ext = "zip" if platform.system().lower() == "windows" else "tar.gz"
55
+ return f"task_{_os_name()}_{_arch()}.{ext}"
56
+
57
+
58
+ def _download_url() -> str:
59
+ return (
60
+ f"https://github.com/go-task/task/releases/download"
61
+ f"/v{_TASK_VERSION}/{_asset_name()}"
62
+ )
63
+
64
+
65
+ # ---------------------------------------------------------------------------
66
+ # Binary management
67
+ # ---------------------------------------------------------------------------
68
+
69
+ def _cache_dir() -> Path:
70
+ return Path(os.environ.get("BB_CACHE_DIR", Path.home() / ".cache")) / "5bb-task"
71
+
72
+
73
+ def _binary_path() -> Path:
74
+ return _cache_dir() / _binary_name()
75
+
76
+
77
+ def ensure_binary() -> Path:
78
+ """Return the path to the task binary, downloading it if necessary."""
79
+ binary = _binary_path()
80
+ if binary.exists():
81
+ return binary
82
+
83
+ binary.parent.mkdir(parents=True, exist_ok=True)
84
+ url = _download_url()
85
+ asset_name = _asset_name()
86
+ tmp_archive = binary.parent / asset_name
87
+
88
+ print(f"[5bb-task] Downloading task v{_TASK_VERSION} …", file=sys.stderr)
89
+ try:
90
+ urllib.request.urlretrieve(url, tmp_archive) # noqa: S310
91
+ except Exception as exc: # pragma: no cover
92
+ raise SystemExit(
93
+ f"[5bb-task] Failed to download {url}: {exc}"
94
+ ) from exc
95
+
96
+ if asset_name.endswith(".tar.gz"):
97
+ with tarfile.open(tmp_archive, "r:gz") as tar:
98
+ for member in tar.getmembers():
99
+ if member.name == _binary_name() or member.name.endswith(
100
+ f"/{_binary_name()}"
101
+ ):
102
+ member.name = _binary_name()
103
+ tar.extract(member, binary.parent) # noqa: S202
104
+ break
105
+ else:
106
+ # Windows .zip
107
+ import zipfile
108
+
109
+ with zipfile.ZipFile(tmp_archive, "r") as zf:
110
+ zf.extract(_binary_name(), binary.parent)
111
+
112
+ tmp_archive.unlink(missing_ok=True)
113
+
114
+ # Ensure the binary is executable.
115
+ binary.chmod(binary.stat().st_mode | stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH)
116
+ return binary
117
+
118
+
119
+ # ---------------------------------------------------------------------------
120
+ # Entry point
121
+ # ---------------------------------------------------------------------------
122
+
123
+ def run() -> None:
124
+ """CLI entry point – delegates all arguments to the task binary."""
125
+ binary = ensure_binary()
126
+ args = [str(binary)] + sys.argv[1:]
127
+ if platform.system().lower() == "windows":
128
+ sys.exit(subprocess.call(args))
129
+ os.execv(str(binary), args)