devscript 0.1.2__tar.gz → 0.2.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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devscript
3
- Version: 0.1.2
4
- Summary: A utility for managing custom development scripts via JSON or TOML configuration
3
+ Version: 0.2.0
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,19 +9,15 @@ 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.8
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>
@@ -45,66 +41,15 @@ cd devscript
45
41
  pip install -e .
46
42
  ```
47
43
 
48
- ### TypeScript version
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
- ```json
149
- {
150
- "test": "pytest",
151
- "cov": "pytest --cov=src"
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
- ├── python/ # Python implementation
203
- ├── devscript/
204
- │ │ ├── __init__.py
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.8 or higher
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,20 +166,6 @@ 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>
@@ -304,66 +189,15 @@ cd devscript
304
189
  pip install -e .
305
190
  ```
306
191
 
307
- ### TypeScript версия
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
- ```json
407
- {
408
- "test": "pytest",
409
- "cov": "pytest --cov=src"
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
- ├── python/ # Python реализация
461
- ├── devscript/
462
- │ │ ├── __init__.py
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.8 или выше
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.
@@ -19,66 +19,15 @@ cd devscript
19
19
  pip install -e .
20
20
  ```
21
21
 
22
- ### TypeScript version
23
- ```shell
24
- npm install -D @hren/devscript
25
- # or
26
- yarn add -D @hren/devscript
27
- # or
28
- pnpm add -D @hren/devscript
29
- ```
30
-
31
- #### Or install from source:
32
-
33
- ```shell
34
- git clone https://github.com/MagIlyasDOMA/devscript.git
35
- cd devscript
36
- npm install
37
- npm run build
38
- npm link
39
- ```
40
-
41
- ### Configuration formats
42
- #### JSON (`devscript.json`)
43
- ```json
44
- {
45
- "$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json",
46
- "build": "python -m build",
47
- "test": "pytest tests/",
48
- "lint": "flake8 src/",
49
- "dev": "python -m app --debug"
50
- }
51
- ```
52
-
53
- #### YAML (`devscript.yaml`)
54
- ```yaml
55
- build: "python -m build"
56
- test: "pytest tests/"
57
- lint: "flake8 src/"
58
- dev: "python -m app --debug"
59
- ```
60
-
61
- #### TOML (`pyproject.toml`)
22
+ ### Configuration format
62
23
  ```toml
63
- [devscript]
24
+ [tool.devscript]
64
25
  build = "python -m build"
65
26
  test = "pytest tests/"
66
27
  lint = "flake8 src/"
67
28
  dev = "python -m app --debug"
68
29
  ```
69
30
 
70
- #### `package.json`
71
- ```json
72
- {
73
- "devscript": {
74
- "build": "python -m build",
75
- "test": "pytest tests/",
76
- "lint": "flake8 src/",
77
- "dev": "python -m app --debug"
78
- }
79
- }
80
- ```
81
-
82
31
  ### Running commands
83
32
  #### The package provides four CLI commands:
84
33
  - `devscript` — full name
@@ -100,13 +49,12 @@ dvs lint
100
49
  # Pass arguments to a command
101
50
  devscript dev --port 8000 --reload
102
51
  ```
103
- Here is the translation of the text into English, with the markdown formatting preserved:
104
52
 
105
53
  ## Examples
106
54
  ### Example 1: Basic usage
107
55
  ```toml
108
56
  # pyproject.toml
109
- [devscript]
57
+ [tool.devscript]
110
58
  start = "uvicorn main:app --reload"
111
59
  migrate = "alembic upgrade head"
112
60
  shell = "ipython"
@@ -119,11 +67,10 @@ devs shell # Starts IPython
119
67
  ```
120
68
 
121
69
  ### Example 2: Passing arguments
122
- ```json
123
- {
124
- "test": "pytest",
125
- "cov": "pytest --cov=src"
126
- }
70
+ ```toml
71
+ [tool.devscript]
72
+ test = "pytest"
73
+ cov = "pytest --cov=src"
127
74
  ```
128
75
 
129
76
  ```shell
@@ -148,42 +95,12 @@ devs test
148
95
  devs lint
149
96
  ```
150
97
 
151
- ### TypeScript version
152
- ```shell
153
- # Clone the repository
154
- git clone https://github.com/MagIlyasDOMA/devscript.git
155
- cd devscript
156
-
157
- # Install dependencies
158
- npm install
159
-
160
- # Build the project
161
- npm run build
162
-
163
- # Install in development mode
164
- npm link
165
-
166
- # Run tests
167
- devs test
168
-
169
- # Run linter
170
- devs lint
171
- ```
172
-
173
98
  ## Project structure
174
99
  ```text
175
100
  devscript/
176
- ├── python/ # Python implementation
177
- ├── devscript/
178
- │ │ ├── __init__.py
179
- │ │ └── py.typed
180
- │ ├── pyproject.toml
181
- │ └── README.md
182
- ├── typescript/ # TypeScript implementation
183
- │ ├── devscript.ts
184
- │ ├── package.json
185
- │ ├── tsconfig.json
186
- │ └── README.md
101
+ ├── devscript.py # Python implementation
102
+ ├── pyproject.toml
103
+ ├── README.md
187
104
  ├── schema.json # JSON Schema for autocompletion
188
105
  └── LICENSE
189
106
  ```
@@ -207,25 +124,11 @@ print("Available commands:", core.commands_list())
207
124
  core.run("build", ["--verbose"])
208
125
  ```
209
126
 
210
- #### Typescript
211
- ```typescript
212
- import { DevScriptCore } from 'devscript';
213
- ```
214
- ```javascript
215
- const core = new DevScriptCore();
216
- console.log("Available commands:", core.commands_list());
217
- core.run("build", ["--verbose"]);
218
- ```
219
-
220
127
  ## Requirements
221
128
  ### Python version
222
- - Python 3.8 or higher
129
+ - Python 3.11 or higher
223
130
  - No external dependencies (uses the standard library)
224
131
 
225
- ### TypeScript version
226
- - Node.js 14 or higher
227
- - Dependencies: argparse, smol-toml
228
-
229
132
  ## License
230
133
  GPL-3.0-only
231
134
 
@@ -241,20 +144,6 @@ GPL-3.0-only
241
144
  4. Push to the branch (`git push origin feature/amazing-feature`)
242
145
  5. Open a Pull Request
243
146
 
244
- ## Frequently Asked Questions
245
- ##### Q: Can I use both versions at the same time?
246
- A: Yes, they do not conflict as they use different commands for installation (pip vs npm).
247
-
248
- ##### Q: Are other configuration formats supported?
249
- A: Currently, JSON, YAML, pyproject.toml, and package.json are supported.
250
-
251
- ##### Q: How do I add a new command?
252
- A: Just add a new entry in the configuration file with the command name and the corresponding shell command.
253
-
254
- ##### Q: Does it work on Windows?
255
- A: Yes, both versions have been tested on Windows.
256
-
257
-
258
147
  ---
259
148
 
260
149
  <a id="doc_ru"></a>
@@ -278,66 +167,15 @@ cd devscript
278
167
  pip install -e .
279
168
  ```
280
169
 
281
- ### TypeScript версия
282
- ```shell
283
- npm install -D @hren/devscript
284
- # или
285
- yarn add -D @hren/devscript
286
- # или
287
- pnpm add -D @hren/devscript
288
- ```
289
-
290
- #### Или установка из исходного кода:
291
-
292
- ```shell
293
- git clone https://github.com/MagIlyasDOMA/devscript.git
294
- cd devscript
295
- npm install
296
- npm run build
297
- npm link
298
- ```
299
-
300
- ### Форматы конфигурации
301
- #### JSON (`devscript.json`)
302
- ```json
303
- {
304
- "$schema": "https://raw.githubusercontent.com/MagIlyasDOMA/devscript/refs/heads/main/schema.json",
305
- "build": "python -m build",
306
- "test": "pytest tests/",
307
- "lint": "flake8 src/",
308
- "dev": "python -m app --debug"
309
- }
310
- ```
311
-
312
- #### YAML (`devscript.yaml`)
313
- ```yaml
314
- build: "python -m build"
315
- test: "pytest tests/"
316
- lint: "flake8 src/"
317
- dev: "python -m app --debug"
318
- ```
319
-
320
- #### TOML (`pyproject.toml`)
170
+ ### Формат конфигурации
321
171
  ```toml
322
- [devscript]
172
+ [tool.devscript]
323
173
  build = "python -m build"
324
174
  test = "pytest tests/"
325
175
  lint = "flake8 src/"
326
176
  dev = "python -m app --debug"
327
177
  ```
328
178
 
329
- #### `package.json`
330
- ```json
331
- {
332
- "devscript": {
333
- "build": "python -m build",
334
- "test": "pytest tests/",
335
- "lint": "flake8 src/",
336
- "dev": "python -m app --debug"
337
- }
338
- }
339
- ```
340
-
341
179
  ### Запуск команд
342
180
  #### Пакет предоставляет четыре CLI-команды:
343
181
  - `devscript` — полное имя
@@ -364,7 +202,7 @@ devscript dev --port 8000 --reload
364
202
  ### Пример 1: Базовое использование
365
203
  ```toml
366
204
  # pyproject.toml
367
- [devscript]
205
+ [tool.devscript]
368
206
  start = "uvicorn main:app --reload"
369
207
  migrate = "alembic upgrade head"
370
208
  shell = "ipython"
@@ -377,11 +215,10 @@ devs shell # Запускает IPython
377
215
  ```
378
216
 
379
217
  ### Пример 2: Передача аргументов
380
- ```json
381
- {
382
- "test": "pytest",
383
- "cov": "pytest --cov=src"
384
- }
218
+ ```toml
219
+ [tool.devscript]
220
+ test = "pytest"
221
+ cov = "pytest --cov=src"
385
222
  ```
386
223
 
387
224
  ```shell
@@ -406,42 +243,12 @@ devs test
406
243
  devs lint
407
244
  ```
408
245
 
409
- ### TypeScript версия
410
- ```shell
411
- # Клонировать репозиторий
412
- git clone https://github.com/MagIlyasDOMA/devscript.git
413
- cd devscript
414
-
415
- # Установить зависимости
416
- npm install
417
-
418
- # Собрать проект
419
- npm run build
420
-
421
- # Установить в режиме разработки
422
- npm link
423
-
424
- # Запустить тесты
425
- devs test
426
-
427
- # Запустить линтер
428
- devs lint
429
- ```
430
-
431
246
  ## Структура проекта
432
247
  ```text
433
248
  devscript/
434
- ├── python/ # Python реализация
435
- ├── devscript/
436
- │ │ ├── __init__.py
437
- │ │ └── py.typed
438
- │ ├── pyproject.toml
439
- │ └── README.md
440
- ├── typescript/ # TypeScript реализация
441
- │ ├── devscript.ts
442
- │ ├── package.json
443
- │ ├── tsconfig.json
444
- │ └── README.md
249
+ ├── devscript.py # Python-реализация
250
+ ├── pyproject.toml
251
+ ├── README.md
445
252
  ├── schema.json # JSON Schema для автодополнения
446
253
  └── LICENSE
447
254
  ```
@@ -465,24 +272,11 @@ print("Доступные команды:", core.commands_list())
465
272
  core.run("build", ["--verbose"])
466
273
  ```
467
274
 
468
- #### Typescript
469
- ```typescript
470
- import { DevScriptCore } from 'devscript';
471
-
472
- const core = new DevScriptCore();
473
- console.log("Доступные команды:", core.commands_list());
474
- core.run("build", ["--verbose"]);
475
- ```
476
-
477
275
  ## Требования
478
276
  ### Python версия
479
- - Python 3.8 или выше
277
+ - Python 3.11 или выше
480
278
  - Нет внешних зависимостей (использует стандартную библиотеку)
481
279
 
482
- ### TypeScript версия
483
- - Node.js 14 или выше
484
- - Зависимости: argparse, smol-toml
485
-
486
280
  ## Лицензия
487
281
  GPL-3.0-only
488
282
 
@@ -497,16 +291,3 @@ GPL-3.0-only
497
291
  3. Закоммитьте изменения (`git commit -m 'Add some amazing feature'`)
498
292
  4. Запушьте в ветку (`git push origin feature/amazing-feature`)
499
293
  5. Откройте Pull Request
500
-
501
- ## Часто задаваемые вопросы
502
- ##### Q: Могу ли я использовать обе версии одновременно?
503
- A: Да, они не конфликтуют, так как используют разные команды для установки (pip vs npm).
504
-
505
- ##### Q: Поддерживаются ли другие форматы конфигурации?
506
- A: В данный момент поддерживаются JSON, YAML, pyproject.toml и package.json
507
-
508
- ##### Q: Как добавить новую команду?
509
- A: Просто добавьте новую запись в конфигурационный файл с именем команды и соответствующей shell-командой.
510
-
511
- ##### Q: Работает ли на Windows?
512
- A: Да, обе версии протестированы на Windows.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: devscript
3
- Version: 0.1.2
4
- Summary: A utility for managing custom development scripts via JSON or TOML configuration
3
+ Version: 0.2.0
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,19 +9,15 @@ 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.8
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>
@@ -45,66 +41,15 @@ cd devscript
45
41
  pip install -e .
46
42
  ```
47
43
 
48
- ### TypeScript version
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
- ```json
149
- {
150
- "test": "pytest",
151
- "cov": "pytest --cov=src"
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
- ├── python/ # Python implementation
203
- ├── devscript/
204
- │ │ ├── __init__.py
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.8 or higher
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,20 +166,6 @@ 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>
@@ -304,66 +189,15 @@ cd devscript
304
189
  pip install -e .
305
190
  ```
306
191
 
307
- ### TypeScript версия
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
- ```json
407
- {
408
- "test": "pytest",
409
- "cov": "pytest --cov=src"
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
- ├── python/ # Python реализация
461
- ├── devscript/
462
- │ │ ├── __init__.py
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.8 или выше
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.
@@ -1,10 +1,9 @@
1
1
  LICENSE
2
2
  README.md
3
+ devscript.py
3
4
  pyproject.toml
4
- devscript/__init__.py
5
5
  devscript.egg-info/PKG-INFO
6
6
  devscript.egg-info/SOURCES.txt
7
7
  devscript.egg-info/dependency_links.txt
8
8
  devscript.egg-info/entry_points.txt
9
- devscript.egg-info/requires.txt
10
9
  devscript.egg-info/top_level.txt
@@ -0,0 +1,35 @@
1
+ import argparse, os, tomllib
2
+ from dataclasses import dataclass
3
+ from typing import Literal
4
+
5
+ __version__ = '0.2.0'
6
+
7
+
8
+ class DevScriptCore:
9
+ def __init__(self):
10
+ try: self.config = self.read_config()['tool']['devscript']
11
+ except KeyError: raise FileNotFoundError('Config not found')
12
+
13
+ @staticmethod
14
+ def read_config() -> dict:
15
+ if os.path.isfile('pyproject.toml'):
16
+ with open('pyproject.toml', 'rb') as file: return tomllib.load(file)
17
+ else: raise FileNotFoundError('Config not found')
18
+
19
+ def commands_list(self): return self.config.keys()
20
+
21
+ def run(self, command: str, argv: list[str]):
22
+ if command not in self.commands_list():
23
+ raise ValueError(f'Invalid command: {command}')
24
+ os.system(' '.join([self.config[command]] + argv))
25
+
26
+
27
+ def main():
28
+ core = DevScriptCore()
29
+ parser = argparse.ArgumentParser()
30
+ parser.add_argument('command', type=str, help='script to run', choices=core.commands_list())
31
+ args, argv = parser.parse_known_args()
32
+ core.run(args.command, argv)
33
+
34
+
35
+ if __name__ == '__main__': main()
@@ -4,9 +4,9 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "devscript"
7
- version = "0.1.2"
8
- description = "A utility for managing custom development scripts via JSON or TOML configuration"
9
- requires-python = ">=3.8"
7
+ version = "0.2.0"
8
+ description = "A utility for managing custom development scripts pyproject.toml configuration"
9
+ requires-python = ">=3.11"
10
10
  license = {text = "GPL-3.0-only"}
11
11
 
12
12
  readme = "README.md"
@@ -16,9 +16,6 @@ authors = [
16
16
 
17
17
  classifiers = [
18
18
  "Programming Language :: Python :: 3",
19
- "Programming Language :: Python :: 3.8",
20
- "Programming Language :: Python :: 3.9",
21
- "Programming Language :: Python :: 3.10",
22
19
  "Programming Language :: Python :: 3.11",
23
20
  "Programming Language :: Python :: 3.12",
24
21
  "Programming Language :: Python :: 3.13",
@@ -28,9 +25,6 @@ classifiers = [
28
25
  ]
29
26
 
30
27
  keywords = ["cli", "scripts"]
31
- dependencies = [
32
- "pyyaml>=6.0.3",
33
- ]
34
28
 
35
29
  [project.urls]
36
30
  Homepage = "https://github.com/MagIlyasDOMA/devscript"
@@ -44,10 +38,4 @@ devs = "devscript:main"
44
38
  dvs = "devscript:main"
45
39
 
46
40
  [tool.setuptools]
47
- packages = ["devscript"]
48
-
49
- [dependency-groups]
50
- dev = [
51
- "build>=1.2.2.post1",
52
- "pyinstaller>=6.19.0",
53
- ]
41
+ py-modules = ["devscript"]
@@ -1,69 +0,0 @@
1
- import argparse, os, json, tomllib, yaml
2
- from dataclasses import dataclass
3
- from typing import Literal
4
-
5
- __version__ = '0.1.2'
6
-
7
-
8
- @dataclass
9
- class DevScriptConfig:
10
- type: Literal['json', 'toml', 'npmjs', 'yaml']
11
- data: dict
12
-
13
-
14
- class DevScriptCore:
15
- def __init__(self):
16
- self._config_obj = self.read_config()
17
- try:
18
- if self._config_obj.type == 'json':
19
- self.config = self._config_obj.data
20
- self._config_file = 'devscript.json'
21
- elif self._config_obj.type == 'yaml':
22
- self.config = self._config_obj.data
23
- self._config_file = 'devscript.yaml'
24
- elif self._config_obj.type == 'toml':
25
- self.config = self._config_obj.data.get('tool')['devscript'] or self._config_obj.data['devscript']
26
- self._config_file = 'pyproject.toml'
27
- elif self._config_obj.type == 'npmjs':
28
- self.config = self._config_obj.data['devscript']
29
- self._config_file = 'package.json'
30
- else: raise FileNotFoundError('Config not found')
31
- except KeyError:
32
- raise FileNotFoundError('Config not found')
33
-
34
- @staticmethod
35
- def read_config() -> DevScriptConfig:
36
- if os.path.isfile('devscript.json'):
37
- with open('devscript.json', encoding='utf-8') as file:
38
- data = json.load(file)
39
- if '$schema' in data: del data['$schema']
40
- return DevScriptConfig('json', data)
41
- elif os.path.isfile('devscript.yaml'):
42
- with open('devscript.yaml', encoding='utf-8') as file:
43
- return DevScriptConfig('yaml', yaml.safe_load(file))
44
- elif os.path.isfile('pyproject.toml'):
45
- with open('pyproject.toml', 'rb') as file:
46
- return DevScriptConfig('toml', tomllib.load(file))
47
- elif os.path.isfile('package.json'):
48
- with open('package.json', 'r', encoding='utf-8') as file:
49
- return DevScriptConfig('npmjs', json.load(file))
50
- else: raise FileNotFoundError('Config not found')
51
-
52
- def commands_list(self):
53
- return self.config.keys()
54
-
55
- def run(self, command: str, argv: list[str]):
56
- if command not in self.commands_list():
57
- raise ValueError(f'Invalid command: {command}')
58
- os.system(' '.join([self.config[command]] + argv))
59
-
60
-
61
- def main():
62
- core = DevScriptCore()
63
- parser = argparse.ArgumentParser()
64
- parser.add_argument('command', type=str, help='script to run', choices=core.commands_list())
65
- args, argv = parser.parse_known_args()
66
- core.run(args.command, argv)
67
-
68
-
69
- if __name__ == '__main__': main()
@@ -1 +0,0 @@
1
- pyyaml>=6.0.3
File without changes
File without changes