Skip to content

Commit

Permalink
Migrate to poetry and optimize dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
ostefano committed Aug 16, 2024
1 parent 3a13af7 commit 978e3b9
Show file tree
Hide file tree
Showing 22 changed files with 6,292 additions and 4,264 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: Compile and install yara
run: |
sudo apt-get install automake libtool make gcc pkg-config
wget https://github.com/VirusTotal/yara/archive/refs/tags/v4.5.0.tar.gz
tar xzf *.tar.gz
wget https://github.com/VirusTotal/yara/archive/refs/tags/v4.5.0.tar.gz -O yara.tar.gz
tar xzf yara.tar.gz
pushd yara-*
./bootstrap.sh
./configure
Expand All @@ -38,31 +38,26 @@ jobs:
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
pip install pipenv
sed -i "s/python_version.*/python_version = \"${{ matrix.python-version }}\"/" Pipfile
pipenv lock
pipenv requirements > requirements.txt
# pyfaul must be installed manually (?)
pip install -r requirements.txt pyfaup
pip install .
python -m pip install --upgrade poetry
poetry install
# Tell poetry to not use a virtual environment
# poetry config virtualenvs.create false
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run server in background
run: |
misp-modules -l 127.0.0.1 -s 2>error.log &
sleep 3
poetry run misp-modules -l 127.0.0.1 -s 2>error.log &
sleep 10
- name: Check if server is running
run: |
curl -sS localhost:6666/healthcheck
- name: Test with pytest
run: |
pytest tests
poetry run pytest
- name: Show error log
if: always()
run: |
Expand Down
56 changes: 0 additions & 56 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions DOC-REQUIREMENTS

This file was deleted.

18 changes: 10 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@
.PHONY: prepare_docs generate_docs ci_generate_docs test_docs

prepare_docs:
pip3 install .
cd documentation; python3 generate_documentation.py
mkdir -p docs/expansion/logos docs/export_mod/logos docs/import_mod/logos
cd documentation
poetry run ./documentation/generate_documentation.py
mkdir -p docs/expansion/logos
mkdir -p docs/export_mod/logos
mkdir -p docs/import_mod/logos
mkdir -p docs/logos
cd documentation; cp -R ./logos/* ../docs/logos
cd documentation; cp -R ./logos/* ../docs/logos
cd documentation; cp -R ./logos/* ../docs/expansion/logos
cd documentation; cp -R ./logos/* ../docs/export_mod/logos
cd documentation; cp -R ./logos/* ../docs/import_mod/logos
cp ./documentation/mkdocs/*.md ./docs
cp LICENSE ./docs/license.md

install_requirements:
pip install -r docs/REQUIREMENTS.txt
poetry install --only docs

generate_docs: prepare_docs
mkdocs build
poetry run mkdocs build

deploy:
mkdocs gh-deploy
poetry run mkdocs gh-deploy

test_docs: prepare_docs
mkdocs serve
poetry run mkdocs serve


# DOCKER make commands
Expand Down
87 changes: 0 additions & 87 deletions Pipfile

This file was deleted.

Loading

0 comments on commit 978e3b9

Please sign in to comment.