Skip to content

Commit

Permalink
Clean up CI file
Browse files Browse the repository at this point in the history
  • Loading branch information
sharoonthomas committed May 7, 2024
1 parent b39bffd commit 69f2677
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 26 deletions.
36 changes: 13 additions & 23 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: chartboost/ruff-action@v1
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Python Lint
run: |
pip install ruff>=0.4.3
ruff check .
ruff format --check .
build:
strategy:
matrix:
Expand All @@ -16,34 +23,17 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Install from source (required for the pre-commit tests)
run: pip install .

- name: Test with pytest
run: pytest --cov=./ --cov-report=xml tests/test_serialization.py
release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.11
uses: actions/setup-python@v1
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
make dist
- name: Publish package
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
run: pytest tests/test_serialization.py
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.3
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
3 changes: 1 addition & 2 deletions fulfil_client/signals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
"""
flask.signals
~~~~~~~~~~~~~
Expand Down Expand Up @@ -43,7 +42,7 @@ def _fail(self, *args, **kwargs):
"not installed."
)

send = lambda *a, **kw: None
send = lambda *a, **kw: None # noqa
connect = disconnect = has_receivers_for = receivers_for = (
temporarily_connected_to
) = connected_to = _fail
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def test_multi_cache_with_redis(self, res_user_model_with_cache):

def test_multi_cache_empty_list(self, res_user_model_with_cache):
"Should not raise an error"
records = res_user_model_with_cache.from_cache_multi([])
res_user_model_with_cache.from_cache_multi([])

def test_inequality_of_saved_records(self, res_user_model, module_model):
assert res_user_model.query.first() != module_model.query.first()
Expand Down

0 comments on commit 69f2677

Please sign in to comment.