Skip to content

Commit 57e3f3f

Browse files
Merge pull request #73 from python-thread/ci/improving-ci-docs
Ci: improving ci
2 parents 2a89bf5 + 5195928 commit 57e3f3f

File tree

10 files changed

+117
-14
lines changed

10 files changed

+117
-14
lines changed

Diff for: .github/labeler.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This file is for the labeler workflow
2+
# Documentation https://github.com/marketplace/actions/labeler
3+
4+
Documentation:
5+
- changed-files:
6+
- any-glob-to-any-file: [docs/**, .github/**, "./*.{md,mdx}"]
7+
- all-globs-to-all-files: "!.github/workflows/*"
8+
9+
"Type: Test":
10+
- changed-files:
11+
- any-glob-to-any-file: [tests/**, ./*test*]
12+
13+
"Type: CI":
14+
- changed-files:
15+
- any-glob-to-any-file: [.github/workflows/**]
16+
17+
"Scope: Core":
18+
- changed-files:
19+
- any-glob-to-any-file: [src/**]
20+
all-globs-to-all-files:
21+
["!src/thread/decorators/*", "!src/thread/utils/*"]
22+
23+
"Scope: Utils":
24+
- changed-files:
25+
- any-glob-to-any-file: ["src/thread/utils/*"]
26+
27+
"Scope: Decorator":
28+
- changed-files:
29+
- any-glob-to-any-file: ["src/thread/decorators/*"]

Diff for: .github/settings.yml

+25
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
labels:
2+
- name: "Type: CI"
3+
color: 54b2ff
4+
description: A problem or enhancement related to continuous integration.
5+
26
- name: "Type: Breaking"
37
color: a90000
48
description: A problem or enhancement related to a breaking change.
@@ -86,3 +90,24 @@ labels:
8690
- name: "Skip-Changelog"
8791
color: AEB1C2
8892
description: Skip changelog in release tag
93+
94+
- name: "help wanted"
95+
color: 008672
96+
description: Help wanted
97+
98+
- name: "CI: Template Sync"
99+
color: AEB1C2
100+
description: Sync with upstream template
101+
102+
- name: "Scope: Core"
103+
color: F9D0C4
104+
description: A change that affects the core of thread
105+
106+
- name: "Scope: Decorator"
107+
color: F9D0C4
108+
description: A change that affects decorators
109+
110+
- name: "Scope: Utils"
111+
color: 9BD0E6
112+
description: A change that affects utilities or configuration
113+

Diff for: .github/workflows/labeler.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Labeler
2+
3+
on: [pull_request]
4+
5+
# This workflow will require write permissions on pull requests
6+
# 1. Repository Settings -> Actions -> General -> Workflow permissions
7+
# Check "Read and write permissions"
8+
9+
jobs:
10+
labeler:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/labeler@v5
14+
with:
15+
repo-token: "${{ secrets.GITHUB_TOKEN }}"

Diff for: .github/workflows/linter.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Linting
2+
3+
on: [push, pull_request]
4+
5+
env:
6+
PIP_DISABLE_PIP_VERSION_CHECK: 1
7+
8+
jobs:
9+
linting:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Python 3.x
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: 3.x
20+
21+
- name: Install requirements
22+
run: |
23+
set -xe
24+
python -m pip install ruff
25+
26+
- name: Lint with ruff
27+
run: |
28+
set -xe
29+
python -m ruff --per-file-ignores="__init__.py:F401" --per-file-ignores="__init__.py:E402" .

Diff for: .github/workflows/test-worker.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ permissions:
1818
contents: read
1919

2020
concurrency:
21-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
group: ${{ github.workflow }}-${{ github.ref }}
2222
cancel-in-progress: true
2323

2424
jobs:

Diff for: ruff.toml

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,22 @@ exclude = [
3232
indent-style = "space"
3333
line-ending = "lf"
3434
quote-style = "single"
35-
docstring-code-format = true
3635

3736

3837
[lint]
38+
select = ["E4", "E7", "E9", "F", "B"]
39+
3940
# Avoid enforcing line-length violations (`E501`)
4041
ignore = ["E501"]
4142

4243
# Allow unused variables when underscore-prefixed.
4344
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
4445

4546

47+
[lint.flake8-quotes]
48+
docstring-quotes = "double"
49+
50+
4651
# Ignore `E402` (import violations) in all `__init__.py` files, and in select subdirectories.
4752
[lint.per-file-ignores]
4853
"__init__.py" = ["E402", "F401"]

Diff for: src/thread/thread.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ def __init__(
113113
self.suppress_errors = suppress_errors
114114

115115
super().__init__(
116-
target=_target,
117-
args=args,
118-
kwargs=kwargs,
119-
name=name,
120-
daemon=daemon,
121-
group=group,
116+
group,
117+
_target,
118+
name,
119+
args,
120+
kwargs,
122121
*overflow_args,
122+
daemon=daemon,
123123
**overflow_kwargs,
124124
)
125125

Diff for: tests/test_parallelprocessing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def test_raises_StillRunningError():
4848
)
4949
new.start()
5050
with pytest.raises(exceptions.ThreadStillRunningError):
51-
new.results
51+
_ = new.results
5252

5353

5454
def test_raises_RunTimeError():

Diff for: tests/test_thread.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_raises_stillRunningError():
100100
new.start()
101101

102102
with pytest.raises(exceptions.ThreadStillRunningError):
103-
new.result
103+
_ = new.result
104104

105105

106106
def test_raises_ignoreSpecificError():

Diff for: tests/test_verbosity.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,19 @@ def test_geTrue():
4848
# >>>>>>>>>> Raising <<<<<<<<<< #
4949
def test_ltRaise():
5050
with pytest.raises(ValueError):
51-
return Verbosity(0) < Exception()
51+
_ = Verbosity(0) < Exception()
5252

5353

5454
def test_leRaise():
5555
with pytest.raises(ValueError):
56-
return Verbosity(0) <= Exception()
56+
_ = Verbosity(0) <= Exception()
5757

5858

5959
def test_gtRaise():
6060
with pytest.raises(ValueError):
61-
return Verbosity(1) > Exception()
61+
_ = Verbosity(1) > Exception()
6262

6363

6464
def test_geRaise():
6565
with pytest.raises(ValueError):
66-
return Verbosity(1) >= Exception()
66+
_ = Verbosity(1) >= Exception()

0 commit comments

Comments
 (0)