Skip to content

Commit

Permalink
Merge pull request #1 from earthobservations/dev
Browse files Browse the repository at this point in the history
Add first version of quadrantic
  • Loading branch information
gutzbenj authored Sep 25, 2022
2 parents 8792866 + 95d062a commit 7f8b8ac
Show file tree
Hide file tree
Showing 18 changed files with 2,008 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms
github: ["gutzbenj"]
patreon: "earthobservations"
custom: ['paypal.me/BenjaminGutzmann']
9 changes: 9 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
coverage:
status:
project:
default:
target: 75%

patch:
default:
target: 75%
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
versioning-strategy: lockfile-only
57 changes: 57 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Coverage
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
run:
runs-on: ubuntu-latest
name: Check code coverage
steps:
- name: Acquire sources
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: x64

- name: Setup Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Get Poetry cache directory
id: poetry-cache-dir
run: |
echo "::set-output name=dir::$(poetry config cache-dir)"
- name: Apply cache
id: poetry-cache-flag
uses: actions/cache@v2
env:
# Increase this value to reset cache if `poetry.lock` has not changed.
CACHE_NUMBER: 1
with:
path: ${{ steps.poetry-cache-dir.outputs.dir }}
key: poetry-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}-${{ env.CACHE_NUMBER }}

- name: Install library
run: poetry install

- name: Generate coverage report
run: |
poetry run pytest --cov=quadrantic tests/
poetry run coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
env_vars: OS,PYTHON
name: codecov-umbrella
fail_ci_if_error: false
45 changes: 45 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Linter
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
run:
runs-on: ubuntu-latest
name: Code style checks
steps:
- name: Acquire sources
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: x64

- name: Setup Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Get Poetry cache directory
id: poetry-cache-dir
run: |
echo "::set-output name=dir::$(poetry config cache-dir)"
- name: Apply cache
id: poetry-cache-flag
uses: actions/cache@v2
env:
# Increase this value to reset cache if `poetry.lock` has not changed.
CACHE_NUMBER: 1
with:
path: ${{ steps.poetry-cache-dir.outputs.dir }}
key: poetry-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}-${{ env.CACHE_NUMBER }}

- name: Install library
run: poetry install --no-root

- name: Run lint on code
run: poetry run poe lint
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release
on:
release:
types: [ published ]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: "3.10"
architecture: x64

- name: Setup Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Get Poetry cache directory
id: poetry-cache-dir
run: |
echo "::set-output name=dir::$(poetry config cache-dir)"
- name: Apply cache
id: poetry-cache-flag
uses: actions/cache@v2
env:
# Increase this value to reset cache if `poetry.lock` has not changed.
CACHE_NUMBER: 1
with:
path: ${{ steps.poetry-cache-dir.outputs.dir }}
key: poetry-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}-${{ env.CACHE_NUMBER }}

- name: Install library
run: poetry install

- name: Build
run: poetry build

- name: Publish
run: poetry publish --username=__token__ --password=${{ secrets.PYPI_TOKEN }}
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python-version }}

defaults:
run:
shell: bash

name: Python ${{ matrix.python-version }} on OS ${{ matrix.os }}
steps:

- name: Acquire sources
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Setup Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Apply cache
id: poetry-cache-flag
uses: actions/cache@v2
env:
# Increase this value to reset cache if `poetry.lock` has not changed.
CACHE_NUMBER: 2
with:
path: .venv
key: poetry-${{ runner.os }}-py${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}-${{ env.CACHE_NUMBER }}

- name: Install dependencies
run: poetry install
if: steps.poetry-cache-flag.outputs.cache-hit != 'true'

- name: Test
run: poetry run poe test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/.idea
/.pytest_cache

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 earthobservations
Copyright (C) 2022 earthobservations

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 0 additions & 2 deletions README.md

This file was deleted.

Loading

0 comments on commit 7f8b8ac

Please sign in to comment.