devscript 0.1.2__tar.gz → 0.2.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.
- {devscript-0.1.2 → devscript-0.2.1}/PKG-INFO +27 -250
- devscript-0.2.1/README.md +293 -0
- {devscript-0.1.2 → devscript-0.2.1}/devscript.egg-info/PKG-INFO +27 -250
- {devscript-0.1.2 → devscript-0.2.1}/devscript.egg-info/SOURCES.txt +1 -2
- devscript-0.2.1/devscript.py +33 -0
- {devscript-0.1.2 → devscript-0.2.1}/pyproject.toml +4 -16
- devscript-0.1.2/README.md +0 -512
- devscript-0.1.2/devscript/__init__.py +0 -69
- devscript-0.1.2/devscript.egg-info/requires.txt +0 -1
- {devscript-0.1.2 → devscript-0.2.1}/LICENSE +0 -0
- {devscript-0.1.2 → devscript-0.2.1}/devscript.egg-info/dependency_links.txt +0 -0
- {devscript-0.1.2 → devscript-0.2.1}/devscript.egg-info/entry_points.txt +0 -0
- {devscript-0.1.2 → devscript-0.2.1}/devscript.egg-info/top_level.txt +0 -0
- {devscript-0.1.2 → devscript-0.2.1}/setup.cfg +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: devscript
|
|
3
|
-
Version: 0.1
|
|
4
|
-
Summary: A utility for managing custom development scripts
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: A utility for managing custom development scripts pyproject.toml configuration
|
|
5
5
|
Author-email: "Маг Ильяс DOMA (MagIlyasDOMA)" <magilyas.doma.09@list.ru>
|
|
6
6
|
License: GPL-3.0-only
|
|
7
7
|
Project-URL: Homepage, https://github.com/MagIlyasDOMA/devscript
|
|
@@ -9,26 +9,22 @@ Project-URL: Repository, https://github.com/MagIlyasDOMA/devscript.git
|
|
|
9
9
|
Project-URL: BugTracker, https://github.com/MagIlyasDOMA/devscript/issues
|
|
10
10
|
Keywords: cli,scripts
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
12
|
Classifier: Programming Language :: Python :: 3.11
|
|
16
13
|
Classifier: Programming Language :: Python :: 3.12
|
|
17
14
|
Classifier: Programming Language :: Python :: 3.13
|
|
18
15
|
Classifier: Programming Language :: Python :: 3.14
|
|
19
16
|
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
20
17
|
Classifier: Operating System :: OS Independent
|
|
21
|
-
Requires-Python: >=3.
|
|
18
|
+
Requires-Python: >=3.11
|
|
22
19
|
Description-Content-Type: text/markdown
|
|
23
20
|
License-File: LICENSE
|
|
24
|
-
Requires-Dist: pyyaml>=6.0.3
|
|
25
21
|
Dynamic: license-file
|
|
26
22
|
|
|
27
23
|
<a id="doc_en"></a>
|
|
28
24
|
# DevScript
|
|
29
25
|
#### [Документация на русском](#doc_ru)
|
|
30
26
|
|
|
31
|
-
DevScript is a simple utility for managing custom development scripts. It allows you to define commands in
|
|
27
|
+
DevScript is a simple utility for managing custom development scripts. It allows you to define commands in pyproject.toml file and execute them through a single interface.
|
|
32
28
|
|
|
33
29
|
## Installation
|
|
34
30
|
|
|
@@ -45,66 +41,15 @@ cd devscript
|
|
|
45
41
|
pip install -e .
|
|
46
42
|
```
|
|
47
43
|
|
|
48
|
-
###
|
|
49
|
-
```shell
|
|
50
|
-
npm install -D @hren/devscript
|
|
51
|
-
# or
|
|
52
|
-
yarn add -D @hren/devscript
|
|
53
|
-
# or
|
|
54
|
-
pnpm add -D @hren/devscript
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
#### Or install from source:
|
|
58
|
-
|
|
59
|
-
```shell
|
|
60
|
-
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
61
|
-
cd devscript
|
|
62
|
-
npm install
|
|
63
|
-
npm run build
|
|
64
|
-
npm link
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
### Configuration formats
|
|
68
|
-
#### JSON (`devscript.json`)
|
|
69
|
-
```json
|
|
70
|
-
{
|
|
71
|
-
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json",
|
|
72
|
-
"build": "python -m build",
|
|
73
|
-
"test": "pytest tests/",
|
|
74
|
-
"lint": "flake8 src/",
|
|
75
|
-
"dev": "python -m app --debug"
|
|
76
|
-
}
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
#### YAML (`devscript.yaml`)
|
|
80
|
-
```yaml
|
|
81
|
-
build: "python -m build"
|
|
82
|
-
test: "pytest tests/"
|
|
83
|
-
lint: "flake8 src/"
|
|
84
|
-
dev: "python -m app --debug"
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
#### TOML (`pyproject.toml`)
|
|
44
|
+
### Configuration format
|
|
88
45
|
```toml
|
|
89
|
-
[devscript]
|
|
46
|
+
[tool.devscript]
|
|
90
47
|
build = "python -m build"
|
|
91
48
|
test = "pytest tests/"
|
|
92
49
|
lint = "flake8 src/"
|
|
93
50
|
dev = "python -m app --debug"
|
|
94
51
|
```
|
|
95
52
|
|
|
96
|
-
#### `package.json`
|
|
97
|
-
```json
|
|
98
|
-
{
|
|
99
|
-
"devscript": {
|
|
100
|
-
"build": "python -m build",
|
|
101
|
-
"test": "pytest tests/",
|
|
102
|
-
"lint": "flake8 src/",
|
|
103
|
-
"dev": "python -m app --debug"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
```
|
|
107
|
-
|
|
108
53
|
### Running commands
|
|
109
54
|
#### The package provides four CLI commands:
|
|
110
55
|
- `devscript` — full name
|
|
@@ -126,13 +71,12 @@ dvs lint
|
|
|
126
71
|
# Pass arguments to a command
|
|
127
72
|
devscript dev --port 8000 --reload
|
|
128
73
|
```
|
|
129
|
-
Here is the translation of the text into English, with the markdown formatting preserved:
|
|
130
74
|
|
|
131
75
|
## Examples
|
|
132
76
|
### Example 1: Basic usage
|
|
133
77
|
```toml
|
|
134
78
|
# pyproject.toml
|
|
135
|
-
[devscript]
|
|
79
|
+
[tool.devscript]
|
|
136
80
|
start = "uvicorn main:app --reload"
|
|
137
81
|
migrate = "alembic upgrade head"
|
|
138
82
|
shell = "ipython"
|
|
@@ -145,11 +89,10 @@ devs shell # Starts IPython
|
|
|
145
89
|
```
|
|
146
90
|
|
|
147
91
|
### Example 2: Passing arguments
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
}
|
|
92
|
+
```toml
|
|
93
|
+
[tool.devscript]
|
|
94
|
+
test = "pytest"
|
|
95
|
+
cov = "pytest --cov=src"
|
|
153
96
|
```
|
|
154
97
|
|
|
155
98
|
```shell
|
|
@@ -174,42 +117,12 @@ devs test
|
|
|
174
117
|
devs lint
|
|
175
118
|
```
|
|
176
119
|
|
|
177
|
-
### TypeScript version
|
|
178
|
-
```shell
|
|
179
|
-
# Clone the repository
|
|
180
|
-
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
181
|
-
cd devscript
|
|
182
|
-
|
|
183
|
-
# Install dependencies
|
|
184
|
-
npm install
|
|
185
|
-
|
|
186
|
-
# Build the project
|
|
187
|
-
npm run build
|
|
188
|
-
|
|
189
|
-
# Install in development mode
|
|
190
|
-
npm link
|
|
191
|
-
|
|
192
|
-
# Run tests
|
|
193
|
-
devs test
|
|
194
|
-
|
|
195
|
-
# Run linter
|
|
196
|
-
devs lint
|
|
197
|
-
```
|
|
198
|
-
|
|
199
120
|
## Project structure
|
|
200
121
|
```text
|
|
201
122
|
devscript/
|
|
202
|
-
├──
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
│ │ └── py.typed
|
|
206
|
-
│ ├── pyproject.toml
|
|
207
|
-
│ └── README.md
|
|
208
|
-
├── typescript/ # TypeScript implementation
|
|
209
|
-
│ ├── devscript.ts
|
|
210
|
-
│ ├── package.json
|
|
211
|
-
│ ├── tsconfig.json
|
|
212
|
-
│ └── README.md
|
|
123
|
+
├── devscript.py # Python implementation
|
|
124
|
+
├── pyproject.toml
|
|
125
|
+
├── README.md
|
|
213
126
|
├── schema.json # JSON Schema for autocompletion
|
|
214
127
|
└── LICENSE
|
|
215
128
|
```
|
|
@@ -233,25 +146,11 @@ print("Available commands:", core.commands_list())
|
|
|
233
146
|
core.run("build", ["--verbose"])
|
|
234
147
|
```
|
|
235
148
|
|
|
236
|
-
#### Typescript
|
|
237
|
-
```typescript
|
|
238
|
-
import { DevScriptCore } from 'devscript';
|
|
239
|
-
```
|
|
240
|
-
```javascript
|
|
241
|
-
const core = new DevScriptCore();
|
|
242
|
-
console.log("Available commands:", core.commands_list());
|
|
243
|
-
core.run("build", ["--verbose"]);
|
|
244
|
-
```
|
|
245
|
-
|
|
246
149
|
## Requirements
|
|
247
150
|
### Python version
|
|
248
|
-
- Python 3.
|
|
151
|
+
- Python 3.11 or higher
|
|
249
152
|
- No external dependencies (uses the standard library)
|
|
250
153
|
|
|
251
|
-
### TypeScript version
|
|
252
|
-
- Node.js 14 or higher
|
|
253
|
-
- Dependencies: argparse, smol-toml
|
|
254
|
-
|
|
255
154
|
## License
|
|
256
155
|
GPL-3.0-only
|
|
257
156
|
|
|
@@ -267,27 +166,13 @@ GPL-3.0-only
|
|
|
267
166
|
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
268
167
|
5. Open a Pull Request
|
|
269
168
|
|
|
270
|
-
## Frequently Asked Questions
|
|
271
|
-
##### Q: Can I use both versions at the same time?
|
|
272
|
-
A: Yes, they do not conflict as they use different commands for installation (pip vs npm).
|
|
273
|
-
|
|
274
|
-
##### Q: Are other configuration formats supported?
|
|
275
|
-
A: Currently, JSON, YAML, pyproject.toml, and package.json are supported.
|
|
276
|
-
|
|
277
|
-
##### Q: How do I add a new command?
|
|
278
|
-
A: Just add a new entry in the configuration file with the command name and the corresponding shell command.
|
|
279
|
-
|
|
280
|
-
##### Q: Does it work on Windows?
|
|
281
|
-
A: Yes, both versions have been tested on Windows.
|
|
282
|
-
|
|
283
|
-
|
|
284
169
|
---
|
|
285
170
|
|
|
286
171
|
<a id="doc_ru"></a>
|
|
287
172
|
# DevScript
|
|
288
173
|
#### [Documentation in English](#doc_en)
|
|
289
174
|
|
|
290
|
-
DevScript — это простая утилита для управления пользовательскими скриптами разработки. Она позволяет определять команды в
|
|
175
|
+
DevScript — это простая утилита для управления пользовательскими скриптами разработки. Она позволяет определять команды в файле pyproject.toml и запускать их через единый интерфейс.
|
|
291
176
|
|
|
292
177
|
## Установка
|
|
293
178
|
|
|
@@ -304,66 +189,15 @@ cd devscript
|
|
|
304
189
|
pip install -e .
|
|
305
190
|
```
|
|
306
191
|
|
|
307
|
-
###
|
|
308
|
-
```shell
|
|
309
|
-
npm install -D @hren/devscript
|
|
310
|
-
# или
|
|
311
|
-
yarn add -D @hren/devscript
|
|
312
|
-
# или
|
|
313
|
-
pnpm add -D @hren/devscript
|
|
314
|
-
```
|
|
315
|
-
|
|
316
|
-
#### Или установка из исходного кода:
|
|
317
|
-
|
|
318
|
-
```shell
|
|
319
|
-
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
320
|
-
cd devscript
|
|
321
|
-
npm install
|
|
322
|
-
npm run build
|
|
323
|
-
npm link
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
### Форматы конфигурации
|
|
327
|
-
#### JSON (`devscript.json`)
|
|
328
|
-
```json
|
|
329
|
-
{
|
|
330
|
-
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json",
|
|
331
|
-
"build": "python -m build",
|
|
332
|
-
"test": "pytest tests/",
|
|
333
|
-
"lint": "flake8 src/",
|
|
334
|
-
"dev": "python -m app --debug"
|
|
335
|
-
}
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
#### YAML (`devscript.yaml`)
|
|
339
|
-
```yaml
|
|
340
|
-
build: "python -m build"
|
|
341
|
-
test: "pytest tests/"
|
|
342
|
-
lint: "flake8 src/"
|
|
343
|
-
dev: "python -m app --debug"
|
|
344
|
-
```
|
|
345
|
-
|
|
346
|
-
#### TOML (`pyproject.toml`)
|
|
192
|
+
### Формат конфигурации
|
|
347
193
|
```toml
|
|
348
|
-
[devscript]
|
|
194
|
+
[tool.devscript]
|
|
349
195
|
build = "python -m build"
|
|
350
196
|
test = "pytest tests/"
|
|
351
197
|
lint = "flake8 src/"
|
|
352
198
|
dev = "python -m app --debug"
|
|
353
199
|
```
|
|
354
200
|
|
|
355
|
-
#### `package.json`
|
|
356
|
-
```json
|
|
357
|
-
{
|
|
358
|
-
"devscript": {
|
|
359
|
-
"build": "python -m build",
|
|
360
|
-
"test": "pytest tests/",
|
|
361
|
-
"lint": "flake8 src/",
|
|
362
|
-
"dev": "python -m app --debug"
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
```
|
|
366
|
-
|
|
367
201
|
### Запуск команд
|
|
368
202
|
#### Пакет предоставляет четыре CLI-команды:
|
|
369
203
|
- `devscript` — полное имя
|
|
@@ -390,7 +224,7 @@ devscript dev --port 8000 --reload
|
|
|
390
224
|
### Пример 1: Базовое использование
|
|
391
225
|
```toml
|
|
392
226
|
# pyproject.toml
|
|
393
|
-
[devscript]
|
|
227
|
+
[tool.devscript]
|
|
394
228
|
start = "uvicorn main:app --reload"
|
|
395
229
|
migrate = "alembic upgrade head"
|
|
396
230
|
shell = "ipython"
|
|
@@ -403,11 +237,10 @@ devs shell # Запускает IPython
|
|
|
403
237
|
```
|
|
404
238
|
|
|
405
239
|
### Пример 2: Передача аргументов
|
|
406
|
-
```
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
}
|
|
240
|
+
```toml
|
|
241
|
+
[tool.devscript]
|
|
242
|
+
test = "pytest"
|
|
243
|
+
cov = "pytest --cov=src"
|
|
411
244
|
```
|
|
412
245
|
|
|
413
246
|
```shell
|
|
@@ -432,42 +265,12 @@ devs test
|
|
|
432
265
|
devs lint
|
|
433
266
|
```
|
|
434
267
|
|
|
435
|
-
### TypeScript версия
|
|
436
|
-
```shell
|
|
437
|
-
# Клонировать репозиторий
|
|
438
|
-
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
439
|
-
cd devscript
|
|
440
|
-
|
|
441
|
-
# Установить зависимости
|
|
442
|
-
npm install
|
|
443
|
-
|
|
444
|
-
# Собрать проект
|
|
445
|
-
npm run build
|
|
446
|
-
|
|
447
|
-
# Установить в режиме разработки
|
|
448
|
-
npm link
|
|
449
|
-
|
|
450
|
-
# Запустить тесты
|
|
451
|
-
devs test
|
|
452
|
-
|
|
453
|
-
# Запустить линтер
|
|
454
|
-
devs lint
|
|
455
|
-
```
|
|
456
|
-
|
|
457
268
|
## Структура проекта
|
|
458
269
|
```text
|
|
459
270
|
devscript/
|
|
460
|
-
├──
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
│ │ └── py.typed
|
|
464
|
-
│ ├── pyproject.toml
|
|
465
|
-
│ └── README.md
|
|
466
|
-
├── typescript/ # TypeScript реализация
|
|
467
|
-
│ ├── devscript.ts
|
|
468
|
-
│ ├── package.json
|
|
469
|
-
│ ├── tsconfig.json
|
|
470
|
-
│ └── README.md
|
|
271
|
+
├── devscript.py # Python-реализация
|
|
272
|
+
├── pyproject.toml
|
|
273
|
+
├── README.md
|
|
471
274
|
├── schema.json # JSON Schema для автодополнения
|
|
472
275
|
└── LICENSE
|
|
473
276
|
```
|
|
@@ -491,24 +294,11 @@ print("Доступные команды:", core.commands_list())
|
|
|
491
294
|
core.run("build", ["--verbose"])
|
|
492
295
|
```
|
|
493
296
|
|
|
494
|
-
#### Typescript
|
|
495
|
-
```typescript
|
|
496
|
-
import { DevScriptCore } from 'devscript';
|
|
497
|
-
|
|
498
|
-
const core = new DevScriptCore();
|
|
499
|
-
console.log("Доступные команды:", core.commands_list());
|
|
500
|
-
core.run("build", ["--verbose"]);
|
|
501
|
-
```
|
|
502
|
-
|
|
503
297
|
## Требования
|
|
504
298
|
### Python версия
|
|
505
|
-
- Python 3.
|
|
299
|
+
- Python 3.11 или выше
|
|
506
300
|
- Нет внешних зависимостей (использует стандартную библиотеку)
|
|
507
301
|
|
|
508
|
-
### TypeScript версия
|
|
509
|
-
- Node.js 14 или выше
|
|
510
|
-
- Зависимости: argparse, smol-toml
|
|
511
|
-
|
|
512
302
|
## Лицензия
|
|
513
303
|
GPL-3.0-only
|
|
514
304
|
|
|
@@ -523,16 +313,3 @@ GPL-3.0-only
|
|
|
523
313
|
3. Закоммитьте изменения (`git commit -m 'Add some amazing feature'`)
|
|
524
314
|
4. Запушьте в ветку (`git push origin feature/amazing-feature`)
|
|
525
315
|
5. Откройте Pull Request
|
|
526
|
-
|
|
527
|
-
## Часто задаваемые вопросы
|
|
528
|
-
##### Q: Могу ли я использовать обе версии одновременно?
|
|
529
|
-
A: Да, они не конфликтуют, так как используют разные команды для установки (pip vs npm).
|
|
530
|
-
|
|
531
|
-
##### Q: Поддерживаются ли другие форматы конфигурации?
|
|
532
|
-
A: В данный момент поддерживаются JSON, YAML, pyproject.toml и package.json
|
|
533
|
-
|
|
534
|
-
##### Q: Как добавить новую команду?
|
|
535
|
-
A: Просто добавьте новую запись в конфигурационный файл с именем команды и соответствующей shell-командой.
|
|
536
|
-
|
|
537
|
-
##### Q: Работает ли на Windows?
|
|
538
|
-
A: Да, обе версии протестированы на Windows.
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
<a id="doc_en"></a>
|
|
2
|
+
# DevScript
|
|
3
|
+
#### [Документация на русском](#doc_ru)
|
|
4
|
+
|
|
5
|
+
DevScript is a simple utility for managing custom development scripts. It allows you to define commands in pyproject.toml file and execute them through a single interface.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
### Python version
|
|
10
|
+
```shell
|
|
11
|
+
pip install devscript
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
#### Or install from source:
|
|
15
|
+
|
|
16
|
+
```shell
|
|
17
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
18
|
+
cd devscript
|
|
19
|
+
pip install -e .
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Configuration format
|
|
23
|
+
```toml
|
|
24
|
+
[tool.devscript]
|
|
25
|
+
build = "python -m build"
|
|
26
|
+
test = "pytest tests/"
|
|
27
|
+
lint = "flake8 src/"
|
|
28
|
+
dev = "python -m app --debug"
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Running commands
|
|
32
|
+
#### The package provides four CLI commands:
|
|
33
|
+
- `devscript` — full name
|
|
34
|
+
- `devscr` — abbreviation
|
|
35
|
+
- `devs` — short
|
|
36
|
+
- `dvs` — shortest
|
|
37
|
+
|
|
38
|
+
#### All of them work the same:
|
|
39
|
+
```shell
|
|
40
|
+
# Show the list of available commands
|
|
41
|
+
devscript --help
|
|
42
|
+
|
|
43
|
+
# Run a command
|
|
44
|
+
devscript build
|
|
45
|
+
devscr dev
|
|
46
|
+
devs test
|
|
47
|
+
dvs lint
|
|
48
|
+
|
|
49
|
+
# Pass arguments to a command
|
|
50
|
+
devscript dev --port 8000 --reload
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Examples
|
|
54
|
+
### Example 1: Basic usage
|
|
55
|
+
```toml
|
|
56
|
+
# pyproject.toml
|
|
57
|
+
[tool.devscript]
|
|
58
|
+
start = "uvicorn main:app --reload"
|
|
59
|
+
migrate = "alembic upgrade head"
|
|
60
|
+
shell = "ipython"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```shell
|
|
64
|
+
devs start # Starts the uvicorn server
|
|
65
|
+
devs migrate # Applies migrations
|
|
66
|
+
devs shell # Starts IPython
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Example 2: Passing arguments
|
|
70
|
+
```toml
|
|
71
|
+
[tool.devscript]
|
|
72
|
+
test = "pytest"
|
|
73
|
+
cov = "pytest --cov=src"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
```shell
|
|
77
|
+
devs test tests/test_api.py -v # pytest tests/test_api.py -v
|
|
78
|
+
devs cov --cov-report=html # pytest --cov=src --cov-report=html
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Development
|
|
82
|
+
### Python version
|
|
83
|
+
```shell
|
|
84
|
+
# Clone the repository
|
|
85
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
86
|
+
cd devscript
|
|
87
|
+
|
|
88
|
+
# Install in development mode
|
|
89
|
+
pip install -e .
|
|
90
|
+
|
|
91
|
+
# Run tests
|
|
92
|
+
devs test
|
|
93
|
+
|
|
94
|
+
# Run linter
|
|
95
|
+
devs lint
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Project structure
|
|
99
|
+
```text
|
|
100
|
+
devscript/
|
|
101
|
+
├── devscript.py # Python implementation
|
|
102
|
+
├── pyproject.toml
|
|
103
|
+
├── README.md
|
|
104
|
+
├── schema.json # JSON Schema for autocompletion
|
|
105
|
+
└── LICENSE
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## JSON Schema
|
|
109
|
+
For autocompletion and validation in code editors, use the schema:
|
|
110
|
+
```json
|
|
111
|
+
{
|
|
112
|
+
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json"
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## API
|
|
117
|
+
### Using in code
|
|
118
|
+
#### Python
|
|
119
|
+
```python
|
|
120
|
+
from devscript import DevScriptCore
|
|
121
|
+
|
|
122
|
+
core = DevScriptCore()
|
|
123
|
+
print("Available commands:", core.commands_list())
|
|
124
|
+
core.run("build", ["--verbose"])
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Requirements
|
|
128
|
+
### Python version
|
|
129
|
+
- Python 3.11 or higher
|
|
130
|
+
- No external dependencies (uses the standard library)
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
GPL-3.0-only
|
|
134
|
+
|
|
135
|
+
## Author
|
|
136
|
+
#### Mag Ilyas DOMA (MagIlyasDOMA)
|
|
137
|
+
- GitHub: [@MagIlyasDOMA](https://github.com/MagIlyasDOMA)
|
|
138
|
+
- Project: [devscript](https://github.com/MagIlyasDOMA/devscript)
|
|
139
|
+
|
|
140
|
+
## Contribution
|
|
141
|
+
1. Fork the repository
|
|
142
|
+
2. Create a branch for the feature (`git checkout -b feature/amazing-feature`)
|
|
143
|
+
3. Commit your changes (`git commit -m 'Add some amazing feature'`)
|
|
144
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
145
|
+
5. Open a Pull Request
|
|
146
|
+
|
|
147
|
+
---
|
|
148
|
+
|
|
149
|
+
<a id="doc_ru"></a>
|
|
150
|
+
# DevScript
|
|
151
|
+
#### [Documentation in English](#doc_en)
|
|
152
|
+
|
|
153
|
+
DevScript — это простая утилита для управления пользовательскими скриптами разработки. Она позволяет определять команды в файле pyproject.toml и запускать их через единый интерфейс.
|
|
154
|
+
|
|
155
|
+
## Установка
|
|
156
|
+
|
|
157
|
+
### Python версия
|
|
158
|
+
```shell
|
|
159
|
+
pip install devscript
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
#### Или установка из исходного кода:
|
|
163
|
+
|
|
164
|
+
```shell
|
|
165
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
166
|
+
cd devscript
|
|
167
|
+
pip install -e .
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Формат конфигурации
|
|
171
|
+
```toml
|
|
172
|
+
[tool.devscript]
|
|
173
|
+
build = "python -m build"
|
|
174
|
+
test = "pytest tests/"
|
|
175
|
+
lint = "flake8 src/"
|
|
176
|
+
dev = "python -m app --debug"
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Запуск команд
|
|
180
|
+
#### Пакет предоставляет четыре CLI-команды:
|
|
181
|
+
- `devscript` — полное имя
|
|
182
|
+
- `devscr` — сокращение
|
|
183
|
+
- `devs` — короткое
|
|
184
|
+
- `dvs` — самое короткое
|
|
185
|
+
|
|
186
|
+
#### Все они работают одинаково:
|
|
187
|
+
```shell
|
|
188
|
+
# Показать список доступных команд
|
|
189
|
+
devscript --help
|
|
190
|
+
|
|
191
|
+
# Запустить команду
|
|
192
|
+
devscript build
|
|
193
|
+
devscr dev
|
|
194
|
+
devs test
|
|
195
|
+
dvs lint
|
|
196
|
+
|
|
197
|
+
# Передать аргументы команде
|
|
198
|
+
devscript dev --port 8000 --reload
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Примеры
|
|
202
|
+
### Пример 1: Базовое использование
|
|
203
|
+
```toml
|
|
204
|
+
# pyproject.toml
|
|
205
|
+
[tool.devscript]
|
|
206
|
+
start = "uvicorn main:app --reload"
|
|
207
|
+
migrate = "alembic upgrade head"
|
|
208
|
+
shell = "ipython"
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```shell
|
|
212
|
+
devs start # Запускает uvicorn сервер
|
|
213
|
+
devs migrate # Применяет миграции
|
|
214
|
+
devs shell # Запускает IPython
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Пример 2: Передача аргументов
|
|
218
|
+
```toml
|
|
219
|
+
[tool.devscript]
|
|
220
|
+
test = "pytest"
|
|
221
|
+
cov = "pytest --cov=src"
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
```shell
|
|
225
|
+
devs test tests/test_api.py -v # pytest tests/test_api.py -v
|
|
226
|
+
devs cov --cov-report=html # pytest --cov=src --cov-report=html
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
## Разработка
|
|
230
|
+
### Python версия
|
|
231
|
+
```shell
|
|
232
|
+
# Клонировать репозиторий
|
|
233
|
+
git clone https://github.com/MagIlyasDOMA/devscript.git
|
|
234
|
+
cd devscript
|
|
235
|
+
|
|
236
|
+
# Установить в режиме разработки
|
|
237
|
+
pip install -e .
|
|
238
|
+
|
|
239
|
+
# Запустить тесты
|
|
240
|
+
devs test
|
|
241
|
+
|
|
242
|
+
# Запустить линтер
|
|
243
|
+
devs lint
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Структура проекта
|
|
247
|
+
```text
|
|
248
|
+
devscript/
|
|
249
|
+
├── devscript.py # Python-реализация
|
|
250
|
+
├── pyproject.toml
|
|
251
|
+
├── README.md
|
|
252
|
+
├── schema.json # JSON Schema для автодополнения
|
|
253
|
+
└── LICENSE
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## JSON Schema
|
|
257
|
+
Для автодополнения и валидации в редакторах кода используйте схему:
|
|
258
|
+
```json
|
|
259
|
+
{
|
|
260
|
+
"$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json"
|
|
261
|
+
}
|
|
262
|
+
```
|
|
263
|
+
|
|
264
|
+
## API
|
|
265
|
+
### Использование в коде
|
|
266
|
+
#### Python
|
|
267
|
+
```python
|
|
268
|
+
from devscript import DevScriptCore
|
|
269
|
+
|
|
270
|
+
core = DevScriptCore()
|
|
271
|
+
print("Доступные команды:", core.commands_list())
|
|
272
|
+
core.run("build", ["--verbose"])
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
## Требования
|
|
276
|
+
### Python версия
|
|
277
|
+
- Python 3.11 или выше
|
|
278
|
+
- Нет внешних зависимостей (использует стандартную библиотеку)
|
|
279
|
+
|
|
280
|
+
## Лицензия
|
|
281
|
+
GPL-3.0-only
|
|
282
|
+
|
|
283
|
+
## Автор
|
|
284
|
+
#### Маг Ильяс DOMA (MagIlyasDOMA)
|
|
285
|
+
- GitHub: [@MagIlyasDOMA](https://github.com/MagIlyasDOMA)
|
|
286
|
+
- Проект: [devscript](https://github.com/MagIlyasDOMA/devscript)
|
|
287
|
+
|
|
288
|
+
## Вклад в разработку
|
|
289
|
+
1. Форкните репозиторий
|
|
290
|
+
2. Создайте ветку для фичи (`git checkout -b feature/amazing-feature`)
|
|
291
|
+
3. Закоммитьте изменения (`git commit -m 'Add some amazing feature'`)
|
|
292
|
+
4. Запушьте в ветку (`git push origin feature/amazing-feature`)
|
|
293
|
+
5. Откройте Pull Request
|