Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lint/check to check extra dependency #2362 #2599

Open
wants to merge 20 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,39 @@ jobs:
run: sudo apt-get install -y libyaml-dev
- name: Upgrade pip, setuptools
run: python -m pip install --upgrade pip setuptools
- name: Install dependencies
run: pip install -r requirements.txt
- name: Capture installed packages before installation
run: pip freeze > before.txt
- name: Install capa with build requirements
run: |
pip install -r requirements.txt
pip install -e .[build]
- name: Capture installed packages after installation
run: pip freeze > after.txt
- name: Check for extra packages
shell: bash
run: |
diff <(sort before.txt) <(sort after.txt) > diff.txt || true
echo '^-e git\+https://github\.com/mandiant/capa@.*' > patterns.txt
grep -v -f patterns.txt \
-e 'flare_capa==' \
-e 'altgraph==' \
-e 'build==' \
-e 'pyinstaller==' \
-e 'pywin32-ctypes==' \
-e 'tomli==' \
-e 'packaging==' \
-e 'pyinstaller-hooks-contrib==' \
-e 'pyproject_hooks==' \
-e 'pefile==' \
-e '^[0-9]' diff.txt > unexpected.txt || true
if [ -s unexpected.txt ]; then
echo "Error: Unexpected extra packages were installed:"
cat unexpected.txt
exit 1
else
echo "No unexpected extra packages were installed."
fi
- name: Build standalone executable
run: pyinstaller --log-level DEBUG .github/pyinstaller/pyinstaller.spec
- name: Does it run (PE)?
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ mdurl==0.1.2
msgpack==1.0.8
networkx==3.4.2
pefile==2024.8.26
pip==25.0
protobuf==5.29.3
pyasn1==0.5.1
pyasn1-modules==0.3.0
Expand Down
Loading