Skip to content

Commit

Permalink
Merge branch 'main' into hotfix/ground-base
Browse files Browse the repository at this point in the history
  • Loading branch information
mgcth committed Apr 14, 2024
2 parents a33eb91 + cb38a69 commit 907584d
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 41 deletions.
6 changes: 3 additions & 3 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Changes here will be overwritten by Copier
_commit: 0.1.0
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 0.1.2
_src_path: https://github.com/Ingenjorsarbete-For-Klimatet/ifk-python-template.git
author: Mladen Gibanica
badge_gistid: e2326bc24f74f346a118a97b09e852ec
email: [email protected]
module_name: lantmateriet
package_name: geometry
project_description: Parse data from Lantmäteriet.
project_name: ifk-lantmateriet
badge_gistid: e2326bc24f74f346a118a97b09e852ec
44 changes: 44 additions & 0 deletions .github/workflows/github-action-pypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and publish to PyPi
on:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Build package
run: |
python -m pip install -U pip build
python -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: dist/

pypi--build-publish:
environment: release
permissions:
id-token: write
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]

steps:
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Build
name: Test
on: [push]
jobs:
build:
runs-on: ubuntu-latest
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12"]

steps:
Expand All @@ -15,20 +16,19 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install gdal-bin libgdal-dev
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Test with pytest
run: |
python -m pytest --cov-report term-missing --cov=src tests
coverage json
- name: Export summary stats
if: runner.os != 'Windows' && matrix.python-version == '3.11'
run: |
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
- name: Coverage badge
if: runner.os != 'Windows' && matrix.python-version == '3.11'
uses: schneegans/[email protected]
with:
auth: ${{ secrets.BADGE_SECRET }}
Expand All @@ -38,4 +38,4 @@ jobs:
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}
valColorRange: ${{ env.total }}
34 changes: 5 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<h1 align="center">ifk-lantmateriet</h1>

<p align="center">
<a href="https://github.com/Ingenjorsarbete-For-Klimatet/ifk-lantmateriet/actions/workflows/github-action-build.yaml">
<img src="https://github.com/Ingenjorsarbete-For-Klimatet/ifk-lantmateriet/actions/workflows/github-action-build.yaml/badge.svg?branch=main" alt="build" style="max-width: 100%;">
<a href="https://github.com/Ingenjorsarbete-For-Klimatet/ifk-lantmateriet/actions/workflows/github-action-test.yaml">
<img src="https://github.com/Ingenjorsarbete-For-Klimatet/ifk-lantmateriet/actions/workflows/github-action-test.yaml/badge.svg?branch=main" alt="test" style="max-width: 100%;">
</a>
<a href="https://github.com/Ingenjorsarbete-For-Klimatet/ifk-lantmateriet/actions/workflows/github-action-build.yaml">
<img src="https://img.shields.io/endpoint?logo=github&labelColor=%23333a41&logoColor=%23959da5&url=https://gist.githubusercontent.com/mgcth/955d89d05ed9ca61fb3774bc68bbae33/raw/ifk-lantmateriet-coverage-badge.json" alt="coverage" style="max-width: 100%;">
<a href="https://github.com/Ingenjorsarbete-For-Klimatet/ifk-lantmateriet/actions/workflows/github-action-test.yaml">
<img src="https://img.shields.io/endpoint?logo=github&labelColor=%23333a41&logoColor=%23959da5&url=https://gist.githubusercontent.com/mgcth/e2326bc24f74f346a118a97b09e852ec/raw/ifk-lantmateriet-coverage-badge.json" alt="coverage" style="max-width: 100%;">
</a>
<a href="https://github.com/Ingenjorsarbete-For-Klimatet/ifk-lantmateriet/actions/workflows/github-action-docs.yaml">
<img src="https://github.com/Ingenjorsarbete-For-Klimatet/ifk-lantmateriet/actions/workflows/github-action-docs.yaml/badge.svg?branch=main" alt="docs" style="max-width: 100%;">
Expand Down Expand Up @@ -35,29 +35,5 @@

## Description

Welcome to ifk-lantmateriet.
Welcome to ifk-lantmateriet. This repo contains code to parse data from Lantmäteriet.

## Configuration

When you start a new project, apart from the obvious changes,
there are some details to consider.

- Build workflow, follow the guide in [dynamic badges](https://github.com/Schneegans/dynamic-badges-action).
- To build docs, change `branch` in `github/workflows/github-action-docs.yaml`
from `["SET_TO_MAIN"]` to `["main"]`. You also need to activate Pages under repo
Settings/Pages.

Install `copier` (install `pipx` through `pip`) as

```bash
pipx install copier
```

and then do

```bash
copier copy https://github.com/Ingenjorsarbete-For-Klimatet/ifk-python-template.git /path/to/project-name
```

Copier supports updating projects based on templates when the template updates.
See <a href="https://copier.readthedocs.io/en/stable/" taget="_blank">copier docs</a>.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ authors = [
{ name = "Mladen Gibanica", email = "[email protected]" },
]
requires-python = ">=3.9"
dependencies = ["geopandas ~= 0.14", "pyogrio ~= 0.6.0", "pyarrow ~= 14.0"]
dependencies = ["geopandas ~= 0.14", "pyogrio ~= 0.7.0", "pyarrow ~= 14.0"]

[project.optional-dependencies]
lint = [
"ruff ~= 0.1",
]
type = ["mypy ~= 0.990", "types-requests ~= 2.28", "pandas-stubs ~= 1.5"]
type = ["mypy ~= 1.7", "types-requests ~= 2.28", "pandas-stubs ~= 1.5"]
test = ["pytest ~= 7.1", "coverage ~= 6.5", "pytest-cov ~= 4.0"]
doc = [
"mkdocs ~= 1.4",
Expand Down

0 comments on commit 907584d

Please sign in to comment.