Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* senzing-factory/build-resources#69 add linting

* Fix pylint invocation

* Fix pylint invocation

* Fix pylint invocation

* disable check

* disable check

---------

Co-authored-by: docktermj <michael@dockter.com>
  • Loading branch information
kernelsam and docktermj authored Feb 9, 2024
1 parent 97e9503 commit 278631b
Show file tree
Hide file tree
Showing 17 changed files with 162 additions and 79 deletions.
9 changes: 9 additions & 0 deletions .github/linters/.yaml-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Extends the default yamllint config by adjusting some options.
extends: default

rules:
comments-indentation: disable
line-length:
level: warning
allow-non-breakable-inline-mappings: true
truthy: disable
2 changes: 1 addition & 1 deletion .github/workflows/add-labels-standardized.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'add labels standardized'
name: add labels standardized

on:
issues:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/add-to-project-garage-dependabot.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
name: 'add to project garage dependabot'
name: add to project garage dependabot

on:
pull_request:
branches: [main]

jobs:

add-to-project-dependabot:
secrets:
SENZING_GITHUB_PROJECT_RW_TOKEN: ${{ secrets.SENZING_GITHUB_PROJECT_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@main
uses: senzing-factory/build-resources/.github/workflows/add-to-project-dependabot.yaml@v1
with:
project: ${{ vars.SENZING_PROJECT_GARAGE }}
9 changes: 5 additions & 4 deletions .github/workflows/add-to-project-garage.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'add to project garage'
name: add to project garage

on:
issues:
Expand All @@ -8,11 +8,12 @@ on:

jobs:
add-to-project:
name: Add issue to project
name: add issue to project
runs-on: ubuntu-latest

steps:
- name: Assign issue to project
- name: assign issue to project
uses: actions/add-to-project@v0.5.0
with:
project-url: https://github.com/orgs/${{ vars.SENZING_GITHUB_ACCOUNT_NAME }}/projects/${{ vars.SENZING_PROJECT_GARAGE }}
github-token: ${{ secrets.SENZING_GITHUB_ACCESS_TOKEN }}
project-url: https://github.com/orgs/${{ vars.SENZING_GITHUB_ACCOUNT_NAME }}/projects/${{ vars.SENZING_PROJECT_GARAGE }}
19 changes: 12 additions & 7 deletions .github/workflows/build-distribution.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,29 @@
name: build-distribution.yaml
name: build distribution

on: [push]

jobs:
build-distribution:
name: Build distribution
name: build distribution
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: checkout repository
uses: actions/checkout@v4
- name: Set up Python

- name: set up Python
uses: actions/setup-python@v5
- name: Install pypa/build

- name: install pypa/build
run: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt
python -m pip install build
- name: Build a binary wheel and a source tarball
- name: build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages

- name: store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/create-sphinx-documentation.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: create-sphinx-documentation.yaml
name: create sphinx documentation

on: [push, pull_request, workflow_dispatch]

Expand All @@ -8,16 +8,21 @@ permissions:
jobs:
docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
- name: Install dependencies

- name: install dependencies
run: |
pip install sphinx sphinx_rtd_theme myst_parser autodocsumm sphinx-toolbox
- name: Sphinx build
- name: sphinx build
run: |
sphinx-build docs/source _build
- name: Deploy to GitHub Pages
- name: deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
# if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependabot-approve-and-merge.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: dependabot-approve-and-merge.yaml
name: dependabot approve and merge

on:
pull_request:
Expand All @@ -9,6 +9,6 @@ jobs:
permissions:
contents: write
pull-requests: write
uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@main
secrets:
SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN: ${{ secrets.SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN }}
uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@v1
8 changes: 6 additions & 2 deletions .github/workflows/flake8.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
name: flake8.yaml
name: flake8

on: [push]

jobs:
flake8:
name: "flake8 Python ${{ matrix.python-version }}"
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
name: "flake8 Python ${{ matrix.python-version }}"

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- run: pwd; ls -la

- name: flake8 Lint
uses: py-actions/flake8@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/isort.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: isort.yaml
name: isort

on: [push]

jobs:
isort:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: isort/isort-action@v1
with:
requirements-files: "requirements.txt"
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/lint-workflows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: lint workflows

on:
push:
branches-ignore: [main]
pull_request:
branches: [main]

permissions:
contents: read
packages: read
pull-requests: read
statuses: write

jobs:
lint-workflows:
uses: senzing-factory/build-resources/.github/workflows/lint-workflows.yaml@v1
36 changes: 22 additions & 14 deletions .github/workflows/publish-to-pypi.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# Based on https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

name: publish-to-pypi.yaml
name: publish to pypi

on:
push:
Expand All @@ -9,28 +7,33 @@ on:

jobs:
build-distribution:
name: Build distribution
name: build distribution
runs-on: ubuntu-latest

steps:
- name: Checkout repository
- name: checkout repository
uses: actions/checkout@v4
- name: Set up Python

- name: set up Python
uses: actions/setup-python@v5
- name: Install pypa/build

- name: install pypa/build
run: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt
python -m pip install build
- name: Build a binary wheel and a source tarball
- name: build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages

- name: store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

publish-to-pypi:
name: Publish Python distribution to PyPI
name: publish Python distribution to PyPI
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
needs:
- build-distribution
Expand All @@ -40,36 +43,41 @@ jobs:
url: https://pypi.org/p/senzing-abstract
permissions:
id-token: write

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

github-release:
name: Sign the Python distribution with Sigstore and upload them to GitHub Release
name: sign the Python distribution with Sigstore and upload them to GitHub Release
needs:
- publish-to-pypi
runs-on: ubuntu-latest
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore

steps:
- name: Download all the dists
- name: download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore

- name: sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Upload artifact signatures to GitHub Release
- name: upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
Expand Down
15 changes: 10 additions & 5 deletions .github/workflows/pylint.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pylint.yaml
name: pylint

on: [push]

Expand All @@ -7,18 +7,23 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
python-version: ['3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}

- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies

- name: install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt
python -m pip install psutil pylint pytest pytest_schema
- name: Analysing the code with pylint
- name: analysing the code with pylint
run: |
# shellcheck disable=SC2046
pylint $(git ls-files '*.py' ':!:docs/source/*')
16 changes: 10 additions & 6 deletions .github/workflows/pytest-darwin.yaml.disabled
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pytest-darwin.yaml
name: pytest darwin

on: [push]

Expand All @@ -8,24 +8,28 @@ env:

jobs:
pytest-darwin:
name: "pytest OS: ${{ matrix.os }}; Python ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
# python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.11"]
name: "pytest OS: ${{ matrix.os }}; Python ${{ matrix.python-version }}"

steps:
- name: Checkout repository
- name: checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}

- name: set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies

- name: install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --requirement requirements.txt
python -m pip install psutil pytest pytest-cov pytest-schema
- name: Run pytest on tests

- name: run pytest on tests
run: pytest tests/ --verbose --capture=no --cov=src/senzing_abstract
Loading

0 comments on commit 278631b

Please sign in to comment.