Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #107

Merged
merged 5 commits into from
Aug 18, 2024
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
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ indent_size = unset
[*.{yml,yaml,js,json,sh}]
indent_style = space
indent_size = 2

[Makefile]
indent_style = tab
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.5
rev: v0.5.7
hooks:
- id: ruff
args:
Expand Down
78 changes: 78 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
.PHONY: .pdm ## Check that PDM is installed
.pdm:
@pdm -V || echo 'Please install PDM: https://pdm.fming.dev/latest/#installation'

.PHONY: .pre-commit ## Check that pre-commit is installed
.pre-commit:
@pdm run pre-commit -V || echo 'Please install pre-commit: https://pre-commit.com/'

.PHONY: install ## Install the package, dependencies, and pre-commit for local development
install:
./scripts/install-dev.sh

.PHONY: refresh-lockfiles ## Sync lockfiles with requirements files.
refresh-lockfiles: .pdm
pdm update --update-reuse --group :all

.PHONY: rebuild-lockfiles ## Rebuild lockfiles from scratch, updating all dependencies
rebuild-lockfiles: .pdm
pdm update --update-eager --group :all

.PHONY: format ## Auto-format python source files
format: .pdm
./scripts/format.sh

.PHONY: lint ## Lint python source files
lint: .pdm
./scripts/lint.sh

.PHONY: test ## Run all tests
test: .pdm
./scripts/test.sh "Develop"

.PHONY: codespell ## Use Codespell to do spellchecking
codespell: .pre-commit
pdm run pre-commit run codespell --all-files

.PHONY: testcov ## Run tests and generate a coverage report
testcov: test
@echo "building coverage html"
@pdm run coverage html
@echo "building coverage lcov"
@pdm run coverage lcov

.PHONY: update-branches ## Update local git branches after successful PR to develop or main branches
update-branches:
./scripts/update-branches.sh

.PHONY: clean ## Clear local caches and build artifacts
clean:
rm -rf `find . -name __pycache__`
rm -f `find . -type f -name '*.py[co]'`
rm -f `find . -type f -name '*~'`
rm -f `find . -type f -name '.*~'`
rm -rf .pdm-build
rm -rf .mypy_cache
rm -rf .cache
rm -rf .pytest_cache
rm -rf .ruff_cache
rm -rf htmlcov
rm -rf *.egg-info
rm -f .coverage
rm -f .coverage.*
rm -rf build
rm -rf dist
rm -rf site
rm -rf docs/_build
rm -rf coverage.xml

.PHONY: docs ## Generate the docs
docs:
pdm run mkdocs build --strict

.PHONY: help ## Display this message
help:
@grep -E \
'^.PHONY: .*?## .*$$' $(MAKEFILE_LIST) | \
sort | \
awk 'BEGIN {FS = ".PHONY: |## "}; {printf "\033[36m%-19s\033[0m %s\n", $$2, $$3}'
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

<p align="center">
<img src="https://github.com/siapy/siapy-lib/blob/main/docs/logo.png?raw=true" alt="Sublime's custom image" width="300"/>
<img src="https://github.com/siapy/siapy-lib/blob/main/docs/images/logo.png?raw=true" alt="Sublime's custom image" width="300"/>
</p>

<p align="center">
Expand All @@ -24,13 +23,13 @@

---

**Source Code**: <a href="https://github.com/siapy/siapy-lib" target="_blank">https://github.com/siapy/siapy-lib</a>
__Source Code__: https://github.com/siapy/siapy-lib

**Bug Report / Feature Request**: <a href="https://github.com/siapy/siapy-lib/issues/new/choose" target="_blank">https://github.com/siapy/siapy-lib/issues/new/choose</a>
__Bug Report / Feature Request__: https://github.com/siapy/siapy-lib/issues/new/choose

<!-- **Tutorials**: <a href="https://github.com/Agricultural-institute/SiaPy/tree/master/tutorials" target="_blank">https://github.com/Agricultural-institute/SiaPy/tree/master/tutorials</a> -->

**Documentation**: <a href="https://github.com/siapy/siapy-lib/tree/main/docs" target="_blank">https://github.com/siapy/siapy-lib/tree/main/docs</a>
__Documentation__: https://github.com/siapy/siapy-lib/tree/main/docs

---

Expand Down
File renamed without changes
7 changes: 7 additions & 0 deletions scripts/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash

set -e
set -x

pdm run ruff check siapy tests scripts --fix
pdm run ruff format siapy tests
1 change: 1 addition & 0 deletions scripts/install-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ curl -sSL https://pdm-project.org/install-pdm.py | python3 -
pdm install

# Install pre-commit
pdm run pre-commit uninstall
pdm run pre-commit install --hook-type commit-msg
Loading