Skip to content

Commit

Permalink
refactor: simplified Makefile; used other way to install poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelkryukov committed Sep 12, 2024
1 parent 2ba6d0a commit 3d4d19f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ jobs:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ["3.8", "3.10", "3.12"]
defaults:
run:
shell: bash
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 Poetry
uses: snok/install-poetry@v1
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install --no-interaction
- name: Lint with ruff and test with pytest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install --no-interaction
- name: Test with coverage and pytest
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
.PHONY: all
.PHONY: all check format test

all: check test

check:
poetry run python -m ruff check mongomock_motor/ tests/ && \
poetry run python -m ruff format --check mongomock_motor/ tests/
poetry run ruff check mongomock_motor tests && \
poetry run ruff format --check mongomock_motor tests

format:
poetry run python -m ruff check --fix mongomock_motor/ tests/ && \
poetry run python -m ruff format mongomock_motor/ tests/
poetry run ruff check --fix mongomock_motor tests && \
poetry run ruff format mongomock_motor tests

test:
poetry run python -m pytest tests/
poetry run pytest tests

0 comments on commit 3d4d19f

Please sign in to comment.