Skip to content

Commit 0c50e0c

Browse files
committed
Merge remote-tracking branch 'origin/dev'
2 parents 261f238 + 92eb508 commit 0c50e0c

6 files changed

Lines changed: 92 additions & 28 deletions

File tree

.github/workflows/branches.yml

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929
- ubuntu-latest
3030

3131
steps:
32-
- uses: actions/checkout@v5
32+
- uses: actions/checkout@v6
3333
name: Clone repository
3434

3535
- name: Set up Python ${{ matrix.python_version }}
36-
uses: actions/setup-python@v5
36+
uses: actions/setup-python@v6
3737
with:
3838
python-version: ${{ matrix.python_version }}
3939

@@ -46,8 +46,38 @@ jobs:
4646
- name: Lint with Pylint
4747
run: pylint PyFunceble
4848

49+
sec_check:
50+
name: Check the safety of the codebase with Bandit
51+
52+
runs-on: "${{ matrix.os }}"
53+
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
python_version:
58+
- "3.12"
59+
os:
60+
- ubuntu-latest
61+
62+
steps:
63+
- uses: actions/checkout@v6
64+
name: Clone repository
65+
66+
- name: Set up Python ${{ matrix.python_version }}
67+
uses: actions/setup-python@v6
68+
with:
69+
python-version: ${{ matrix.python_version }}
70+
71+
- name: Install dependencies
72+
run: |
73+
pip install --upgrade pip
74+
pip install .[test,dev]
75+
76+
- name: Check the safety of the codebase with Bandit
77+
run: bandit --ini=setup.cfg -r PyFunceble
78+
4979
test:
50-
needs: [lint]
80+
needs: [lint, sec_check]
5181
name: "[${{ matrix.os }}-py${{ matrix.python_version }}] Test Extension"
5282

5383
runs-on: "${{ matrix.os }}"
@@ -67,11 +97,11 @@ jobs:
6797
- windows-latest
6898

6999
steps:
70-
- uses: actions/checkout@v5
100+
- uses: actions/checkout@v6
71101
name: Clone repository
72102

73103
- name: Set up Python ${{ matrix.python_version }}
74-
uses: actions/setup-python@v5
104+
uses: actions/setup-python@v6
75105
with:
76106
python-version: ${{ matrix.python_version }}
77107

@@ -106,11 +136,11 @@ jobs:
106136
- windows-latest
107137

108138
steps:
109-
- uses: actions/checkout@v5
139+
- uses: actions/checkout@v6
110140
name: Clone repository
111141

112142
- name: Set up Python ${{ matrix.python_version }}
113-
uses: actions/setup-python@v5
143+
uses: actions/setup-python@v6
114144
with:
115145
python-version: ${{ matrix.python_version }}
116146

.github/workflows/main.yml

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ jobs:
2727
- ubuntu-latest
2828

2929
steps:
30-
- uses: actions/checkout@v5
30+
- uses: actions/checkout@v6
3131
name: Clone repository
3232

3333
- name: Set up Python ${{ matrix.python_version }}
34-
uses: actions/setup-python@v5
34+
uses: actions/setup-python@v6
3535
with:
3636
python-version: ${{ matrix.python_version }}
3737

@@ -44,8 +44,38 @@ jobs:
4444
- name: Lint with Pylint
4545
run: pylint PyFunceble
4646

47+
sec_check:
48+
name: Check the safety of the codebase with Bandit
49+
50+
runs-on: "${{ matrix.os }}"
51+
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
python_version:
56+
- "3.12"
57+
os:
58+
- ubuntu-latest
59+
60+
steps:
61+
- uses: actions/checkout@v6
62+
name: Clone repository
63+
64+
- name: Set up Python ${{ matrix.python_version }}
65+
uses: actions/setup-python@v6
66+
with:
67+
python-version: ${{ matrix.python_version }}
68+
69+
- name: Install dependencies
70+
run: |
71+
pip install --upgrade pip
72+
pip install .[test,dev]
73+
74+
- name: Check the safety of the codebase with Bandit
75+
run: bandit --ini=setup.cfg -r PyFunceble
76+
4777
test:
48-
needs: [lint]
78+
needs: [lint, sec_check]
4979
name: "[${{ matrix.os }}-py${{ matrix.python_version }}] Test Extension"
5080

