Skip to content

Commit

Permalink
github action for pytest, makefile additions
Browse files Browse the repository at this point in the history
  • Loading branch information
plutonium-239 committed Mar 31, 2024
1 parent 1897d71 commit ce73898
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Pytest
on: [push, pull_request]
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: pytest-install
run: make install-test
- name: pytest
run: make test
3 changes: 2 additions & 1 deletion .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: ruff-install
run: pip install ruff
- name: ruff
env:
RUFF_OUTPUT_FORMAT: github
run: |
pip install ruff
ruff format --check
ruff check
16 changes: 16 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,26 @@
.DEFAULT: help

help:
@echo "install"
@echo " Install as an editable package"
@echo "install-test"
@echo " Install as an editable package + test"
@echo "ruff"
@echo " Run ruff formatter and linter"
@echo "test"
@echo " Run pytest (tests directory)"
@echo "test-full"
@echo " Run pytest with expensive tests (tests directory)"

.PHONY: install

install:
@pip install -e .

.PHONY: install-test

install-test:
@pip install -e .[test]

.PHONY: ruff

Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ classifiers = [
[project.urls]
Repository = "https://github.com/plutonium-239/memsave_torch"

[project.optional-dependencies]
test = [
'coveralls',
'pytest',
'pytest-cov',
'pytest-optional-tests',
]

[tool.pytest.ini_options]
markers = [
"quick: marks tests as quick (only run on make test or using pytest -m quick)",
Expand Down

0 comments on commit ce73898

Please sign in to comment.