Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
pencil committed Dec 12, 2024
1 parent 1e9f970 commit db21d05
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
31 changes: 31 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run Tests

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"

steps:
- name: Checkout repository
uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
run: make test
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.19.0
hooks:
- id: pyupgrade
args: [--py310-plus]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Prevent commits to main
# - id: no-commit-to-branch
# args: [--branch, dev, --branch, main]
# Make sure links to Github are permalinks and not just the latest.
- id: check-vcs-permalinks
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.2
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
4 changes: 1 addition & 3 deletions dramatiq_workflow/tests/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ def __generate_id(self):
self.message_ids.append(current_id)
return current_id

def __make_message(
self, message_id, *args, message_options={}, message_timestamp=None, **kwargs
):
def __make_message(self, message_id, *args, message_options={}, message_timestamp=None, **kwargs):
return dramatiq.Message(
message_id=message_id,
message_timestamp=message_timestamp or self.message_timestamp,
Expand Down
10 changes: 10 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tool.ruff]
line-length = 120
target-version = 'py310'
exclude = [".git", "__pypackages__", "venv"]

[tool.ruff.lint]
fixable = ["ALL"]

[tool.pytest.ini_options]
norecursedirs = '.git'

0 comments on commit db21d05

Please sign in to comment.