Skip to content

Commit

Permalink
Use ruff and update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Nov 22, 2023
1 parent 5935811 commit 2ca4f95
Show file tree
Hide file tree
Showing 5 changed files with 972 additions and 682 deletions.
19 changes: 0 additions & 19 deletions .flake8

This file was deleted.

44 changes: 20 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '[0-9]+.[0-9]+.[0-9]+' # Exclude pre-releases
- '[0-9]+.[0-9]+.[0-9]+'

name: Create Release

Expand All @@ -12,36 +11,33 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: lvmnps ${{ github.ref }}
body: ''
draft: false
prerelease: false
name: lvmnps ${{ github.ref_name }}

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pep517
python -m pip install --upgrade pip setuptools wheel twine build
- name: Build package
- name: Build wheels
run: |
python -m pep517.build --source --binary --out-dir dist/ .
pyproject-build -w
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Build source
run: |
pyproject-build -s
- name: Publish wheels to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
twine upload dist/*
38 changes: 13 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ name: Test

on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
pull_request:
Expand All @@ -19,52 +18,41 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Cache Setup
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}

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

- name: Install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Install dependencies
run: |
poetry env use python
poetry run pip install -U pip setuptools wheel
poetry --no-ansi install --without helpers
pip install --upgrade wheel pip setuptools
pip install .
- name: Lint with flake8
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run pip install flake8
poetry run flake8 . --count --show-source --statistics
pip install ruff
ruff check src/ tests/
- name: Lint with black
run: |
poetry run pip install black
poetry run black --check .
- name: Lint with isort
run: |
poetry run pip install isort
poetry run isort -c . -vvv
pip install black
black --check src/gort
- name: Test with pytest
run: |
poetry --no-ansi install --only test
poetry run pytest
pip install pytest pytest-mock pytest-asyncio pytest-cov
pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
Expand Down
Loading

0 comments on commit 2ca4f95

Please sign in to comment.