Skip to content

Commit ae04684

Browse files
authored
Unified task runner scripts (#1086)
1 parent 7a87ca7 commit ae04684

File tree

162 files changed

+983
-861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+983
-861
lines changed

.github/workflows/build_publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
with:
1919
poetry-version: 1.2.2
2020
- run: poetry install
21-
- run: poetry run poe test
22-
- run: poetry run poe typecheck
23-
- run: poetry run poe codestyle
24-
- run: poetry run poe liccheck
21+
- run: poetry run poe tests_unit
22+
- run: poetry run poe checks_codestyle
23+
- run: poetry run poe checks_typing
24+
- run: poetry run poe checks_license
2525

2626
build:
2727
needs: [test]

.github/workflows/goth-nightly.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ jobs:
8686
env:
8787
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8888
run: |
89-
poetry run poe goth-assets
90-
poetry run poe goth-tests
89+
poetry run poe tests_integration_assets
90+
poetry run poe tests_integration
9191
9292
- name: Upload test logs
9393
uses: actions/upload-artifact@v2

.github/workflows/goth.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ jobs:
5757
env:
5858
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5959
run: |
60-
poetry run poe goth-assets
61-
poetry run poe goth-tests
60+
poetry run poe tests_integration_assets
61+
poetry run poe tests_integration
6262
6363
- name: Upload test logs
6464
uses: actions/upload-artifact@v2

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ jobs:
5050
- run: poetry install -E docs
5151
if: ${{ steps.extended-checks-sphinx.outputs.ENABLE }}
5252

53-
- run: poetry run poe test
54-
- run: poetry run poe typecheck
55-
- run: poetry run poe codestyle
53+
- run: poetry run poe tests_unit
54+
- run: poetry run poe checks_codestyle
55+
- run: poetry run poe checks_typing
5656
if: ${{ steps.extended-checks.outputs.ENABLE }}
57-
- run: poetry run poe liccheck
57+
- run: poetry run poe checks_license
5858
if: ${{ steps.extended-checks.outputs.ENABLE }}
5959
- run: poetry run poe sphinx -W
6060
if: ${{ steps.extended-checks-sphinx.outputs.ENABLE }}

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ __pycache__/
88
*.log
99
*.png
1010
.coverage
11-
.requirements.txt
11+
requirements.txt
1212

1313
tests/goth_tests/assets/
1414

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ All of the project's dependencies will be installed to that virtual environment.
6868
Declarations of project tasks can be found in `pyproject.toml`.
6969

7070
```bash
71-
poetry run poe test
71+
poetry run poe tests_unit
7272
```
7373

7474
### Running `goth` integration tests
@@ -96,23 +96,23 @@ poetry install -E integration-tests
9696
Finally, generate goth's default assets:
9797

9898
```bash
99-
poetry run poe goth-assets
99+
poetry run poe tests_integration_assets
100100
```
101101

102102
#### Running the tests
103103

104104
Once you have the environment set up, to run all the integration tests, use:
105105

106106
```bash
107-
poetry run poe goth-tests
107+
poetry run poe tests_integration
108108
```
109109

110110
### Contributing
111111

112112
It is recommended to run unit tests and static code analysis before committing changes.
113113

114114
```bash
115-
poetry run poe check
115+
poetry run poe checks
116116
```
117117

118118
You can clean up the artifacts created during the test runs with:

docs/sphinx/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#
1313
import os
1414
import sys
15+
from typing import List
1516

1617
sys.path.insert(0, os.path.abspath("../../"))
1718

@@ -56,7 +57,7 @@
5657
# Add any paths that contain custom static files (such as style sheets) here,
5758
# relative to this directory. They are copied after the builtin static files,
5859
# so a file named "default.css" will overwrite the builtin "default.css".
59-
html_static_path = []
60+
html_static_path: List[str] = []
6061

6162
# This removes the `yapapi.log` docstrings.
6263
# There are two reasons:

examples/blender/blender.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
2-
from datetime import datetime, timedelta
32
import pathlib
43
import sys
4+
from datetime import datetime, timedelta
55

66
from yapapi import Golem, Task, WorkContext
77
from yapapi.payload import vm
@@ -31,7 +31,8 @@ async def main(
3131
min_mem_gib=0.5,
3232
# only run on provider nodes that have more than 2gb of storage space available
3333
min_storage_gib=2.0,
34-
# only run on provider nodes which a certain number of CPU threads (logical CPU cores) available
34+
# only run on provider nodes which a certain number of CPU threads (logical CPU cores)
35+
# available
3536
min_cpu_threads=min_cpu_threads,
3637
)
3738

examples/blender/start_stop_blender.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
"""Other version of the blender example.
44
5-
Instead of using Golem in the default way - as a context manager - we directly call `Golem.start()` and `Golem.stop()`.
6-
This way of using Golem might be more convenient for some specific use cases (although doesn't change a lot
7-
in the blender example).
5+
Instead of using Golem in the default way - as a context manager - we directly call `Golem.start()`
6+
and `Golem.stop()`. This way of using Golem might be more convenient for some specific use cases
7+
(although doesn't change a lot in the blender example).
88
"""
99

10-
from datetime import datetime, timedelta
1110
import pathlib
1211
import sys
12+
from datetime import datetime, timedelta
1313

1414
from yapapi import Golem, Task, WorkContext
1515
from yapapi.payload import vm

examples/custom-usage-counter/custom_usage_counter.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env python3
22
import asyncio
3-
from dataclasses import dataclass
4-
from datetime import datetime, timedelta
5-
from decimal import Decimal
63
import pathlib
74
import sys
5+
from datetime import datetime, timedelta
6+
from decimal import Decimal
7+
8+
from dataclasses import dataclass
89

910
from yapapi import Golem
1011
from yapapi.ctx import ActivityUsage
@@ -101,6 +102,8 @@ def print_instances():
101102
type=int,
102103
help="How long should the the service run (in seconds, default: %(default)s)",
103104
)
105+
now = datetime.now().strftime("%Y-%m-%d_%H.%M.%S")
106+
parser.set_defaults(log_file=f"custom-counters-yapapi-{now}.log")
104107
args = parser.parse_args()
105108
enable_default_logger(
106109
log_file=args.log_file,

0 commit comments

Comments
 (0)