From 14d818b0c1a92c7b0078b77253fd89bba2fbaf1b Mon Sep 17 00:00:00 2001 From: Stefaan Lippens Date: Fri, 14 Jun 2024 12:31:37 +0200 Subject: [PATCH] Initial GitHub workflow to run unit tests --- .github/workflows/unittests.yaml | 24 ++++++++++++++++++++++++ pyproject.toml | 15 ++++++++++----- 2 files changed, 34 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/unittests.yaml diff --git a/.github/workflows/unittests.yaml b/.github/workflows/unittests.yaml new file mode 100644 index 0000000..d82e008 --- /dev/null +++ b/.github/workflows/unittests.yaml @@ -0,0 +1,24 @@ +name: "Unit tests" + +on: [push] + +jobs: + unit-tests: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [ + # Just test lowest and highest supported versions for now + "3.8", + "3.12", + ] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install package with test dependencies + run: python -m pip install .[tests] + - name: Test with pytest + run: pytest diff --git a/pyproject.toml b/pyproject.toml index b3f7b7b..bcef744 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,7 +19,7 @@ classifiers = [ ] keywords = ["ESA", "EO", "Earth observation", "openEO"] dependencies = [ - "requests", + "requests>=2.30.0", ] [project.urls] @@ -28,12 +28,12 @@ Issues = "https://github.com/ESA-APEx/esa-apex-toolbox-python/issues" [project.optional-dependencies] tests = [ - "pytest", - "requests_mock", + "pytest>=8.2.0", + "requests_mock>=1.12.0", ] dev = [ - "pytest", - "requests_mock", + "pytest>=8.2.0", + "requests_mock>=1.12.0", ] [tool.hatch.version] @@ -47,3 +47,8 @@ profile = "black" [tool.ruff] line-length = 120 + +[tool.pytest.ini_options] +testpaths = [ + "tests", +]