-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor, ci: upgrade linting & ci setup (#39)
- Loading branch information
1 parent
16518bf
commit 496a21a
Showing
18 changed files
with
120 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,26 @@ | ||
name: Code quality | ||
|
||
on: | ||
- push | ||
- pull_request | ||
- workflow_dispatch | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
code-quality: | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] | ||
python-version: [3.8, 3.9, "3.10", "3.11"] # pre-commit does not support Python < 3.8 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Downgrade pip | ||
run: pip install "pip<22" | ||
- name: Install dependencies | ||
run: | | ||
pip install ".[dev]" "mypy<1" "black<23" | ||
mypy --install-types --non-interactive reacton | ||
- name: Run black | ||
run: black reacton | ||
- name: Run flake | ||
run: flake8 reacton | ||
- name: mypy | ||
run: mypy reacton | ||
pip install ".[dev]" | ||
- name: Install pre-commit | ||
run: pre-commit install | ||
- name: Run pre-commit | ||
run: pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,28 @@ | ||
name: Test installation | ||
|
||
on: | ||
- push | ||
- pull_request | ||
- workflow_dispatch | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
test-installation: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.7 | ||
- name: Install hatch | ||
run: pip install hatch "pip<22" | ||
run: pip install hatch | ||
- name: Build | ||
run: hatch build | ||
- name: Install | ||
run: pip install dist/*.whl | ||
- name: Test import | ||
run: python -c "import react_ipywidgets; import reacton" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: reacton-build-${{ github.run_number }} | ||
path: ./dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,39 @@ | ||
name: Unit testing | ||
|
||
on: | ||
- push | ||
- pull_request | ||
- workflow_dispatch | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
uses: ./.github/workflows/installation.yml | ||
|
||
code-quality: | ||
uses: ./.github/workflows/codequality.yaml | ||
|
||
unit-test: | ||
needs: [build, code-quality] | ||
runs-on: ubuntu-20.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Downgrade pip | ||
run: pip install "pip<22" | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: reacton-build-${{ github.run_number }} | ||
path: ./dist | ||
- name: Install | ||
run: pip install ".[dev]" "black<23" | ||
run: | | ||
pip install `echo dist/*.whl`[dev] "black<23" | ||
- name: test | ||
run: pytest --cov=reacton reacton |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
args: [--unsafe] | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.8.3 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 3.9.2 | ||
hooks: | ||
- id: flake8 | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.11.5 | ||
hooks: | ||
- id: isort | ||
files: \.py$ | ||
args: [--profile=black] | ||
- id: ruff | ||
stages: [pre-commit] | ||
- id: ruff-format | ||
stages: [pre-commit] | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: "v0.942" # Use the sha / tag you want to point at | ||
rev: "v1.13.0" # Use the sha / tag you want to point at | ||
hooks: | ||
- id: mypy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.