FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
feast/scripts/check-init-py.sh at master · feast-dev/feast · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
feast-dev
/
feast
Public
Notifications
You must be signed in to change notification settings
Fork
1.4k
Star
7.2k
Code
Issues
218
Pull requests
191
Discussions
Actions
Security and quality
1
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
feast
/
scripts
/
check-init-py.sh
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
31 lines (24 loc) · 997 Bytes
Breadcrumbs
feast
/
scripts
/
check-init-py.sh
Copy path
File metadata and controls
executable file
·
31 lines (24 loc) · 997 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
#!
/bin/bash
#
Check for missing __init__.py files in Python packages
set
-euo pipefail
SCRIPT_DIR=
"
$(
cd
"
$(
dirname
"
${BASH_SOURCE[0]}
"
)
"
&&
pwd
)
"
ROOT_DIR=
"
$(
cd
"
${SCRIPT_DIR}
/..
"
&&
pwd
)
"
#
Find Python package directories missing __init__.py
missing_init_files=()
while
IFS=
read
-r -d
'
'
dir
;
do
#
Skip .ipynb_checkpoints directories and other unwanted directories
if
[[
"
${dir}
"
==
*
"
.ipynb_checkpoints
"
*
]]
||
[[
"
${dir}
"
==
*
"
__pycache__
"
*
]]
;
then
continue
fi
if
[[
!
-f
"
${dir}
/__init__.py
"
]]
&&
[[
-n
"
$(
find
"
${dir}
"
-maxdepth 1 -name
"
*.py
"
-print -quit
)
"
]]
;
then
missing_init_files+=(
"
${dir}
"
)
fi
done
<
<(
find
"
${ROOT_DIR}
/sdk/python/feast
"
-type d -print0
)
if
[[
${
#
missing_init_files[@]}
-gt
0 ]]
;
then
echo
"
❌ Missing __init__.py files in:
"
printf
"
%s\n
"
"
${missing_init_files[@]}
"
echo
"
"
echo
"
Run: touch
${missing_init_files[*]
/%//
__init__.py}
"
exit
1
fi
echo
"
✅ All Python packages have __init__.py files
"
Back
|
FazBrowse Home
|
New Git URL