-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from WorldCereal/openeo-refactor
#17 Setup Github actions
- Loading branch information
Showing
16 changed files
with
510 additions
and
774 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
lint: | ||
name: "Lint: code quality and formatting checks" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repo | ||
uses: actions/checkout@v2 | ||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
cache: 'pip' | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install isort black ruff | ||
- name: isort | ||
run: python -m isort . --check --diff | ||
# - name: black | ||
# run: python -m black --check --diff . | ||
- name: ruff | ||
run: ruff check . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Pytest-collect | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'tests/**' | ||
pull_request: | ||
branches: [ main ] | ||
paths: | ||
- 'tests/**' | ||
|
||
jobs: | ||
pytest-collect: | ||
name: "Pytest: check test collection" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repo | ||
uses: actions/checkout@v2 | ||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.9 | ||
cache: 'pip' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install pytest | ||
python -m pip install .[dev] | ||
- name: "pytest: check test collection" | ||
run: pytest --collect-only |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# https://pre-commit.com | ||
default_language_version: | ||
python: python3.10 | ||
default_stages: [commit, manual] | ||
fail_fast: true | ||
exclude: "(received/|.*_depr)" | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
# - id: check-added-large-files | ||
# args: ['--maxkb=65536'] | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-byte-order-marker | ||
- id: check-case-conflict | ||
- id: check-docstring-first | ||
- id: check-json | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: check-toml | ||
- id: check-vcs-permalinks | ||
- id: check-xml | ||
- id: check-yaml | ||
args: [--allow-multiple-documents] | ||
- id: debug-statements | ||
- id: detect-private-key | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
types: [python] | ||
- id: end-of-file-fixer | ||
types: [python] | ||
- repo: local | ||
hooks: | ||
- id: shellcheck | ||
name: shellcheck | ||
entry: shellcheck --check-sourced --shell=bash --exclude=SC1087 | ||
language: system | ||
types: [shell] | ||
# - id: pydocstyle | ||
# name: pydocstyle | ||
# entry: pydocstyle | ||
# language: system | ||
# types: [python] | ||
# exclude: "(^experiments/|.*_depr)" | ||
# - id: flake8 | ||
# name: flake8 | ||
# entry: flake8 | ||
# language: system | ||
# types: [python] | ||
# exclude: "(^tasks/|.*_depr)" | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: no-commit-to-branch | ||
args: [ '--branch', 'main' ] | ||
- repo: https://github.com/radix-ai/auto-smart-commit | ||
rev: v1.0.3 | ||
hooks: | ||
- id: auto-smart-commit | ||
- repo: https://github.com/psf/black | ||
rev: 23.10.0 | ||
hooks: | ||
- id: black | ||
language_version: python3.9 | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
args: ["--profile", "black"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
[build-system] | ||
requires = ["hatchling"] | ||
build-backend = "hatchling.build" | ||
|
||
[tool.hatch.build.targets.sdist] | ||
exclude = [ | ||
"/dist", | ||
"/notebooks", | ||
"/scripts", | ||
"/bin", | ||
"/tests", | ||
] | ||
|
||
[project] | ||
name = "worldcereal" | ||
version = "2.0.1" | ||
authors = [ | ||
{ name="Kristof Van Tricht" }, | ||
{ name="Jeroen Degerickx" }, | ||
{ name="Darius Couchard" }, | ||
{ name="Christina Butsko" }, | ||
] | ||
description = "WorldCereal classification module" | ||
readme = "README.md" | ||
requires-python = ">=3.9" | ||
classifiers = [ | ||
"Programming Language :: Python :: 3", | ||
"Operating System :: OS Independent", | ||
] | ||
dependencies = [ | ||
"openeo>=0.22.0", | ||
"xarray>=2022.3.0", | ||
"rioxarray>=0.13.0", | ||
"loguru>=0.7.2", | ||
"h5netcdf>=1.2.0", | ||
"openeo[localprocessing]", | ||
"cftime", | ||
"pytest-depends", | ||
"pyarrow", | ||
"pandas"] | ||
|
||
[project.urls] | ||
"Homepage" = "https://github.com/WorldCereal/worldcereal-classification" | ||
"Bug Tracker" = "https://github.com/WorldCereal/worldcereal-classification/issues" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"pytest>=7.4.0", | ||
"matplotlib>=3.3.0" | ||
] | ||
|
||
[tool.pytest.ini_options] | ||
testpaths = [ | ||
"tests", | ||
] | ||
addopts = [ | ||
"--import-mode=prepend", | ||
] | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
|
||
[tool.ruff] | ||
# line-length = 100 | ||
|
||
[tool.ruff.lint] | ||
select = ["E", "F"] | ||
ignore = [ | ||
"E501", # Ignore "line-too-long" issues, let black handle that. | ||
] |
Oops, something went wrong.