5181
runs-on: "${{ matrix.os }}"
@@ -65,11 +95,11 @@ jobs:
6595
- windows-latest
6696

6797
steps:
68-
- uses: actions/checkout@v5
98+
- uses: actions/checkout@v6
6999
name: Clone repository
70100

71101
- name: Set up Python ${{ matrix.python_version }}
72-
uses: actions/setup-python@v5
102+
uses: actions/setup-python@v6
73103
with:
74104
python-version: ${{ matrix.python_version }}
75105

@@ -104,11 +134,11 @@ jobs:
104134
- windows-latest
105135

106136
steps:
107-
- uses: actions/checkout@v5
137+
- uses: actions/checkout@v6
108138
name: Clone repository
109139

110140
- name: Set up Python ${{ matrix.python_version }}
111-
uses: actions/setup-python@v5
141+
uses: actions/setup-python@v6
112142
with:
113143
python-version: ${{ matrix.python_version }}
114144

@@ -143,11 +173,11 @@ jobs:
143173
- ubuntu-latest
144174

145175
steps:
146-
- uses: actions/checkout@v5
176+
- uses: actions/checkout@v6
147177
name: Clone repository
148178

149179
- name: Set up Python ${{ matrix.python_version }}
150-
uses: actions/setup-python@v5
180+
uses: actions/setup-python@v6
151181
with:
152182
python-version: ${{ matrix.python_version }}
153183

@@ -217,7 +247,7 @@ jobs:
217247
run: |
218248
echo "${{ secrets.AUR_SSH_KEY }}" | install -Dm600 /dev/stdin ~/.ssh/id_ed25519
219249
220-
- uses: actions/checkout@v5
250+
- uses: actions/checkout@v6
221251
name: Clone repository
222252

223253
- name: Publish 📦 to the AUR - if necessary

PyFunceble/ext/process_manager/core.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -737,9 +737,9 @@ def push_to_input_queue(
737737
data, source_worker=source_worker, destination_worker=worker.name
738738
)
739739
elif workers:
740-
random.choice(workers).push_to_input_queue(
741-
data, source_worker=source_worker
742-
)
740+
random.choice( # nosec: B311 # We aren't doing encryption here.
741+
workers
742+
).push_to_input_queue(data, source_worker=source_worker)
743743

744744
logger.debug("%s-manager | Pushed to input queue: %r", self.STD_NAME, data)
745745

@@ -790,9 +790,9 @@ def push_to_output_queues(
790790
destination_worker=worker.name,
791791
)
792792
elif workers:
793-
random.choice(workers).push_to_output_queues(
794-
data, source_worker=source_worker
795-
)
793+
random.choice( # nosec: B311 # We aren't doing encryption here.
794+
workers
795+
).push_to_output_queues(data, source_worker=source_worker)
796796
else:
797797
for manager in self.dependent_managers:
798798
# Their input queue is our output queue.
@@ -839,9 +839,9 @@ def push_to_configuration_queue(
839839
data, source_worker=source_worker, destination_worker=worker.name
840840
)
841841
elif workers:
842-
random.choice(workers).push_to_configuration_queue(
843-
data, source_worker=source_worker
844-
)
842+
random.choice( # nosec: B311 # We aren't doing encryption here.
843+
workers
844+
).push_to_configuration_queue(data, source_worker=source_worker)
845845

846846
logger.debug(
847847
"%s-manager | Pushed to configuration queue: %r", self.STD_NAME, data

PyFunceble/ext/process_manager/worker/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ def shutdown_time_reached(): # pragma: no cover
10741074
continue
10751075

10761076
logger.debug(
1077-
"%s | Stop signal received. Scheduling shutdown.",
1077+
"%s | Stop signal received. Scheduling shutdown.", self.name
10781078
)
10791079
self.exit_event.set()
10801080
# Make sure that none of the concurrent workers are stuck or

requirements.dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
black
22
flake8
33
isort
4-
pylint
4+
pylint
5+
bandit

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,6 @@ minversion = 6.0
2727
addopts = --cov=PyFunceble --cov-report=html --cov-report=term
2828
testpaths =
2929
tests
30+
31+
[bandit]
32+
exclude = tests

0 commit comments

Comments
 (0)