FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
testcontainers-python/scripts/compute_modules.py at main · huydt84/testcontainers-python · GitHub
huydt84
/
testcontainers-python
Public
forked from
testcontainers/testcontainers-python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
testcontainers-python
/
scripts
/
compute_modules.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (27 loc) · 872 Bytes
Breadcrumbs
testcontainers-python
/
scripts
/
compute_modules.py
Copy path
File metadata and controls
32 lines (27 loc) · 872 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
"""
Extract the community module names out of lists of changed files.
"""
import
json
import
os
import
sys
def
compute_modules
(
files
:
list
[
str
])
->
list
[
str
]:
modules
=
set
()
for
f
in
files
:
if
f
.
startswith
(
"src/testcontainers/community/"
):
part
=
f
.
split
(
"/"
)[
3
]
elif
f
.
startswith
(
"tests/community/"
):
part
=
f
.
split
(
"/"
)[
2
]
else
:
continue
if
not
part
or
part
.
startswith
(
"__"
)
or
part
.
endswith
(
".md"
):
continue
modules
.
add
(
part
)
return
sorted
(
modules
)
if
__name__
==
"__main__"
:
files
=
json
.
loads
(
sys
.
argv
[
1
])
modules
=
compute_modules
(
files
)
result
=
json
.
dumps
(
modules
)
print
(
f"computed_modules=
{
result
}
"
)
# noqa: T201
with
open
(
os
.
environ
[
"GITHUB_OUTPUT"
],
"a"
)
as
fh
:
fh
.
write
(
f"computed_modules=
{
result
}
\n
"
)
Back
|
FazBrowse Home
|
New Git URL