From 6f79fcf32d4b8a5bad5f0dabb7b44b7f0bec8e17 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:01:22 -0500 Subject: [PATCH 1/3] configure tox for linting, add linting step to main.yml --- .github/workflows/main.yml | 40 +++++++++++++++++++++++++++----------- tox.ini | 12 +++++++++++- 2 files changed, 40 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a386a4249..b36925023 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name: build ⚙️ +name: Build PyWPS ⚙️ on: push: @@ -7,7 +7,28 @@ on: pull_request: jobs: + lint: + name: Linting Suite + runs-on: ubuntu-latest + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.9" + - name: Install tox + run: | + pip install tox>=4.0 + - name: Run linting suite ⚙️ + run: | + tox -e lint + test: + name: Testing with Python${{ matrix.python-version }} + needs: lint runs-on: ubuntu-latest strategy: matrix: @@ -21,20 +42,15 @@ jobs: - tox-env: py311-extra python-version: "3.11" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install packages 📦 run: | sudo apt-get update sudo apt-get -y install libnetcdf-dev libhdf5-dev - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 name: Setup Python ${{ matrix.python-version }} with: python-version: ${{ matrix.python-version }} - - name: Run flake8 ⚙️ - run: | - pip install flake8 - flake8 pywps - if: matrix.python-version == 3.8 - name: Install tox 📦 run: pip install "tox>=4.0" - name: Run tests with tox ⚙️ @@ -44,14 +60,16 @@ jobs: uses: AndreMiras/coveralls-python-action@develop docs: + name: Build docs 🏗️ + needs: lint runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 name: Setup Python 3.8 with: python-version: 3.8 - - name: Build docs 🏗️ + - name: Build documentation 🏗️ run: | pip install -e .[dev] cd docs && make html diff --git a/tox.ini b/tox.ini index ed733aa5c..1eeec944a 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,19 @@ [tox] min_version = 4.0 -envlist = py{37,38,39,310,311}{-extra,} +envlist = + py{37,38,39,310,311}{-extra,}, + lint requires = pip >= 20.0 opts = --verbose +[testenv:lint] +skip_install = true +extras = +deps = + flake8 +commands = + flake8 pywps + [testenv] setenv = PYTEST_ADDOPTS = "--color=yes" From c2ba97dec40fb1ef1ece26816d88182c4f723f4f Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:01:33 -0500 Subject: [PATCH 2/3] add a ReadTheDocs configuration --- .readthedocs.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .readthedocs.yml diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 000000000..71f67c8e9 --- /dev/null +++ b/.readthedocs.yml @@ -0,0 +1,25 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-22.04 + tools: + python: "mambaforge-22.9" + +# Build documentation in the docs/ directory with Sphinx +sphinx: + configuration: docs/conf.py + +# We recommend specifying your dependencies to enable reproducible builds: +# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html +python: + install: + - method: pip + path: . + extra_requirements: + - dev \ No newline at end of file From 758ba187f1ff68ad5ea9d4febee32e57dfb78fc9 Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Wed, 3 Jan 2024 13:09:13 -0500 Subject: [PATCH 3/3] add build formats --- .readthedocs.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.readthedocs.yml b/.readthedocs.yml index 71f67c8e9..f00a2a33b 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -5,6 +5,11 @@ # Required version: 2 +# Make additional formats available for download +formats: + - pdf + - epub + # Set the version of Python and other tools you might need build: os: ubuntu-22.04