Skip to content

Commit

Permalink
use pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenpawley committed Sep 8, 2024
1 parent 7fb639e commit 422a385
Show file tree
Hide file tree
Showing 74 changed files with 12,465 additions and 16,219 deletions.
83 changes: 38 additions & 45 deletions .github/workflows/publish-quarto.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,39 @@
name: Quarto Publish

on: [push]

jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install system dependencies
run : |
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libudunits2-dev libgdal-dev libcurl4-openssl-dev
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'

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

- name: Install the project
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: |
poetry install --no-interaction --no-root
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
name: Quarto Publish

on: [push]

jobs:
build-deploy:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Install system dependencies
run : |
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install libudunits2-dev libgdal-dev libcurl4-openssl-dev
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r <(python -c 'import toml; print("\n".join(toml.load("pyproject.toml")["project"]["dependencies"]))')
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- name: Render and Publish
uses: quarto-dev/quarto-actions/publish@v2
with:
target: gh-pages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99 changes: 41 additions & 58 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,42 @@
name: Pytest

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10', 3.11, 3.12]

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update -y
sudo apt-get install gdal-bin libproj-dev libgdal-dev proj-bin
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Install package dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root

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

# - name: Lint with flake8
# run: |
# source .venv/bin/activate
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics

- name: Test with pytest
run: |
poetry run pytest --cov-report=xml --cov=.
- name: "Upload Report to Codecov"
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml
name: Pytest

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9, '3.10', 3.11, 3.12]

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system dependencies
run: |
sudo apt-get update -y
sudo apt-get install gdal-bin libproj-dev libgdal-dev proj-bin
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r <(python -c 'import toml; print("\n".join(toml.load("pyproject.toml")["project"]["dependencies"]))')
- name: Test with pytest
run: |
poetry run pytest --cov-report=xml --cov=.
- name: "Upload Report to Codecov"
uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./coverage.xml
fail_ci_if_error: true
31 changes: 16 additions & 15 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
.DS_Store
.eggs/
.idea/
.vscode/
.pytest_cache/
*__pycache__/
build/
*egg*
*whl
*.tar.gz
**/*.ipynb_checkpoints/

/.quarto/
_site/
site/
.DS_Store
.eggs/
.idea/
.vscode/
.pytest_cache/
*__pycache__/
build/
*egg*
*whl
*.tar.gz
**/*.ipynb_checkpoints/
.conda/

/.quarto/
_site/
site/
32 changes: 16 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: double-quote-string-fixer

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
name: black (python)
language_version: python3.11
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: double-quote-string-fixer

- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
name: black (python)
language_version: python3.11
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11.9
3.11.9
Loading

0 comments on commit 422a385

Please sign in to comment.