coco-tools 0.19__tar.gz → 0.20__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.
- {coco-tools-0.19/coco_tools.egg-info → coco_tools-0.20}/PKG-INFO +61 -14
- coco-tools-0.19/PKG-INFO → coco_tools-0.20/README.md +48 -24
- {coco-tools-0.19 → coco_tools-0.20}/coco/__init__.py +1 -1
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/elements.py +2 -2
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/grammar.py +14 -14
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/parser.py +1 -1
- {coco-tools-0.19 → coco_tools-0.20}/coco/maxtoppm.py +1 -1
- coco-tools-0.19/README.md → coco_tools-0.20/coco_tools.egg-info/PKG-INFO +71 -6
- coco_tools-0.20/coco_tools.egg-info/SOURCES.txt +67 -0
- coco_tools-0.20/coco_tools.egg-info/top_level.txt +5 -0
- coco_tools-0.20/pyproject.toml +87 -0
- coco_tools-0.20/tests/coco_tests/b09/__init__.py +0 -0
- coco_tools-0.20/tests/coco_tests/b09/test_b09.py +1465 -0
- coco_tools-0.20/tests/coco_tests/b09/test_configs.py +66 -0
- coco_tools-0.20/tests/coco_tests/b09/test_visitors.py +105 -0
- coco_tools-0.20/tests/coco_tests/fixtures/__init__.py +0 -0
- coco_tools-0.20/tests/test_error_handler.py +31 -0
- coco-tools-0.19/coco_tools.egg-info/SOURCES.txt +0 -32
- coco-tools-0.19/coco_tools.egg-info/top_level.txt +0 -1
- coco-tools-0.19/setup.py +0 -68
- {coco-tools-0.19 → coco_tools-0.20}/LICENSE +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/__init__.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/compiler.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/configs.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/error_handler.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/procbank.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/prog.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/b09/visitors.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/cm3toppm.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/decb_to_b09.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/hrstoppm.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/mge_viewer2.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/mgetoppm.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/pixtopgm.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/rattoppm.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/resources/__init__.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/resources/ecb.b09 +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/util.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco/veftopng.py +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco_tools.egg-info/dependency_links.txt +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco_tools.egg-info/entry_points.txt +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/coco_tools.egg-info/requires.txt +0 -0
- {coco-tools-0.19 → coco_tools-0.20}/setup.cfg +0 -0
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: coco-tools
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.20
|
|
4
4
|
Summary: TRS-80 Color Computer Tools
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Keywords: coco
|
|
5
|
+
Author-email: Jamie Cho <jamieleecho@gmail.com>
|
|
6
|
+
License-Expression: GPL-2.0
|
|
7
|
+
Project-URL: Repository, https://github.com/jamieleecho/coco-tools
|
|
8
|
+
Project-URL: Issues, https://github.com/jamieleecho/coco-tools/issues
|
|
9
|
+
Keywords: coco,image,conversion,trs-80,tandy
|
|
10
10
|
Classifier: Development Status :: 3 - Alpha
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
13
|
Classifier: Programming Language :: Python :: 3
|
|
15
14
|
Requires-Python: >=3.9.19
|
|
16
15
|
Description-Content-Type: text/markdown
|
|
17
16
|
License-File: LICENSE
|
|
17
|
+
Requires-Dist: parsimonious>=0.10.0
|
|
18
|
+
Requires-Dist: Pillow>=7.0.0
|
|
19
|
+
Requires-Dist: pypng>=0.0.18
|
|
20
|
+
Requires-Dist: pydantic>=2.0.0
|
|
21
|
+
Requires-Dist: pydantic-yaml>=1.3.0
|
|
22
|
+
Dynamic: license-file
|
|
18
23
|
|
|
19
24
|
# coco-tools
|
|
20
25
|
|
|
@@ -30,9 +35,31 @@ pip install coco-tools
|
|
|
30
35
|
# To install from source
|
|
31
36
|
git clone https://github.com/jamieleecho/coco-tools.git
|
|
32
37
|
cd coco-tools
|
|
33
|
-
|
|
38
|
+
make install-pre-commit
|
|
39
|
+
make install
|
|
34
40
|
```
|
|
35
41
|
|
|
42
|
+
The `Makefile` makes it easy to perform the most common operations:
|
|
43
|
+
* `make all` transpiles several exapmle ECB programs to Basic09
|
|
44
|
+
* `make check-all` runs linting and `uv.lock` checks
|
|
45
|
+
* `make check-lint` checks for linting issues
|
|
46
|
+
* `make check-lock` verifies the `uv.lock` is aligned to `pyproject.toml`
|
|
47
|
+
* `make clean` cleans the virtual environment and caches
|
|
48
|
+
* `make default` runs a default set of checks on the code
|
|
49
|
+
* `make fix-all` formats the code, fixes lint errors and runs locks `uv.lock` to `pyproject.toml`
|
|
50
|
+
* `make fix-format` formats the code
|
|
51
|
+
* `make fix-lint` fixes linting issues
|
|
52
|
+
* `make fix-lint-unsafe` fixes linting issues potentially adding inadvertant bugs
|
|
53
|
+
* `make help` outputs the different make options
|
|
54
|
+
* `make install` build install the distribution
|
|
55
|
+
* `make install-pre-commit` installs pre-commit hooks
|
|
56
|
+
* `make lock` locks `uv.lock` to `pyproject.toml`
|
|
57
|
+
* `make install-pre-commit` installs pre-commit hooks
|
|
58
|
+
* `make run-tests` runs the unit tests
|
|
59
|
+
* `make sync` syncs the python environment with `uv.lock`
|
|
60
|
+
|
|
61
|
+
`.vscode/settings.json` is set so that unit tests can be run without further configuration.
|
|
62
|
+
|
|
36
63
|
## Tools
|
|
37
64
|
|
|
38
65
|
### [decb-to-b09](./README.decb-to-b09.md)
|
|
@@ -248,18 +275,38 @@ options:
|
|
|
248
275
|
## Developing and Testing
|
|
249
276
|
|
|
250
277
|
```
|
|
278
|
+
# To set up pre-commit checks
|
|
279
|
+
pre-commit install
|
|
280
|
+
|
|
251
281
|
# Build the docker image
|
|
252
|
-
docker
|
|
282
|
+
docker compose build test
|
|
253
283
|
|
|
254
284
|
# Run tests using the source on the docker image
|
|
255
|
-
docker
|
|
285
|
+
docker compose run test
|
|
256
286
|
|
|
257
287
|
# Run tests using the source on the host computer
|
|
258
|
-
docker
|
|
288
|
+
docker compose run testv
|
|
259
289
|
|
|
260
|
-
# To
|
|
290
|
+
# To develop locally
|
|
261
291
|
pip install -r requirements.txt
|
|
262
|
-
|
|
292
|
+
|
|
293
|
+
# Run linting, build example disk images for basic conversion
|
|
294
|
+
make
|
|
295
|
+
|
|
296
|
+
# Remove built artifacts
|
|
297
|
+
make clean
|
|
298
|
+
|
|
299
|
+
# Reformats the code
|
|
300
|
+
make format
|
|
301
|
+
|
|
302
|
+
# Only runs linting
|
|
303
|
+
make lint
|
|
304
|
+
|
|
305
|
+
# Only run tests
|
|
306
|
+
make test
|
|
307
|
+
|
|
308
|
+
# Build basic and os-9 eample images
|
|
309
|
+
make basic.dsk os9boot.dsk
|
|
263
310
|
```
|
|
264
311
|
|
|
265
312
|
## Credits
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: coco-tools
|
|
3
|
-
Version: 0.19
|
|
4
|
-
Summary: TRS-80 Color Computer Tools
|
|
5
|
-
Home-page: https://github.com/jamieleecho/coco-tools
|
|
6
|
-
Author: Jamie Cho
|
|
7
|
-
Author-email: jamieleecho+coco_tools@gmail.com
|
|
8
|
-
License: GPLv2
|
|
9
|
-
Keywords: coco image conversion trs-80 tandy
|
|
10
|
-
Classifier: Development Status :: 3 - Alpha
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Requires-Python: >=3.9.19
|
|
16
|
-
Description-Content-Type: text/markdown
|
|
17
|
-
License-File: LICENSE
|
|
18
|
-
|
|
19
1
|
# coco-tools
|
|
20
2
|
|
|
21
3
|
This is a simple collection of tools to assist with developing software for
|
|
@@ -30,9 +12,31 @@ pip install coco-tools
|
|
|
30
12
|
# To install from source
|
|
31
13
|
git clone https://github.com/jamieleecho/coco-tools.git
|
|
32
14
|
cd coco-tools
|
|
33
|
-
|
|
15
|
+
make install-pre-commit
|
|
16
|
+
make install
|
|
34
17
|
```
|
|
35
18
|
|
|
19
|
+
The `Makefile` makes it easy to perform the most common operations:
|
|
20
|
+
* `make all` transpiles several exapmle ECB programs to Basic09
|
|
21
|
+
* `make check-all` runs linting and `uv.lock` checks
|
|
22
|
+
* `make check-lint` checks for linting issues
|
|
23
|
+
* `make check-lock` verifies the `uv.lock` is aligned to `pyproject.toml`
|
|
24
|
+
* `make clean` cleans the virtual environment and caches
|
|
25
|
+
* `make default` runs a default set of checks on the code
|
|
26
|
+
* `make fix-all` formats the code, fixes lint errors and runs locks `uv.lock` to `pyproject.toml`
|
|
27
|
+
* `make fix-format` formats the code
|
|
28
|
+
* `make fix-lint` fixes linting issues
|
|
29
|
+
* `make fix-lint-unsafe` fixes linting issues potentially adding inadvertant bugs
|
|
30
|
+
* `make help` outputs the different make options
|
|
31
|
+
* `make install` build install the distribution
|
|
32
|
+
* `make install-pre-commit` installs pre-commit hooks
|
|
33
|
+
* `make lock` locks `uv.lock` to `pyproject.toml`
|
|
34
|
+
* `make install-pre-commit` installs pre-commit hooks
|
|
35
|
+
* `make run-tests` runs the unit tests
|
|
36
|
+
* `make sync` syncs the python environment with `uv.lock`
|
|
37
|
+
|
|
38
|
+
`.vscode/settings.json` is set so that unit tests can be run without further configuration.
|
|
39
|
+
|
|
36
40
|
## Tools
|
|
37
41
|
|
|
38
42
|
### [decb-to-b09](./README.decb-to-b09.md)
|
|
@@ -248,18 +252,38 @@ options:
|
|
|
248
252
|
## Developing and Testing
|
|
249
253
|
|
|
250
254
|
```
|
|
255
|
+
# To set up pre-commit checks
|
|
256
|
+
pre-commit install
|
|
257
|
+
|
|
251
258
|
# Build the docker image
|
|
252
|
-
docker
|
|
259
|
+
docker compose build test
|
|
253
260
|
|
|
254
261
|
# Run tests using the source on the docker image
|
|
255
|
-
docker
|
|
262
|
+
docker compose run test
|
|
256
263
|
|
|
257
264
|
# Run tests using the source on the host computer
|
|
258
|
-
docker
|
|
265
|
+
docker compose run testv
|
|
259
266
|
|
|
260
|
-
# To
|
|
267
|
+
# To develop locally
|
|
261
268
|
pip install -r requirements.txt
|
|
262
|
-
|
|
269
|
+
|
|
270
|
+
# Run linting, build example disk images for basic conversion
|
|
271
|
+
make
|
|
272
|
+
|
|
273
|
+
# Remove built artifacts
|
|
274
|
+
make clean
|
|
275
|
+
|
|
276
|
+
# Reformats the code
|
|
277
|
+
make format
|
|
278
|
+
|
|
279
|
+
# Only runs linting
|
|
280
|
+
make lint
|
|
281
|
+
|
|
282
|
+
# Only run tests
|
|
283
|
+
make test
|
|
284
|
+
|
|
285
|
+
# Build basic and os-9 eample images
|
|
286
|
+
make basic.dsk os9boot.dsk
|
|
263
287
|
```
|
|
264
288
|
|
|
265
289
|
## Credits
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# __version__ MUST be defined on line 2
|
|
2
|
-
__version__ = "0.
|
|
2
|
+
__version__ = "0.20"
|
|
@@ -493,7 +493,7 @@ class BasicLine(AbstractBasicConstruct):
|
|
|
493
493
|
|
|
494
494
|
def basic09_text(self, indent_level) -> str:
|
|
495
495
|
if self._is_referenced and self._num is not None:
|
|
496
|
-
return f"{self._num}
|
|
496
|
+
return f"{self._num} {self._statements.basic09_text(indent_level)}"
|
|
497
497
|
return f"{self._statements.basic09_text(indent_level)}"
|
|
498
498
|
|
|
499
499
|
def visit(self, visitor: "BasicConstructVisitor") -> None:
|
|
@@ -827,7 +827,7 @@ class BasicFunctionCall(AbstractBasicExpression):
|
|
|
827
827
|
self._args = args
|
|
828
828
|
|
|
829
829
|
def basic09_text(self, indent_level: int) -> str:
|
|
830
|
-
return f"{self._func}
|
|
830
|
+
return f"{self._func}{self._args.basic09_text(indent_level)}"
|
|
831
831
|
|
|
832
832
|
|
|
833
833
|
class BasicDataStatement(AbstractBasicStatement):
|
|
@@ -133,7 +133,7 @@ KEYWORDS = "|".join(
|
|
|
133
133
|
"GOSUB",
|
|
134
134
|
"GOTO",
|
|
135
135
|
"HBUFF",
|
|
136
|
-
"
|
|
136
|
+
"HGETHCIRCLE",
|
|
137
137
|
"HCLS",
|
|
138
138
|
"HCOLOR",
|
|
139
139
|
"HEX$",
|
|
@@ -299,8 +299,8 @@ grammar = Grammar(
|
|
|
299
299
|
/ hget_statement
|
|
300
300
|
/ hput_statement
|
|
301
301
|
/ hpaint_statement
|
|
302
|
-
statement2 = ({
|
|
303
|
-
statement3 = ({
|
|
302
|
+
statement2 = ({" / ".join(QUOTED_STATEMENTS2_NAMES)}) space* "(" space* exp space* "," space* exp space* ")" space*
|
|
303
|
+
statement3 = ({" / ".join(QUOTED_STATEMENTS3_NAMES)}) space* "(" space* exp space* "," space* exp space* "," space* exp space* ")" space*
|
|
304
304
|
statements = statement? space* statements_elements space* last_statement?
|
|
305
305
|
last_statement = comment / partial_str_arr_assign / partial_str_assign
|
|
306
306
|
partial_str_arr_assign = "LET"? space* str_array_ref_exp space* "=" space* partial_str_lit
|
|
@@ -342,8 +342,8 @@ grammar = Grammar(
|
|
|
342
342
|
num_power_exp = val_exp space* num_power_sub_exps
|
|
343
343
|
num_power_sub_exps = num_power_sub_exp*
|
|
344
344
|
num_power_sub_exp = ("^" space* val_exp space*)
|
|
345
|
-
func_exp = ({
|
|
346
|
-
func_str_exp = ({
|
|
345
|
+
func_exp = ({" / ".join(QUOTED_FUNCTION_NAMES)}) space* "(" space* exp space* ")" space*
|
|
346
|
+
func_str_exp = ({" / ".join(QUOTED_STR_NUM_FUNCTIONS_NAMES)}) space* "(" space* str_exp space* ")" space*
|
|
347
347
|
val_exp = num_literal
|
|
348
348
|
/ hex_literal
|
|
349
349
|
/ paren_exp
|
|
@@ -363,11 +363,11 @@ grammar = Grammar(
|
|
|
363
363
|
str_exp = str_simple_exp space* str_exp_elements
|
|
364
364
|
str_exp_elements = str_exp_element*
|
|
365
365
|
str_exp_element = "+" space* str_simple_exp space*
|
|
366
|
-
str2_func_exp = ({
|
|
367
|
-
str3_func_exp = ({
|
|
368
|
-
num_str_func_exp = ({
|
|
369
|
-
num_str_func_exp_statements = ({
|
|
370
|
-
str_func_exp_statements = ({
|
|
366
|
+
str2_func_exp = ({" / ".join(QUOTED_STR2_FUNCTION_NAMES)}) space* "(" space* str_exp space* "," space* exp space* ")" space*
|
|
367
|
+
str3_func_exp = ({" / ".join(QUOTED_STR3_FUNCTION_NAMES)}) space* "(" space* str_exp space* "," space* exp space* "," space* exp space* ")" space*
|
|
368
|
+
num_str_func_exp = ({" / ".join(QUOTED_NUM_STR_FUNCTIONS_NAMES)}) space* "(" space* exp space* ")" space*
|
|
369
|
+
num_str_func_exp_statements = ({" / ".join(QUOTED_NUM_STR_FUNCTIONS_TO_STATEMENTS_NAMES)}) space* "(" space* exp space* ")" space*
|
|
370
|
+
str_func_exp_statements = ({" / ".join(QUOTED_STR_FUNCTIONS_TO_STATEMENTS_NAMES)}) space*
|
|
371
371
|
str_simple_exp = str_literal
|
|
372
372
|
/ str2_func_exp
|
|
373
373
|
/ str3_func_exp
|
|
@@ -413,7 +413,7 @@ grammar = Grammar(
|
|
|
413
413
|
linenum_list = linenum space* linenum_list0
|
|
414
414
|
linenum_list0 = linenum_list_elem*
|
|
415
415
|
linenum_list_elem = "," space* linenum space*
|
|
416
|
-
functions = ~r"{
|
|
416
|
+
functions = ~r"{"|".join(FUNCTIONS.keys())}"
|
|
417
417
|
data_statement = "DATA" space* data_elements space*
|
|
418
418
|
data_elements = data_element space* data_elements0
|
|
419
419
|
data_element = data_num_element / data_str_element
|
|
@@ -425,7 +425,7 @@ grammar = Grammar(
|
|
|
425
425
|
data_str_element0 = space* str_literal space*
|
|
426
426
|
data_str_element1 = space* data_str_literal
|
|
427
427
|
data_str_literal = ~r'[^",:\n]*'
|
|
428
|
-
single_kw_statement = ({
|
|
428
|
+
single_kw_statement = ({" / ".join(QUOTED_SINGLE_KEYWORD_STATEMENTS)}) space*
|
|
429
429
|
for_statement = "FOR" space* var space* "=" space* exp space* "TO" space* exp space*
|
|
430
430
|
for_step_statement = "FOR" space* var space* "=" space* exp space* "TO" space* exp space* "STEP" space* exp space*
|
|
431
431
|
next_statement = next_var_statement / next_empty_statement
|
|
@@ -434,8 +434,8 @@ grammar = Grammar(
|
|
|
434
434
|
var_list = var space* var_list_elements
|
|
435
435
|
var_list_elements = var_list_element*
|
|
436
436
|
var_list_element = "," space* var space*
|
|
437
|
-
func_to_statements = ({
|
|
438
|
-
func_to_statements2 = ({
|
|
437
|
+
func_to_statements = ({" / ".join(QUOTED_FUNCTIONS_TO_STATEMENTS_NAMES)}) space* "(" space* exp space* ")" space*
|
|
438
|
+
func_to_statements2 = ({" / ".join(QUOTED_FUNCTIONS_TO_STATEMENTS2_NAMES)}) space* "(" space* exp space* "," space* exp space*")" space*
|
|
439
439
|
joystk_to_statement = "JOYSTK" space* "(" space* exp space* ")" space*
|
|
440
440
|
dim_element0 = (int_literal / int_hex_literal)
|
|
441
441
|
dim_var = (dim_array_var / str_var / var)
|
|
@@ -866,7 +866,7 @@ class BasicVisitor(NodeVisitor):
|
|
|
866
866
|
return BasicDimStatement(dim_var_list)
|
|
867
867
|
|
|
868
868
|
def visit_clear_statement(self, node, visited_children) -> AbstractBasicStatement:
|
|
869
|
-
return BasicComment(f" {node.text.strip()
|
|
869
|
+
return BasicComment(f" {node.text.strip()}")
|
|
870
870
|
|
|
871
871
|
def visit_read_statement(self, _, visited_children) -> AbstractBasicStatement:
|
|
872
872
|
_, _, rhs, _, rhs_list = visited_children
|
|
@@ -184,7 +184,7 @@ Copyright (c) 2018 by Mathieu Bouchard
|
|
|
184
184
|
Copyright (c) 2018-2020 by Mathieu Bouchard, Jamie Cho
|
|
185
185
|
Version: {}""".format(__version__)
|
|
186
186
|
PIXEL_MODE_DESCRIPTION = (
|
|
187
|
-
"Default pixel mode is no artifact (PMODE 4 on
|
|
187
|
+
"Default pixel mode is no artifact (PMODE 4 on monitor). The 6 other modes:"
|
|
188
188
|
)
|
|
189
189
|
PARSER_MODE_DESCRIPTION = """Default file format is CocoMax 1/2's .MAX, which is also Graphicom's
|
|
190
190
|
.PIC and SAVEM of 4 or 8 pages of PMODE 3/4.
|
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: coco-tools
|
|
3
|
+
Version: 0.20
|
|
4
|
+
Summary: TRS-80 Color Computer Tools
|
|
5
|
+
Author-email: Jamie Cho <jamieleecho@gmail.com>
|
|
6
|
+
License-Expression: GPL-2.0
|
|
7
|
+
Project-URL: Repository, https://github.com/jamieleecho/coco-tools
|
|
8
|
+
Project-URL: Issues, https://github.com/jamieleecho/coco-tools/issues
|
|
9
|
+
Keywords: coco,image,conversion,trs-80,tandy
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Requires-Python: >=3.9.19
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: parsimonious>=0.10.0
|
|
18
|
+
Requires-Dist: Pillow>=7.0.0
|
|
19
|
+
Requires-Dist: pypng>=0.0.18
|
|
20
|
+
Requires-Dist: pydantic>=2.0.0
|
|
21
|
+
Requires-Dist: pydantic-yaml>=1.3.0
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
1
24
|
# coco-tools
|
|
2
25
|
|
|
3
26
|
This is a simple collection of tools to assist with developing software for
|
|
@@ -12,9 +35,31 @@ pip install coco-tools
|
|
|
12
35
|
# To install from source
|
|
13
36
|
git clone https://github.com/jamieleecho/coco-tools.git
|
|
14
37
|
cd coco-tools
|
|
15
|
-
|
|
38
|
+
make install-pre-commit
|
|
39
|
+
make install
|
|
16
40
|
```
|
|
17
41
|
|
|
42
|
+
The `Makefile` makes it easy to perform the most common operations:
|
|
43
|
+
* `make all` transpiles several exapmle ECB programs to Basic09
|
|
44
|
+
* `make check-all` runs linting and `uv.lock` checks
|
|
45
|
+
* `make check-lint` checks for linting issues
|
|
46
|
+
* `make check-lock` verifies the `uv.lock` is aligned to `pyproject.toml`
|
|
47
|
+
* `make clean` cleans the virtual environment and caches
|
|
48
|
+
* `make default` runs a default set of checks on the code
|
|
49
|
+
* `make fix-all` formats the code, fixes lint errors and runs locks `uv.lock` to `pyproject.toml`
|
|
50
|
+
* `make fix-format` formats the code
|
|
51
|
+
* `make fix-lint` fixes linting issues
|
|
52
|
+
* `make fix-lint-unsafe` fixes linting issues potentially adding inadvertant bugs
|
|
53
|
+
* `make help` outputs the different make options
|
|
54
|
+
* `make install` build install the distribution
|
|
55
|
+
* `make install-pre-commit` installs pre-commit hooks
|
|
56
|
+
* `make lock` locks `uv.lock` to `pyproject.toml`
|
|
57
|
+
* `make install-pre-commit` installs pre-commit hooks
|
|
58
|
+
* `make run-tests` runs the unit tests
|
|
59
|
+
* `make sync` syncs the python environment with `uv.lock`
|
|
60
|
+
|
|
61
|
+
`.vscode/settings.json` is set so that unit tests can be run without further configuration.
|
|
62
|
+
|
|
18
63
|
## Tools
|
|
19
64
|
|
|
20
65
|
### [decb-to-b09](./README.decb-to-b09.md)
|
|
@@ -230,18 +275,38 @@ options:
|
|
|
230
275
|
## Developing and Testing
|
|
231
276
|
|
|
232
277
|
```
|
|
278
|
+
# To set up pre-commit checks
|
|
279
|
+
pre-commit install
|
|
280
|
+
|
|
233
281
|
# Build the docker image
|
|
234
|
-
docker
|
|
282
|
+
docker compose build test
|
|
235
283
|
|
|
236
284
|
# Run tests using the source on the docker image
|
|
237
|
-
docker
|
|
285
|
+
docker compose run test
|
|
238
286
|
|
|
239
287
|
# Run tests using the source on the host computer
|
|
240
|
-
docker
|
|
288
|
+
docker compose run testv
|
|
241
289
|
|
|
242
|
-
# To
|
|
290
|
+
# To develop locally
|
|
243
291
|
pip install -r requirements.txt
|
|
244
|
-
|
|
292
|
+
|
|
293
|
+
# Run linting, build example disk images for basic conversion
|
|
294
|
+
make
|
|
295
|
+
|
|
296
|
+
# Remove built artifacts
|
|
297
|
+
make clean
|
|
298
|
+
|
|
299
|
+
# Reformats the code
|
|
300
|
+
make format
|
|
301
|
+
|
|
302
|
+
# Only runs linting
|
|
303
|
+
make lint
|
|
304
|
+
|
|
305
|
+
# Only run tests
|
|
306
|
+
make test
|
|
307
|
+
|
|
308
|
+
# Build basic and os-9 eample images
|
|
309
|
+
make basic.dsk os9boot.dsk
|
|
245
310
|
```
|
|
246
311
|
|
|
247
312
|
## Credits
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
./coco/__init__.py
|
|
5
|
+
./coco/cm3toppm.py
|
|
6
|
+
./coco/decb_to_b09.py
|
|
7
|
+
./coco/hrstoppm.py
|
|
8
|
+
./coco/maxtoppm.py
|
|
9
|
+
./coco/mge_viewer2.py
|
|
10
|
+
./coco/mgetoppm.py
|
|
11
|
+
./coco/pixtopgm.py
|
|
12
|
+
./coco/rattoppm.py
|
|
13
|
+
./coco/util.py
|
|
14
|
+
./coco/veftopng.py
|
|
15
|
+
./coco/b09/__init__.py
|
|
16
|
+
./coco/b09/compiler.py
|
|
17
|
+
./coco/b09/configs.py
|
|
18
|
+
./coco/b09/elements.py
|
|
19
|
+
./coco/b09/error_handler.py
|
|
20
|
+
./coco/b09/grammar.py
|
|
21
|
+
./coco/b09/parser.py
|
|
22
|
+
./coco/b09/procbank.py
|
|
23
|
+
./coco/b09/prog.py
|
|
24
|
+
./coco/b09/visitors.py
|
|
25
|
+
./coco/resources/__init__.py
|
|
26
|
+
./coco/resources/ecb.b09
|
|
27
|
+
./tests/test_error_handler.py
|
|
28
|
+
./tests/coco_tests/b09/__init__.py
|
|
29
|
+
./tests/coco_tests/b09/test_b09.py
|
|
30
|
+
./tests/coco_tests/b09/test_configs.py
|
|
31
|
+
./tests/coco_tests/b09/test_visitors.py
|
|
32
|
+
./tests/coco_tests/fixtures/__init__.py
|
|
33
|
+
coco/__init__.py
|
|
34
|
+
coco/cm3toppm.py
|
|
35
|
+
coco/decb_to_b09.py
|
|
36
|
+
coco/hrstoppm.py
|
|
37
|
+
coco/maxtoppm.py
|
|
38
|
+
coco/mge_viewer2.py
|
|
39
|
+
coco/mgetoppm.py
|
|
40
|
+
coco/pixtopgm.py
|
|
41
|
+
coco/rattoppm.py
|
|
42
|
+
coco/util.py
|
|
43
|
+
coco/veftopng.py
|
|
44
|
+
coco/b09/__init__.py
|
|
45
|
+
coco/b09/compiler.py
|
|
46
|
+
coco/b09/configs.py
|
|
47
|
+
coco/b09/elements.py
|
|
48
|
+
coco/b09/error_handler.py
|
|
49
|
+
coco/b09/grammar.py
|
|
50
|
+
coco/b09/parser.py
|
|
51
|
+
coco/b09/procbank.py
|
|
52
|
+
coco/b09/prog.py
|
|
53
|
+
coco/b09/visitors.py
|
|
54
|
+
coco/resources/__init__.py
|
|
55
|
+
coco/resources/ecb.b09
|
|
56
|
+
coco_tools.egg-info/PKG-INFO
|
|
57
|
+
coco_tools.egg-info/SOURCES.txt
|
|
58
|
+
coco_tools.egg-info/dependency_links.txt
|
|
59
|
+
coco_tools.egg-info/entry_points.txt
|
|
60
|
+
coco_tools.egg-info/requires.txt
|
|
61
|
+
coco_tools.egg-info/top_level.txt
|
|
62
|
+
tests/test_error_handler.py
|
|
63
|
+
tests/coco_tests/b09/__init__.py
|
|
64
|
+
tests/coco_tests/b09/test_b09.py
|
|
65
|
+
tests/coco_tests/b09/test_configs.py
|
|
66
|
+
tests/coco_tests/b09/test_visitors.py
|
|
67
|
+
tests/coco_tests/fixtures/__init__.py
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "coco-tools"
|
|
3
|
+
version = "0.20"
|
|
4
|
+
authors = [
|
|
5
|
+
{name = "Jamie Cho", email = "jamieleecho@gmail.com"},
|
|
6
|
+
]
|
|
7
|
+
description = "TRS-80 Color Computer Tools"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
classifiers=[
|
|
10
|
+
"Development Status :: 3 - Alpha",
|
|
11
|
+
"Intended Audience :: Developers",
|
|
12
|
+
"Topic :: Software Development :: Build Tools",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
]
|
|
15
|
+
license = "GPL-2.0"
|
|
16
|
+
keywords = [
|
|
17
|
+
"coco",
|
|
18
|
+
"image",
|
|
19
|
+
"conversion",
|
|
20
|
+
"trs-80",
|
|
21
|
+
"tandy",
|
|
22
|
+
]
|
|
23
|
+
requires-python = ">=3.9.19"
|
|
24
|
+
dependencies = [
|
|
25
|
+
"parsimonious>=0.10.0",
|
|
26
|
+
"Pillow>=7.0.0",
|
|
27
|
+
"pypng>=0.0.18",
|
|
28
|
+
"pydantic>=2.0.0",
|
|
29
|
+
"pydantic-yaml>=1.3.0",
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
[project.scripts ]
|
|
33
|
+
decb-to-b09 = "coco.decb_to_b09:main"
|
|
34
|
+
cm3toppm = "coco.cm3toppm:main"
|
|
35
|
+
hrstoppm = "coco.hrstoppm:main"
|
|
36
|
+
maxtoppm = "coco.maxtoppm:main"
|
|
37
|
+
mgetoppm = "coco.mgetoppm:main"
|
|
38
|
+
mge_viewer2 = "coco.mge_viewer2:main"
|
|
39
|
+
pixtopgm = "coco.pixtopgm:main"
|
|
40
|
+
rattoppm = "coco.rattoppm:main"
|
|
41
|
+
veftopng = "coco.veftopng:main"
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Repository = "https://github.com/jamieleecho/coco-tools"
|
|
45
|
+
Issues = "https://github.com/jamieleecho/coco-tools/issues"
|
|
46
|
+
|
|
47
|
+
[dependency-groups]
|
|
48
|
+
dev = [
|
|
49
|
+
"coverage",
|
|
50
|
+
"imagehash",
|
|
51
|
+
"pytest",
|
|
52
|
+
"pre-commit",
|
|
53
|
+
"ruff",
|
|
54
|
+
"types-setuptools",
|
|
55
|
+
]
|
|
56
|
+
|
|
57
|
+
[build-system]
|
|
58
|
+
requires = [
|
|
59
|
+
"setuptools",
|
|
60
|
+
"scipy",
|
|
61
|
+
"wheel",
|
|
62
|
+
]
|
|
63
|
+
|
|
64
|
+
[tool.setuptools.packages.find]
|
|
65
|
+
where = ["."]
|
|
66
|
+
exclude = ["tests.coco_tests"]
|
|
67
|
+
|
|
68
|
+
[tool.setuptools.package-dir]
|
|
69
|
+
"" = "."
|
|
70
|
+
|
|
71
|
+
[tool.setuptools.package-data]
|
|
72
|
+
"coco.resources" = ["*.b09"]
|
|
73
|
+
|
|
74
|
+
[tool.pytest.ini_options]
|
|
75
|
+
rootdir = "."
|
|
76
|
+
pythonpath = [
|
|
77
|
+
".",
|
|
78
|
+
]
|
|
79
|
+
markers = [
|
|
80
|
+
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
|
|
81
|
+
"quick: marks tests as fast",
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
[tool.ruff]
|
|
85
|
+
exclude = [
|
|
86
|
+
"docs/",
|
|
87
|
+
]
|
|
File without changes
|