diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 28673b9..47cf599 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,17 +1,19 @@ version: 2 updates: - - package-ecosystem: "pip" - directory: "/" + - package-ecosystem: pip + directory: '/' schedule: - interval: "monthly" + interval: monthly allow: - - dependency-type: "all" - open-pull-requests-limit: 20 + - dependency-type: all groups: python-dependencies: patterns: ['*'] - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: github-actions + directory: '/' schedule: - interval: "daily" + interval: daily + groups: + github-actions: + patterns: ['*'] diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml deleted file mode 100644 index 8069d18..0000000 --- a/.github/workflows/codeql.yml +++ /dev/null @@ -1,95 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ "main" ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ "main" ] - schedule: - - cron: '27 17 * * 0' - -jobs: - analyze: - name: Analyze - - runs-on: ubuntu-latest - - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'python' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Use only 'java' to analyze code written in Java, Kotlin or both - # Use only 'javascript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - defaults: - run: - shell: bash -l {0} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up micromamba - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: environment.yml - - - name: Set interpreter - run: | - CODEQL_PYTHON=$(command -v python) - for name in CODEQL_PYTHON PATH; do - printf '%s=%s\n' "$name" "${!name}" | tee -a -- "$GITHUB_ENV" - done - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - setup-python-dependencies: false - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - - # Details on CodeQL's query packs refer to : https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs - # queries: security-extended,security-and-quality - - - # Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun - - # If the Autobuild fails above, remove it and uncomment the following three lines. - # modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance. - - # - run: | - # echo "Run, Build Application using script" - # ./location_of_script_within_repo/buildscript.sh - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" diff --git a/.github/workflows/flake8.yml b/.github/workflows/flake8.yml deleted file mode 100644 index fb5dc9a..0000000 --- a/.github/workflows/flake8.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: flake8 Lint - -on: [push, pull_request] - -jobs: - flake8-lint: - runs-on: ubuntu-latest - name: Lint - steps: - - name: Check out source repository - uses: actions/checkout@v4 - - name: Set up Python environment - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - name: flake8 Lint - uses: py-actions/flake8@v2 diff --git a/.github/workflows/pytest-conda.yml b/.github/workflows/pytest-conda.yml deleted file mode 100644 index 93c16d1..0000000 --- a/.github/workflows/pytest-conda.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: pytest (conda) - -on: [push, pull_request] - -jobs: - test: - name: Test - - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.11', '3.10', '3.9', '3.8', '3.7'] - - runs-on: ${{ matrix.os }} - - defaults: - run: - shell: bash -l {0} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Substitute Python version - run: | - perl -i -spwe 's/^ *- python=\K.+$/$pyver/' -- \ - -pyver=${{ matrix.python-version }} environment.yml - - - name: Set up micromamba - uses: mamba-org/setup-micromamba@v1 - with: - environment-file: environment.yml - - - name: Run all tests - run: pytest --doctest-modules - timeout-minutes: 2 diff --git a/.github/workflows/pytest-pipenv-lock.yml b/.github/workflows/pytest-pipenv-lock.yml deleted file mode 100644 index e1ef364..0000000 --- a/.github/workflows/pytest-pipenv-lock.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: pytest (Pipfile.lock) - -on: [push, pull_request] - -jobs: - test: - name: Test - - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: 3.11 - - - name: Upgrade PyPA packages - run: python -m pip install -U pip setuptools wheel - - - name: Install pipenv - run: pip install pipenv - - - name: Install project with all dependencies - run: pipenv install -d - - - name: Run all tests - run: pipenv run pytest --doctest-modules - timeout-minutes: 2 diff --git a/.github/workflows/pytest-pipenv.yml b/.github/workflows/pytest-pipenv.yml deleted file mode 100644 index c325abf..0000000 --- a/.github/workflows/pytest-pipenv.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: pytest (Pipfile) - -on: [push, pull_request] - -jobs: - test: - name: Test - - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ['3.11', '3.10', '3.9', '3.8', '3.7'] - - runs-on: ${{ matrix.os }} - - defaults: - run: - shell: bash - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Remove Pipfile.lock - run: rm Pipfile.lock - - - name: Drop full Python version - run: | - perl -i -nwe 'print unless /^python_full_version = "[^"]+"$/' Pipfile - - - name: Substitute Python version - run: | - perl -i -spwe 's/^python_version = "\K[^"]+(?="$)/$pyver/' -- \ - -pyver=${{ matrix.python-version }} Pipfile - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: Upgrade PyPA packages - run: python -m pip install -U pip setuptools wheel - - - name: Install pipenv - run: pip install pipenv - - - name: Install project with all dependencies - run: pipenv install -d - - - name: Run all tests - run: pipenv run pytest --doctest-modules - timeout-minutes: 2 diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml deleted file mode 100644 index 0459627..0000000 --- a/.github/workflows/shellcheck.yml +++ /dev/null @@ -1,12 +0,0 @@ -name: Run ShellCheck - -on: [push, pull_request] - -jobs: - shellcheck: - runs-on: [ubuntu-latest] - steps: - - name: Check out source repository - uses: actions/checkout@v4 - - name: Analyze shell scripts - uses: 'bewuethr/shellcheck-action@v2' diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a189ec2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,193 @@ +name: Test + +on: [push, pull_request] + +jobs: + pytest-conda: + name: pytest (conda) + + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: + # - '3.13t' + - '3.13' + - '3.12' + - '3.11' + - '3.10' + - '3.9' + - '3.8' + - '3.7' + exclude: + - os: macos-latest + python-version: '3.7' + + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: bash -l {0} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Substitute Python version + run: | + perl -i -spwe 's/^ *- python=\K.+$/$pyver/' -- \ + -pyver=${{ matrix.python-version }} environment.yml + + - name: Set up micromamba + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: environment.yml + + - name: Run all tests + run: pytest --doctest-modules + timeout-minutes: 2 + + pytest-pipenv-lock: + name: pytest (Pipfile.lock) + + strategy: + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.11 + + - name: Upgrade PyPA packages + run: python -m pip install -U pip setuptools wheel + + - name: Install pipenv + run: pip install pipenv + + - name: Install project with all dependencies + run: pipenv install -d + + - name: Run all tests + run: pipenv run pytest --doctest-modules + timeout-minutes: 2 + + pytest-pipenv: + name: pytest (Pipfile) + + strategy: + matrix: + os: + - ubuntu-latest + - ubuntu-22.04 + - macos-latest + # - windows-latest + python-version: + # - '3.13t' + - '3.13' + - '3.12' + - '3.11' + - '3.10' + - '3.9' + - '3.8' + - '3.7' + exclude: + # Don't test Python 3.7 on Ubuntu >= 24.04 LTS. + - os: ubuntu-latest + python-version: '3.7' + # Only test Python 3.7 on Ubuntu 22.04 LTS. + - os: ubuntu-22.04 + python-version: '3.13' + - os: ubuntu-22.04 + python-version: '3.12' + - os: ubuntu-22.04 + python-version: '3.11' + - os: ubuntu-22.04 + python-version: '3.10' + - os: ubuntu-22.04 + python-version: '3.9' + - os: ubuntu-22.04 + python-version: '3.8' + # Don't test Python 3.7 on macOS. + - os: macos-latest + python-version: '3.7' + + runs-on: ${{ matrix.os }} + + defaults: + run: + shell: bash + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Remove Pipfile.lock + run: rm Pipfile.lock + + - name: Drop full Python version + run: | + perl -i -nwe 'print unless /^python_full_version = "[^"]+"$/' Pipfile + + - name: Substitute Python version + run: | + perl -i -spwe 's/^python_version = "\K[^"]+(?="$)/$pyver/' -- \ + -pyver=${{ matrix.python-version }} Pipfile + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Upgrade PyPA packages + run: python -m pip install -U pip setuptools wheel + + - name: Install pipenv + run: pip install pipenv + + - name: Install project with all dependencies + run: pipenv install -d + + - name: Run all tests + run: pipenv run pytest --doctest-modules + timeout-minutes: 2 + + lint: + name: Lint (flake8) + + runs-on: ubuntu-latest + + steps: + - name: Check out source repository + uses: actions/checkout@v4 + + - name: Set up Python environment + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: flake8 Lint + uses: py-actions/flake8@v2 + + shellcheck: + name: ShellCheck + + runs-on: ubuntu-latest + + steps: + - name: Check out source repository + uses: actions/checkout@v4 + + - name: Analyze shell scripts + uses: bewuethr/shellcheck-action@v2