Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,21 @@ Any contributions are more than welcome.

## Development

The `make install` command reads the pyproject.toml file from the current project, resolves the dependencies, and installs them.
Development requires [Poetry](https://python-poetry.org/) as a dependency management system.

```
pip install poetry
```

The `make install` command resolves and installs the dependencies.

```
make install
```

Before making a pull request, make sure `make test` succeeds and run `make format`.
Before making a pull request, run `make format` and make sure `make check` succeeds.

```
make test
make format
make check
```
2 changes: 1 addition & 1 deletion .github/workflows/bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
uses: peter-evans/create-pull-request@v3
with:
author: GitHub Actions <[email protected]>
commit-message: bump version
commit-message: ${{ steps.bump.outputs.PR_TITLE }}
delete-branch: true
branch-suffix: short-commit-hash
title: ${{ steps.bump.outputs.PR_TITLE }}
13 changes: 5 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,12 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Install
run: pip install . && pip install torch && pip install pytest pytest-cov codecov
- run: pip install poetry

- name: Run doctest
run: python3 -m pytest --doctest-modules ${PROJECT_NAME}
if: always()
- run: poetry install --extras torch

- name: Run pytest
run: python3 -m pytest --cov=${PROJECT_NAME} tests
- name: Run doctest
run: make test
if: always()

- uses: codecov/codecov-action@v1
Expand Down Expand Up @@ -83,7 +80,7 @@ jobs:

- uses: psf/black@stable
with:
options: '--check --diff --skip-magic-trailing-comma'
options: --check --diff --skip-magic-trailing-comma

- uses: jamescurtin/isort-action@master
with:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ jobs:

- uses: actions/setup-python@v2

- run: pip install poetry

- run: poetry install --extras torch
- run: pip install poetry && poetry install --extras torch

- run: cd docs && make html

Expand Down
39 changes: 33 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,49 @@
PROJECT_NAME := fracdiff

.PHONY: check
check: test lint

.PHONY: install
install:
@poetry install --extras torch

.PHONY: test
test:
@poetry run pytest --doctest-modules fracdiff
test: test-doctest test-pytest

.PHONY: test-doctest
test-doctest:
@poetry run pytest --doctest-modules $(PROJECT_NAME)

.PHONY: test-pytest
test-pytest:
@poetry run pytest --doctest-modules tests

.PHONY: lint
lint:
@poetry run python3 -m black --check --quiet .
@poetry run python3 -m isort --check --force-single-line-imports --quiet .
lint: lint-black lint-isort

.PHONY: lint-black
lint-black:
@poetry run python3 -m black --check .

.PHONY: lint-isort
lint-isort:
@poetry run python3 -m isort --check --force-single-line-imports .

.PHONY: format
format:
format: format-black format-isort

.PHONY: format-black
format-black:
@poetry run python3 -m black --quiet .

.PHONY: format-isort
format-isort:
@poetry run python3 -m isort --force-single-line-imports --quiet .

.PHONY: doc
doc:
@cd docs && make html

.PHONY: typecheck
@poetry run mypy $(PROJECT_NAME)

Expand Down