trainwave-cli 0.2.8__tar.gz → 0.3.0__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.
- trainwave_cli-0.3.0/.dockerignore +21 -0
- trainwave_cli-0.3.0/.gitignore +129 -0
- trainwave_cli-0.3.0/.gitlab-ci.yml +25 -0
- trainwave_cli-0.3.0/Makefile +144 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/PKG-INFO +28 -32
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/README.md +4 -4
- trainwave_cli-0.3.0/example/requirements.txt +1 -0
- trainwave_cli-0.3.0/example/run +4 -0
- trainwave_cli-0.3.0/example/run.sh +4 -0
- trainwave_cli-0.3.0/example/setup.sh +4 -0
- trainwave_cli-0.3.0/example/train.py +49 -0
- trainwave_cli-0.3.0/example/trainwave.toml +13 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/pyproject.toml +41 -42
- trainwave_cli-0.3.0/pyrightconfig.json +4 -0
- trainwave_cli-0.3.0/ruff.toml +79 -0
- trainwave_cli-0.3.0/tests/cli/test_auth.py +173 -0
- trainwave_cli-0.3.0/tests/cli/test_jobs.py +196 -0
- trainwave_cli-0.3.0/tests/cli/test_secrets.py +177 -0
- trainwave_cli-0.3.0/tests/cli/test_setup.py +151 -0
- trainwave_cli-0.3.0/tests/conftest.py +21 -0
- trainwave_cli-0.3.0/tests/test_api.py +463 -0
- trainwave_cli-0.3.0/tests/test_io.py +80 -0
- trainwave_cli-0.3.0/tests/test_main.py +90 -0
- trainwave_cli-0.3.0/tests/test_utils.py +133 -0
- trainwave_cli-0.3.0/uv.lock +1772 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/__init__.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/api.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/cli/auth.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/cli/jobs.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/cli/logs.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/cli/offers.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/cli/secrets.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/cli/setup.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/config/config.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/format_utils.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/io.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/main.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/utils.py +0 -0
- {trainwave_cli-0.2.8 → trainwave_cli-0.3.0}/trainwave_cli/xceptions.py +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
__pycache__
|
|
2
|
+
*.pyc
|
|
3
|
+
*.pyo
|
|
4
|
+
*.pyd
|
|
5
|
+
.Python
|
|
6
|
+
env
|
|
7
|
+
pip-log.txt
|
|
8
|
+
pip-delete-this-directory.txt
|
|
9
|
+
.tox
|
|
10
|
+
.coverage
|
|
11
|
+
.coverage.*
|
|
12
|
+
.cache
|
|
13
|
+
nosetests.xml
|
|
14
|
+
coverage.xml
|
|
15
|
+
*.cover
|
|
16
|
+
*.log
|
|
17
|
+
.git
|
|
18
|
+
.mypy_cache
|
|
19
|
+
.pytest_cache
|
|
20
|
+
.hypothesis
|
|
21
|
+
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
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
|
+
pip-wheel-metadata/
|
|
24
|
+
share/python-wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
MANIFEST
|
|
29
|
+
|
|
30
|
+
# PyInstaller
|
|
31
|
+
# Usually these files are written by a python script from a template
|
|
32
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
33
|
+
*.manifest
|
|
34
|
+
*.spec
|
|
35
|
+
|
|
36
|
+
# Installer logs
|
|
37
|
+
pip-log.txt
|
|
38
|
+
pip-delete-this-directory.txt
|
|
39
|
+
|
|
40
|
+
# Unit test / coverage reports
|
|
41
|
+
htmlcov/
|
|
42
|
+
.tox/
|
|
43
|
+
.nox/
|
|
44
|
+
.coverage
|
|
45
|
+
.coverage.*
|
|
46
|
+
.cache
|
|
47
|
+
nosetests.xml
|
|
48
|
+
coverage.xml
|
|
49
|
+
*.cover
|
|
50
|
+
*.py,cover
|
|
51
|
+
.hypothesis/
|
|
52
|
+
.pytest_cache/
|
|
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
|
+
target/
|
|
76
|
+
|
|
77
|
+
# Jupyter Notebook
|
|
78
|
+
.ipynb_checkpoints
|
|
79
|
+
|
|
80
|
+
# IPython
|
|
81
|
+
profile_default/
|
|
82
|
+
ipython_config.py
|
|
83
|
+
|
|
84
|
+
# pyenv
|
|
85
|
+
.python-version
|
|
86
|
+
|
|
87
|
+
# pipenv
|
|
88
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
89
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
90
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
91
|
+
# install all needed dependencies.
|
|
92
|
+
#Pipfile.lock
|
|
93
|
+
|
|
94
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
|
|
95
|
+
__pypackages__/
|
|
96
|
+
|
|
97
|
+
# Celery stuff
|
|
98
|
+
celerybeat-schedule
|
|
99
|
+
celerybeat.pid
|
|
100
|
+
|
|
101
|
+
# SageMath parsed files
|
|
102
|
+
*.sage.py
|
|
103
|
+
|
|
104
|
+
# Environments
|
|
105
|
+
.env
|
|
106
|
+
.venv
|
|
107
|
+
env/
|
|
108
|
+
venv/
|
|
109
|
+
ENV/
|
|
110
|
+
env.bak/
|
|
111
|
+
venv.bak/
|
|
112
|
+
|
|
113
|
+
# Spyder project settings
|
|
114
|
+
.spyderproject
|
|
115
|
+
.spyproject
|
|
116
|
+
|
|
117
|
+
# Rope project settings
|
|
118
|
+
.ropeproject
|
|
119
|
+
|
|
120
|
+
# mkdocs documentation
|
|
121
|
+
/site
|
|
122
|
+
|
|
123
|
+
# mypy
|
|
124
|
+
.mypy_cache/
|
|
125
|
+
.dmypy.json
|
|
126
|
+
dmypy.json
|
|
127
|
+
|
|
128
|
+
# Pyre type checker
|
|
129
|
+
.pyre/
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
default:
|
|
2
|
+
image: python:3.10
|
|
3
|
+
|
|
4
|
+
stages:
|
|
5
|
+
- build
|
|
6
|
+
- publish
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
build:
|
|
10
|
+
stage: build
|
|
11
|
+
script:
|
|
12
|
+
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
13
|
+
- export PATH="/root/.local/bin:$PATH"
|
|
14
|
+
- uv sync
|
|
15
|
+
- uv run pytest
|
|
16
|
+
|
|
17
|
+
publish:
|
|
18
|
+
stage: publish
|
|
19
|
+
script:
|
|
20
|
+
- curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
21
|
+
- export PATH="/root/.local/bin:$PATH"
|
|
22
|
+
- uv build
|
|
23
|
+
- uv publish --token $PYPI_API_KEY
|
|
24
|
+
only:
|
|
25
|
+
- main
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
.PHONY: install install-dev clean lint format check test tests help setup update dev-setup
|
|
2
|
+
|
|
3
|
+
PYTHON_MIN_VERSION = 3.10
|
|
4
|
+
|
|
5
|
+
## ==== Environment Setup ====
|
|
6
|
+
|
|
7
|
+
## Verify the development environment
|
|
8
|
+
verify-env:
|
|
9
|
+
@echo ">> Checking Python version..."
|
|
10
|
+
@python3 -c "import sys; assert sys.version_info >= (3, 10), 'Python $(PYTHON_MIN_VERSION) or higher is required'" || (echo "Error: Python $(PYTHON_MIN_VERSION) or higher is required" && exit 1)
|
|
11
|
+
@echo ">> Checking uv installation..."
|
|
12
|
+
@uv --version >/dev/null 2>&1 || (echo "Error: uv is not installed. Please install it first: https://docs.astral.sh/uv/getting-started/installation/" && exit 1)
|
|
13
|
+
|
|
14
|
+
## Setup development environment with uv
|
|
15
|
+
setup: verify-env
|
|
16
|
+
@echo ">> Setting up development environment..."
|
|
17
|
+
uv sync
|
|
18
|
+
|
|
19
|
+
## Update dependencies to their latest versions
|
|
20
|
+
update:
|
|
21
|
+
@echo ">> Updating dependencies..."
|
|
22
|
+
uv lock --upgrade && uv sync
|
|
23
|
+
|
|
24
|
+
## Install for production
|
|
25
|
+
install: verify-env
|
|
26
|
+
@echo ">> Installing production dependencies"
|
|
27
|
+
uv sync --no-dev
|
|
28
|
+
|
|
29
|
+
## Install for development
|
|
30
|
+
install-dev: verify-env
|
|
31
|
+
@echo ">> Installing development dependencies"
|
|
32
|
+
uv sync
|
|
33
|
+
|
|
34
|
+
## ==== Development Commands ====
|
|
35
|
+
|
|
36
|
+
## Run code formatting
|
|
37
|
+
format:
|
|
38
|
+
@echo ">> Formatting code..."
|
|
39
|
+
uv run ruff check --fix --unsafe-fixes trainwave_cli/ tests/
|
|
40
|
+
uv run black .
|
|
41
|
+
|
|
42
|
+
## Run linting checks
|
|
43
|
+
lint:
|
|
44
|
+
@echo ">> Running linting..."
|
|
45
|
+
uv run ruff check trainwave_cli/ tests/
|
|
46
|
+
|
|
47
|
+
## Run all checks (linting, formatting, tests)
|
|
48
|
+
check: lint
|
|
49
|
+
@echo ">> Checking code format..."
|
|
50
|
+
uv run black --check .
|
|
51
|
+
@echo ">> Running tests..."
|
|
52
|
+
$(MAKE) test
|
|
53
|
+
|
|
54
|
+
## Run tests with coverage
|
|
55
|
+
test:
|
|
56
|
+
uv run pytest -s tests/ \
|
|
57
|
+
--log-level=WARNING \
|
|
58
|
+
--disable-pytest-warnings
|
|
59
|
+
|
|
60
|
+
## Run tests (alias for test)
|
|
61
|
+
tests: test
|
|
62
|
+
|
|
63
|
+
## Delete all temporary files and artifacts
|
|
64
|
+
clean:
|
|
65
|
+
@echo ">> Cleaning temporary files..."
|
|
66
|
+
find . -type d -name "__pycache__" -exec rm -rf {} +
|
|
67
|
+
find . -type d -name "*.egg-info" -exec rm -rf {} +
|
|
68
|
+
find . -type d -name ".eggs" -exec rm -rf {} +
|
|
69
|
+
find . -type d -name ".pytest_cache" -exec rm -rf {} +
|
|
70
|
+
find . -type d -name ".coverage" -exec rm -rf {} +
|
|
71
|
+
find . -type d -name ".ruff_cache" -exec rm -rf {} +
|
|
72
|
+
find . -type f -name "*.pyc" -delete
|
|
73
|
+
find . -type f -name "*.pyo" -delete
|
|
74
|
+
find . -type f -name "*.pyd" -delete
|
|
75
|
+
find . -type f -name ".coverage" -delete
|
|
76
|
+
find . -type f -name "coverage.xml" -delete
|
|
77
|
+
rm -rf build/ dist/ .ipynb_checkpoints/ **/.ipynb_checkpoints
|
|
78
|
+
|
|
79
|
+
## ==== Quick Development Setup ====
|
|
80
|
+
|
|
81
|
+
## Set up complete development environment (recommended for new developers)
|
|
82
|
+
dev-setup: verify-env setup
|
|
83
|
+
@echo ">> Development environment is ready!"
|
|
84
|
+
@echo ">> Run 'make help' to see available commands"
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
#################################################################################
|
|
88
|
+
# Self Documenting Commands #
|
|
89
|
+
#################################################################################
|
|
90
|
+
|
|
91
|
+
.DEFAULT_GOAL := help
|
|
92
|
+
|
|
93
|
+
# Inspired by <http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html>
|
|
94
|
+
# sed script explained:
|
|
95
|
+
# /^##/:
|
|
96
|
+
# * save line in hold space
|
|
97
|
+
# * purge line
|
|
98
|
+
# * Loop:
|
|
99
|
+
# * append newline + line to hold space
|
|
100
|
+
# * go to next line
|
|
101
|
+
# * if line starts with doc comment, strip comment character off and loop
|
|
102
|
+
# * remove target prerequisites
|
|
103
|
+
# * append hold space (+ newline) to line
|
|
104
|
+
# * replace newline plus comments by `---`
|
|
105
|
+
# * print line
|
|
106
|
+
# Separate expressions are necessary because labels cannot be delimited by
|
|
107
|
+
# semicolon; see <http://stackoverflow.com/a/11799865/1968>
|
|
108
|
+
.PHONY: help
|
|
109
|
+
help:
|
|
110
|
+
@echo "$$(tput bold)Available commands:$$(tput sgr0)"
|
|
111
|
+
@sed -n -e "/^## / { \
|
|
112
|
+
h; \
|
|
113
|
+
s/.*//; \
|
|
114
|
+
:doc" \
|
|
115
|
+
-e "H; \
|
|
116
|
+
n; \
|
|
117
|
+
s/^## //; \
|
|
118
|
+
t doc" \
|
|
119
|
+
-e "s/:.*//; \
|
|
120
|
+
G; \
|
|
121
|
+
s/\\n## /---/; \
|
|
122
|
+
s/\\n/ /g; \
|
|
123
|
+
p; \
|
|
124
|
+
}" ${MAKEFILE_LIST} \
|
|
125
|
+
| awk -F '---' \
|
|
126
|
+
-v ncol=$$(tput cols) \
|
|
127
|
+
-v indent=19 \
|
|
128
|
+
-v col_on="$$(tput setaf 6)" \
|
|
129
|
+
-v col_off="$$(tput sgr0)" \
|
|
130
|
+
'{ \
|
|
131
|
+
printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
|
|
132
|
+
n = split($$2, words, " "); \
|
|
133
|
+
line_length = ncol - indent; \
|
|
134
|
+
for (i = 1; i <= n; i++) { \
|
|
135
|
+
line_length -= length(words[i]) + 1; \
|
|
136
|
+
if (line_length <= 0) { \
|
|
137
|
+
line_length = ncol - indent - length(words[i]) - 1; \
|
|
138
|
+
printf "\n%*s ", -indent, " "; \
|
|
139
|
+
} \
|
|
140
|
+
printf "%s ", words[i]; \
|
|
141
|
+
} \
|
|
142
|
+
printf "\n"; \
|
|
143
|
+
}' \
|
|
144
|
+
| more $(shell test $(shell uname) = Darwin && echo '--no-init --raw-control-chars')
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: trainwave-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Trainwave CLI - A command-line interface for managing Trainwave resources
|
|
5
|
+
Project-URL: Homepage, https://trainwave.ai
|
|
6
|
+
Project-URL: Documentation, https://trainwave.ai/docs
|
|
7
|
+
Author-email: Johan Backman <johan@trainwave.ai>
|
|
8
|
+
Maintainer-email: Johan Backman <johan@trainwave.ai>
|
|
5
9
|
License: MIT
|
|
6
|
-
Keywords: cli,
|
|
7
|
-
Author: Johan Backman
|
|
8
|
-
Author-email: johan@trainwave.ai
|
|
9
|
-
Maintainer: Johan Backman
|
|
10
|
-
Maintainer-email: johan@trainwave.ai
|
|
11
|
-
Requires-Python: >=3.10,<4.0
|
|
10
|
+
Keywords: ai,cli,machine-learning,trainwave
|
|
12
11
|
Classifier: Development Status :: 4 - Beta
|
|
13
12
|
Classifier: Environment :: Console
|
|
14
13
|
Classifier: Intended Audience :: Developers
|
|
@@ -19,27 +18,25 @@ Classifier: Programming Language :: Python :: 3
|
|
|
19
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
23
21
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
22
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
-
Requires-
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
Requires-Dist: typer-config[all]
|
|
40
|
-
Requires-Dist:
|
|
41
|
-
|
|
42
|
-
Project-URL: Homepage, https://trainwave.ai
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: aiofiles<25,>=24.1.0
|
|
25
|
+
Requires-Dist: aiohttp<4,>=3.10
|
|
26
|
+
Requires-Dist: beaupy<4,>=3.9.2
|
|
27
|
+
Requires-Dist: boto3>=1.30
|
|
28
|
+
Requires-Dist: dacite<2,>=1.9.2
|
|
29
|
+
Requires-Dist: httpx==0.28.1
|
|
30
|
+
Requires-Dist: human-readable<2,>=1.3.4
|
|
31
|
+
Requires-Dist: loguru<1,>=0.7.2
|
|
32
|
+
Requires-Dist: pathspec<1,>=0.12.1
|
|
33
|
+
Requires-Dist: pytimeparse<2,>=1.1.8
|
|
34
|
+
Requires-Dist: tabulate<1,>=0.9.0
|
|
35
|
+
Requires-Dist: toml<1,>=0.10.2
|
|
36
|
+
Requires-Dist: tqdm<5,>=4.66.4
|
|
37
|
+
Requires-Dist: typer-config[all]<2,>=1.4.0
|
|
38
|
+
Requires-Dist: typer<1,>=0.12.5
|
|
39
|
+
Requires-Dist: websockets<13,>=12.0
|
|
43
40
|
Description-Content-Type: text/markdown
|
|
44
41
|
|
|
45
42
|
# Trainwave CLI
|
|
@@ -64,10 +61,10 @@ pip install trainwave-cli
|
|
|
64
61
|
### From Source
|
|
65
62
|
|
|
66
63
|
1. Clone the repository
|
|
67
|
-
2. Install using
|
|
64
|
+
2. Install using uv:
|
|
68
65
|
|
|
69
66
|
```bash
|
|
70
|
-
|
|
67
|
+
uv sync
|
|
71
68
|
```
|
|
72
69
|
|
|
73
70
|
## Usage
|
|
@@ -90,12 +87,12 @@ wave <command> --help
|
|
|
90
87
|
|
|
91
88
|
## Development
|
|
92
89
|
|
|
93
|
-
This project uses
|
|
90
|
+
This project uses uv for dependency management and packaging. Here's how to set up your development environment:
|
|
94
91
|
|
|
95
92
|
### Prerequisites
|
|
96
93
|
|
|
97
94
|
- Python 3.10 or higher
|
|
98
|
-
-
|
|
95
|
+
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
99
96
|
- Make (for development commands)
|
|
100
97
|
|
|
101
98
|
### Setting Up Development Environment
|
|
@@ -162,4 +159,3 @@ trainwave-cli/
|
|
|
162
159
|
## License
|
|
163
160
|
|
|
164
161
|
[License information here]
|
|
165
|
-
|
|
@@ -20,10 +20,10 @@ pip install trainwave-cli
|
|
|
20
20
|
### From Source
|
|
21
21
|
|
|
22
22
|
1. Clone the repository
|
|
23
|
-
2. Install using
|
|
23
|
+
2. Install using uv:
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
|
-
|
|
26
|
+
uv sync
|
|
27
27
|
```
|
|
28
28
|
|
|
29
29
|
## Usage
|
|
@@ -46,12 +46,12 @@ wave <command> --help
|
|
|
46
46
|
|
|
47
47
|
## Development
|
|
48
48
|
|
|
49
|
-
This project uses
|
|
49
|
+
This project uses uv for dependency management and packaging. Here's how to set up your development environment:
|
|
50
50
|
|
|
51
51
|
### Prerequisites
|
|
52
52
|
|
|
53
53
|
- Python 3.10 or higher
|
|
54
|
-
-
|
|
54
|
+
- [uv](https://docs.astral.sh/uv/getting-started/installation/)
|
|
55
55
|
- Make (for development commands)
|
|
56
56
|
|
|
57
57
|
### Setting Up Development Environment
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
scikit-learn
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import time
|
|
2
|
+
|
|
3
|
+
from sklearn.datasets import load_iris
|
|
4
|
+
from sklearn.metrics import accuracy_score
|
|
5
|
+
from sklearn.model_selection import train_test_split
|
|
6
|
+
from sklearn.neighbors import KNeighborsClassifier
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def fake_output() -> None:
|
|
10
|
+
with open("/workspace/output/some_output.txt", "w") as f:
|
|
11
|
+
f.write("Hello World!")
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _main() -> None:
|
|
15
|
+
# Load the Iris dataset
|
|
16
|
+
iris = load_iris()
|
|
17
|
+
X = iris.data # Features
|
|
18
|
+
y = iris.target # Target variable (species)
|
|
19
|
+
|
|
20
|
+
# Split the data into training and testing sets
|
|
21
|
+
X_train, X_test, y_train, y_test = train_test_split(
|
|
22
|
+
X, y, test_size=0.2, random_state=42
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
# Initialize the classifier (K-Nearest Neighbors in this example)
|
|
26
|
+
knn = KNeighborsClassifier(n_neighbors=3)
|
|
27
|
+
|
|
28
|
+
# Train the classifier on the training data
|
|
29
|
+
knn.fit(X_train, y_train)
|
|
30
|
+
|
|
31
|
+
# Make predictions on the test data
|
|
32
|
+
y_pred = knn.predict(X_test)
|
|
33
|
+
|
|
34
|
+
# Calculate the accuracy of the classifier
|
|
35
|
+
accuracy = accuracy_score(y_test, y_pred)
|
|
36
|
+
print(f"Accuracy: {accuracy:.2f}")
|
|
37
|
+
|
|
38
|
+
for i in range(40):
|
|
39
|
+
time.sleep(5)
|
|
40
|
+
print(f"Still running... {i}")
|
|
41
|
+
if i % 5 == 0:
|
|
42
|
+
print("AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY")
|
|
43
|
+
print("secret key = 123dsa123asd123asd")
|
|
44
|
+
|
|
45
|
+
fake_output()
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
if __name__ == "__main__":
|
|
49
|
+
_main()
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
name = "Testing trainwave"
|
|
2
|
+
expires = "1h"
|
|
3
|
+
setup_command = "bash setup.sh"
|
|
4
|
+
run_command = "bash run.sh"
|
|
5
|
+
image = "trainwave/pytorch:2.3.1"
|
|
6
|
+
framework = "PyTorch"
|
|
7
|
+
project = "p-kgzxmqte"
|
|
8
|
+
compliance = false
|
|
9
|
+
cpus = 1
|
|
10
|
+
|
|
11
|
+
[env_vars]
|
|
12
|
+
TESTING1 = "1"
|
|
13
|
+
TESTING2 = "2"
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
[
|
|
1
|
+
[project]
|
|
2
2
|
name = "trainwave-cli"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.0"
|
|
4
4
|
description = "Trainwave CLI - A command-line interface for managing Trainwave resources"
|
|
5
|
-
authors = ["Johan Backman
|
|
6
|
-
maintainers = ["Johan Backman
|
|
5
|
+
authors = [{ name = "Johan Backman", email = "johan@trainwave.ai" }]
|
|
6
|
+
maintainers = [{ name = "Johan Backman", email = "johan@trainwave.ai" }]
|
|
7
7
|
readme = "README.md"
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
license = { text = "MIT" }
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
10
|
keywords = ["cli", "trainwave", "ai", "machine-learning"]
|
|
11
11
|
classifiers = [
|
|
12
12
|
"Development Status :: 4 - Beta",
|
|
@@ -22,49 +22,48 @@ classifiers = [
|
|
|
22
22
|
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
23
23
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
24
24
|
]
|
|
25
|
+
dependencies = [
|
|
26
|
+
"aiofiles>=24.1.0,<25",
|
|
27
|
+
"aiohttp>=3.10,<4",
|
|
28
|
+
"beaupy>=3.9.2,<4",
|
|
29
|
+
"boto3>=1.30",
|
|
30
|
+
"dacite>=1.9.2,<2",
|
|
31
|
+
"httpx==0.28.1",
|
|
32
|
+
"human-readable>=1.3.4,<2",
|
|
33
|
+
"loguru>=0.7.2,<1",
|
|
34
|
+
"pathspec>=0.12.1,<1",
|
|
35
|
+
"pytimeparse>=1.1.8,<2",
|
|
36
|
+
"tabulate>=0.9.0,<1",
|
|
37
|
+
"toml>=0.10.2,<1",
|
|
38
|
+
"tqdm>=4.66.4,<5",
|
|
39
|
+
"typer>=0.12.5,<1",
|
|
40
|
+
"typer-config[all]>=1.4.0,<2",
|
|
41
|
+
"websockets>=12.0,<13",
|
|
42
|
+
]
|
|
25
43
|
|
|
26
|
-
[
|
|
44
|
+
[project.urls]
|
|
27
45
|
Homepage = "https://trainwave.ai"
|
|
28
46
|
Documentation = "https://trainwave.ai/docs"
|
|
29
|
-
# Repository = "TBD"
|
|
30
|
-
# Issues = "TBD"
|
|
31
|
-
|
|
32
|
-
[tool.poetry.dependencies]
|
|
33
|
-
aiofiles = "^24.1.0"
|
|
34
|
-
aiohttp = "^3.10"
|
|
35
|
-
beaupy = "^3.9.2"
|
|
36
|
-
boto3 = ">=1.30"
|
|
37
|
-
dacite = "^1.9.2"
|
|
38
|
-
httpx = "0.28.1"
|
|
39
|
-
human-readable = "^1.3.4"
|
|
40
|
-
loguru = "^0.7.2"
|
|
41
|
-
pathspec = "^0.12.1"
|
|
42
|
-
python = "^3.10"
|
|
43
|
-
pytimeparse = "^1.1.8"
|
|
44
|
-
tabulate = "^0.9.0"
|
|
45
|
-
toml = "^0.10.2"
|
|
46
|
-
tqdm = "^4.66.4"
|
|
47
|
-
typer = "^0.12.5"
|
|
48
|
-
typer-config = { extras = ["all"], version = "^1.4.0" }
|
|
49
|
-
websockets = "^12.0"
|
|
50
|
-
|
|
51
|
-
[tool.poetry.group.dev.dependencies]
|
|
52
|
-
freezegun = "^1.5.1"
|
|
53
|
-
ipdb = "^0.13.13"
|
|
54
|
-
ipython = "^8.34.0"
|
|
55
|
-
pytest = "^8.3.5"
|
|
56
|
-
pytest-asyncio = "^0.25.3"
|
|
57
|
-
pytest-cov = "^6.0.0"
|
|
58
|
-
pytest-httpx = "^0.35.0"
|
|
59
|
-
pytest-mock = "^3.14.0"
|
|
60
|
-
ruff = "^0.11.7"
|
|
61
47
|
|
|
62
|
-
[
|
|
48
|
+
[project.scripts]
|
|
63
49
|
wave = "trainwave_cli.main:entrypoint"
|
|
64
50
|
|
|
51
|
+
[dependency-groups]
|
|
52
|
+
dev = [
|
|
53
|
+
"freezegun>=1.5.1,<2",
|
|
54
|
+
"ipdb>=0.13.13,<1",
|
|
55
|
+
"ipython>=8.34.0,<9",
|
|
56
|
+
"pytest>=8.3.5,<9",
|
|
57
|
+
"pytest-asyncio>=0.25.3,<1",
|
|
58
|
+
"pytest-cov>=6.0.0,<7",
|
|
59
|
+
"pytest-httpx>=0.35.0,<1",
|
|
60
|
+
"pytest-mock>=3.14.0,<4",
|
|
61
|
+
"ruff>=0.11.7",
|
|
62
|
+
]
|
|
63
|
+
|
|
65
64
|
[build-system]
|
|
66
|
-
requires = ["
|
|
67
|
-
build-backend = "
|
|
65
|
+
requires = ["hatchling"]
|
|
66
|
+
build-backend = "hatchling.build"
|
|
68
67
|
|
|
69
68
|
# Add tool configurations for common development tools
|
|
70
69
|
[tool.black]
|