Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#418: Introducing python toolbox #421

Merged
merged 33 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
7151f59
#418: Introduced Python-Toolbox
tomuben Nov 18, 2024
a8e59a8
Updated changelog
tomuben Nov 18, 2024
4e9eb87
Set pylint minimal rating
tomuben Nov 18, 2024
3b13ae8
Updated .gitignore
tomuben Nov 18, 2024
90d7600
Replace usages of Python3.8 with Ubuntu22.04+Python3.10 or Python3.9
tomuben Nov 18, 2024
6d446cd
Marked automatically generated GH workflows as such
tomuben Nov 18, 2024
3d20027
Update .pre-commit-config.yaml
tomuben Nov 18, 2024
043e573
Updated .pre-commit-config.yaml
tomuben Nov 18, 2024
e84ef05
Updated doc
tomuben Nov 18, 2024
d8c1f5b
Ignore check in checks.yml
tomuben Nov 18, 2024
30a0078
[run all tests]
tomuben Nov 18, 2024
f786764
Updated unreleased.md
tomuben Nov 18, 2024
a4afc19
Updated developer_guide.rst
tomuben Nov 18, 2024
21926e9
[run all tests]
tomuben Nov 18, 2024
f170c54
Updated release steps in developer guide
tomuben Nov 19, 2024
b3fe249
Removed some GH workflows from .gitattributes
tomuben Nov 19, 2024
e74fc13
Use matrix build in test_python_version.yml
tomuben Nov 19, 2024
aa6ca55
Restructed GH workflows for tests
tomuben Nov 19, 2024
2fc67cb
Removed all GH Workflows from .gitattributes
tomuben Nov 19, 2024
fad1093
Fixed security scanner
tomuben Nov 19, 2024
7fddee8
[run all tests]
tomuben Nov 19, 2024
67d9cab
[run all tests]
tomuben Nov 19, 2024
577f86b
1. Override unit test nox task
tomuben Nov 19, 2024
e898cf0
[run all tests]
tomuben Nov 19, 2024
2c8e28e
Cleaned up .pre-commit-config.yaml
tomuben Nov 19, 2024
3bc328c
[run all tests]
tomuben Nov 19, 2024
796cd6d
Added empty webfonts.html
tomuben Nov 19, 2024
0440ab7
Renamed tests.yml to tests_with_converage.yml
tomuben Nov 19, 2024
0776b0e
[run all tests]
tomuben Nov 19, 2024
c35769b
Renamed tests_with_converage.yml to tests_with_coverage.yml and fixe…
tomuben Nov 19, 2024
24ed63c
[run all tests]
tomuben Nov 19, 2024
950c0b4
Updated to exasol-toolbox 0.18.0 and removed overloading nox task lin…
tomuben Nov 19, 2024
72b1c2d
[run all tests]
tomuben Nov 19, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,11 @@ EXAConf text eol=lf

poetry.lock linguist-generated=true
exasol_integration_test_docker_environment/docker_db_config/**/* linguist-generated=true
.github/workflows/cd.yml linguist-generated=true
.github/workflows/check-release-tag.yml linguist-generated=true
.github/workflows/checks.yml linguist-generated=true
.github/workflows/ci.yml linguist-generated=true
.github/workflows/gh-pages.yml linguist-generated=true
.github/workflows/merge-gate.yml linguist-generated=true
.github/workflows/pr-merge.yml linguist-generated=true
.github/workflows/report.yml linguist-generated=true
tkilias marked this conversation as resolved.
Show resolved Hide resolved
19 changes: 0 additions & 19 deletions .github/actions/prepare_poetry_env/action.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CD

on:
push:
tags:
- '**'

jobs:

check-tag-version-job:
name: Check Release Tag
uses: ./.github/workflows/check-release-tag.yml

cd-job:
name: Continuous Delivery
uses: ./.github/workflows/build-and-publish.yml
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

publish-docs:
needs: [ cd-job ]
name: Publish Documentation
uses: ./.github/workflows/gh-pages.yml

21 changes: 21 additions & 0 deletions .github/workflows/check-release-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Release Tag

on: workflow_call

jobs:

check-tag-version-job:

name: Check Tag Version
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Check Tag Version
# make sure the pushed/created tag matched the project version
run: "[[ `poetry version --short` == ${{ github.ref_name }} ]]"
14 changes: 0 additions & 14 deletions .github/workflows/check_version.yaml

