Skip to content

Commit

Permalink
Format code using ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jul 15, 2024
1 parent fee4045 commit 183e592
Show file tree
Hide file tree
Showing 6 changed files with 1,101 additions and 919 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint

on:
push:
branches: [main]
paths-ignore:
- 'docs/**'
- '**.md'
- '**.rst'
pull_request:
branches: [main]
paths-ignore:
- 'docs/**'
- '**.md'
- '**.rst'

jobs:
lint:
runs-on: ubuntu-latest

env:
OBSERVATORY: LCO

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'

- name: Lint with ruff
run: |
pip install ruff
ruff check python/ tests/
ruff format --check python/ tests/
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ jobs:
name: Build wheels
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.12']

permissions:
contents: write
id-token: write
Expand All @@ -25,14 +21,15 @@ jobs:
uses: actions/checkout@v4

- name: Create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: lvmscp ${{ github.ref_name }}

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

- name: Install dependencies
run: |
Expand Down
16 changes: 3 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
- '**.rst'

jobs:
build:
test:
runs-on: ubuntu-latest

strategy:
Expand All @@ -30,7 +30,7 @@ jobs:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -40,23 +40,13 @@ jobs:
pip install --upgrade wheel pip setuptools
pip install .
- name: Lint with ruff
run: |
pip install ruff
ruff check python/ tests/
- name: Lint with black
run: |
pip install black
black --check python/ tests/
- name: Test with pytest
run: |
pip install pytest pytest-mock pytest-asyncio pytest-cov
pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Next version

### ⚙️ Engineering

* Format code using `ruff`.


## 0.8.1 - January 13, 2024

### ✨ Improved
Expand Down
Loading

0 comments on commit 183e592

Please sign in to comment.