Skip to content

Commit

Permalink
[MAINT] Convert to pyproject.toml , add pre-commit
Browse files Browse the repository at this point in the history
Based on orangecontrib.snom
  • Loading branch information
stuart-cls committed Nov 14, 2024
1 parent 1773da2 commit c093c5f
Show file tree
Hide file tree
Showing 17 changed files with 246 additions and 821 deletions.
18 changes: 18 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[run]
source =
orangecontrib/protospec
omit =
*tests*

[report]
exclude_lines =
pragma: no cover
def __repr__

# Don't complain if tests don't hit defensive assertion code:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Lint

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]

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

- name: Install dependencies
run: |
python -m pip install pre-commit
- name: Lint
run: pre-commit run --all-files --show-diff-on-failure
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Python package publish
on:
release:
types: [created]
workflow_dispatch:
jobs:
build_wheels:
name: Build and publish package / wheel
runs-on: ubuntu-latest
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing

steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '>=3.9'
- name: Build package / wheel
run: |
python -m pip install build
python -m build
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1



14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
normal:
name: Usual
uses: biolab/orange-ci-cd/.github/workflows/test-addons.yml@master
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ htmlcov/*

# check_pylint_diff
.pylint_cache

# venv
venv
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py39-plus"]
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-ast
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- pep8-naming
- flake8-black
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

210 changes: 0 additions & 210 deletions .travis/check_pylint_diff

This file was deleted.

14 changes: 0 additions & 14 deletions .travis/install_orange.sh

This file was deleted.

Loading

0 comments on commit c093c5f

Please sign in to comment.