Skip to content

Commit

Permalink
CI: use pre-commit github action instead of custom workflow (#73)
Browse files Browse the repository at this point in the history
* CI: use pre-commit github action instead of custom workflow

* fix url to flake8

* update dependencies

* apply black formatting

* remove pr trigger
  • Loading branch information
fgebhart committed Mar 27, 2023
1 parent 8ae842a commit f044a2a
Show file tree
Hide file tree
Showing 7 changed files with 1,208 additions and 1,155 deletions.
26 changes: 4 additions & 22 deletions .github/workflows/format.yml
Expand Up @@ -7,27 +7,9 @@ on:
- "**.py"

jobs:
formatting:
name: Format
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: black
run: |
python -m pip install --upgrade pip
pip install black==22.3.0
black --check .
- name: flake8
if: always()
run: |
pip install flake8==4.0.1
flake8 .
- name: isort
if: always()
run: |
pip install isort==5.10.1
isort . --check-only --recursive
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.0
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
@@ -1,25 +1,25 @@
repos:

- repo: https://github.com/psf/black
rev: 22.3.0
rev: 23.1.0
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
rev: v4.4.0
hooks:
- id: check-ast
- id: check-merge-conflict
- id: check-yaml
- id: end-of-file-fixer
types: [python]

- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort
1 change: 0 additions & 1 deletion mapa/__init__.py
Expand Up @@ -82,7 +82,6 @@ def convert_tiff_to_stl(
z_scale: float,
ensure_squared: bool = False,
) -> Path:

output_file = verify_input_and_output_are_valid(input=input_file, output=output_file)

tiff = rio.open(input_file)
Expand Down
1 change: 0 additions & 1 deletion mapa/algorithm.py
Expand Up @@ -449,7 +449,6 @@ def compute_all_triangles(
z_scale: float,
elevation_scale: float,
) -> np.ndarray:

max_x, max_y = array.shape

log.debug("🗺 creating base raster for tiff...")
Expand Down
1 change: 0 additions & 1 deletion mapa/tiling.py
Expand Up @@ -11,7 +11,6 @@ class TileFormat:


def split_array_into_tiles(array: np.ndarray, tiles_format: TileFormat) -> List[np.ndarray]:

x, y = array.shape
if tiles_format.x > x or tiles_format.y > y:
raise ValueError("Input array is too small to be split into tiles.")
Expand Down
2,314 changes: 1,194 additions & 1,120 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions pyproject.toml
Expand Up @@ -16,7 +16,7 @@ classifiers = [
]

[tool.poetry.dependencies]
python = ">=3.8,<3.11"
python = ">=3.8.1,<3.11"
click = "^8.0.3"
numpy = "^1.21"
numba = "^0.55.1"
Expand All @@ -32,10 +32,10 @@ geojson = "^2.5.0"
pytest = "^7.0.0"
ipython = "^8.10.0"
ipdb = "^0.13.9"
flake8 = "^4.0.1"
black = "^22.3.0"
isort = "^5.10.1"
pre-commit = "^2.17.0"
flake8 = "^6.0.0"
black = "^23.1.0"
isort = "^5.12.0"
pre-commit = "^3.2.1"

[tool.poetry.scripts]
dem2stl = "mapa.cli:dem2stl"
Expand Down

0 comments on commit f044a2a

Please sign in to comment.