Skip to content

Commit

Permalink
Fix CI issue concerning safety & pydantic (#526)
Browse files Browse the repository at this point in the history
Separate out 'safety' dependency for CI.

Remove ignoring NumPy safety issue.
  • Loading branch information
CasperWA authored and TEAM4-0 committed Oct 28, 2024
1 parent 7793253 commit d0d52ee
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 14 deletions.
1 change: 1 addition & 0 deletions .dev/requirements_ci.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
safety~=3.2
1 change: 0 additions & 1 deletion .dev/requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ pre-commit~=4.0
pylint~=3.3
pytest~=8.3
pytest-cov~=5.0
safety~=3.2

# httpx is necessary due to the use of fastapi/starlette's TestClient
# See https://fastapi.tiangolo.com/tutorial/testing/?h=testclient#using-testclient
Expand Down
15 changes: 4 additions & 11 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,20 @@ jobs:
run: |
python -m pip install -U pip
pip install -U setuptools wheel
pip install -U -r requirements.txt
pip install -U -r .dev/requirements_dev.txt
pip install safety
pip install -U -r requirements.txt -r .dev/requirements_dev.txt -r .dev/requirements_ci.txt
- name: Run pylint
run: pylint --rcfile=pyproject.toml --ignore-paths=tests/ --extension-pkg-whitelist='pydantic' --recursive=yes *.py app

- name: Run pylint - tests
run: pylint --rcfile=pyproject.toml --extension-pkg-whitelist='pydantic' --disable=C0415,W0621 tests

# Ignore ID 44715 for now.
# See this NumPy issue for more information: https://github.com/numpy/numpy/issues/19038
# ID: 70612
# Package: Jinja2
# Has been disputed by the maintainer and multiple third parties.
# For more information see: https://github.com/advisories/GHSA-f6pv-j8mr-w6rr
- name: Run safety
run: pip freeze | safety check --stdin --ignore=44715 --ignore=70612
run: pip freeze | safety check --stdin --ignore=70612

docker:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -74,14 +70,12 @@ jobs:

services:
redis:
image: redis:7
image: redis:latest
ports:
- 6379:6379

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Python ${{ matrix.python-version}}
uses: actions/setup-python@v5
Expand All @@ -92,8 +86,7 @@ jobs:
run: |
python -m pip install -U pip
pip install -U setuptools wheel
pip install -r requirements.txt
pip install -U -r .dev/requirements_dev.txt
pip install -U -r requirements.txt -r .dev/requirements_dev.txt
- name: Test with pytest
run: |
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

**Fixed bugs:**

- Install `safety` in a separate environment in CI [\#525](https://github.com/EMMC-ASBL/oteapi-services/issues/525)
- OpenAPI is not retrievable [\#447](https://github.com/EMMC-ASBL/oteapi-services/issues/447)
- Docker compose failing in CI test workflows [\#370](https://github.com/EMMC-ASBL/oteapi-services/issues/370)

Expand All @@ -24,7 +25,7 @@

**Merged pull requests:**

- \[Auto-generated\] Update dependencies [\#521](https://github.com/EMMC-ASBL/oteapi-services/pull/521) ([TEAM4-0](https://github.com/TEAM4-0))
- Fix CI issue concerning `safety` & `pydantic` [\#526](https://github.com/EMMC-ASBL/oteapi-services/pull/526) ([CasperWA](https://github.com/CasperWA))
- \[Auto-generated\] Update dependencies [\#459](https://github.com/EMMC-ASBL/oteapi-services/pull/459) ([TEAM4-0](https://github.com/TEAM4-0))
- \[Auto-generated\] Update dependencies [\#452](https://github.com/EMMC-ASBL/oteapi-services/pull/452) ([TEAM4-0](https://github.com/TEAM4-0))
- \[Auto-generated\] Update dependencies [\#429](https://github.com/EMMC-ASBL/oteapi-services/pull/429) ([TEAM4-0](https://github.com/TEAM4-0))
Expand Down
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
The server should be deployed via the `Dockerfile`.
"""

__version__ = "1.20241023.386"
__version__ = "1.20241028.387"
__author__ = "SINTEF"
__author_email__ = "[email protected]"

0 comments on commit d0d52ee

Please sign in to comment.