This file was deleted.

150 changes: 150 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
name: Checks

on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false

jobs:

Version-Check:
name: Version
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Check Version(s)
run: |
poetry run version-check `poetry run python -c "from noxconfig import PROJECT_CONFIG; print(PROJECT_CONFIG.version_file)"`

Documentation:
name: Docs
needs: [ Version-Check ]
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Build Documentation
run: |
poetry run python -m nox -s docs:build

Lint:
name: Linting (Python-${{ matrix.python-version }})
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run lint
run: poetry run nox -s lint:code

- name: Upload Artifacts
uses: actions/[email protected]
with:
name: lint-python${{ matrix.python-version }}
path: .lint.txt
include-hidden-files: true

Type-Check:
name: Type Checking (Python-${{ matrix.python-version }})
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run type-check
run: poetry run nox -s lint:typing || echo ignoring...

Security:
name: Security Checks (Python-${{ matrix.python-version }})
needs: [ Version-Check ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11" ]

steps:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run security linter
run: poetry run nox -s lint:security || echo ignoring...

- name: Upload Artifacts
uses: actions/[email protected]
with:
name: security-python${{ matrix.python-version }}
path: .security.json
include-hidden-files: true

Tests:
name: Tests (Python-${{ matrix.python-version }}, Exasol-${{ matrix.exasol-version}})
needs: [ Documentation, Lint, Type-Check, Security ]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
exasol-version: ["7.1.9"]

steps:
- name: SCM Checkout
uses: actions/checkout@v4

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}

- name: Run Tests and Compute Coverage
run: poetry run nox -s test:coverage -- -- --db-version ${{ matrix.exasol-version }}

- name: Upload Artifacts
uses: actions/[email protected]
with:
name: coverage-python${{ matrix.python-version }}
path: .coverage
include-hidden-files: true
24 changes: 24 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: CI

on:
push:
branches-ignore:
- "github-pages/*"
- "gh-pages/*"
- "main"
- "master"
pull_request:
types: [opened, reopened]
schedule:
# “At 00:00 on every 7th day-of-month from 1 through 31.” (https://crontab.guru)
- cron: "0 0 1/7 * *"

jobs:

CI:
uses: ./.github/workflows/merge-gate.yml
secrets: inherit

Metrics:
needs: [ CI ]
uses: ./.github/workflows/report.yml
22 changes: 0 additions & 22 deletions .github/workflows/create_release_docu.yaml

This file was deleted.

9 changes: 7 additions & 2 deletions .github/workflows/get_exasol_versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ jobs:
get_exasol_versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prepare_poetry_env
- uses: actions/checkout@v4
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
with:
python-version: "3.10"
poetry-version: '1.8.2'

- name: Print matrix
run: poetry run nox --non-interactive -s "get-all-db-versions"
- id: set-matrix
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish Documentation

on:
workflow_call:
workflow_dispatch:

jobs:

documentation-job:
runs-on: ubuntu-latest

steps:
- name: SCM Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]

- name: Build Documentation
run: |
poetry run sphinx-multiversion doc/ .html-documentation

- name: Deploy
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: .html-documentation
git-config-name: Github Action
git-config-email: [email protected]
46 changes: 46 additions & 0 deletions .github/workflows/merge-gate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Merge-Gate

on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false

jobs:

fast-checks:
name: Fast
uses: ./.github/workflows/checks.yml

slow-checks:
name: Slow
runs-on: ubuntu-latest

# Even though the environment "manual-approval" will be created automatically,
# it still needs to be configured to require interactive review.
# See project settings on GitHub (Settings / Environments / manual-approval).
environment: manual-approval

# Replace the steps below with the required actions
# and/or add additional jobs if required
# Note:
# If you add additional jobs, make sure they are added as a requirement
# to the approve-merge job's input requirements (needs).
steps:
- name: Tests
run: |
echo "Slow tests ran successfully"
ckunki marked this conversation as resolved.
Show resolved Hide resolved


# This job ensures inputs have been executed successfully.
approve-merge:
name: Allow Merge
runs-on: ubuntu-latest
# If you need additional jobs to be part of the merge gate, add them below
needs: [ fast-checks, slow-checks ]

# Each job requires a step, so we added this dummy step.
steps:
- name: Approve
run: |
echo "Merge Approved"
Loading
Loading