From 6a1d98ed661330bb56c6f68dd1b0b1ad920b8687 Mon Sep 17 00:00:00 2001 From: Maciej Brencz Date: Wed, 20 Nov 2024 20:49:59 +0000 Subject: [PATCH 1/2] Create python-test.yml for the CI $ pytest -vv . =================================================================================================== test session starts ==================================================================================================== platform linux -- Python 3.12.7+, pytest-8.3.3, pluggy-1.5.0 -- /home/macbre/github/mbc-harvest/env/bin/python cachedir: .pytest_cache rootdir: /home/macbre/github/mbc-harvest collected 3 items test_dlibra.py::test_get_presentation_data_url PASSED [ 33%] test_dlibra.py::test_get_content_url PASSED [ 66%] test_dlibra.py::test_get_set PASSED [100%] ===================================================================================================== warnings summary ===================================================================================================== test_dlibra.py::test_get_content_url test_dlibra.py::test_get_set /home/macbre/github/mbc-harvest/env/lib/python3.12/site-packages/urllib3/connectionpool.py:1099: InsecureRequestWarning: Unverified HTTPS request is being made to host 'mbc.cyfrowemazowsze.pl'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings warnings.warn( -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ============================================================================================== 3 passed, 2 warnings in 5.80s =============================================================================================== --- .github/workflows/python-test.yml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 .github/workflows/python-test.yml diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml new file mode 100644 index 0000000..3cac2cf --- /dev/null +++ b/.github/workflows/python-test.yml @@ -0,0 +1,26 @@ +name: Test the Python code + +on: + push: + branches: [ "master" ] + pull_request: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: "3.13" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + - name: Test with pytest + run: | + pytest -vv . From d8b381de82541958b00bb031f1b794f1b4c6621c Mon Sep 17 00:00:00 2001 From: Maciej Brencz Date: Wed, 20 Nov 2024 20:51:27 +0000 Subject: [PATCH 2/2] pip install -r requirements.txt --- .github/workflows/python-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml index 3cac2cf..e2ba43e 100644 --- a/.github/workflows/python-test.yml +++ b/.github/workflows/python-test.yml @@ -20,7 +20,7 @@ jobs: python-version: "3.13" - name: Install dependencies run: | - python -m pip install --upgrade pip + pip install -r requirements.txt - name: Test with pytest run: | pytest -vv .