-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add pre commit CI * cache pre-commit venvs + dependabot * update pre commit invocation https://tobiasmcnulty.com/posts/caching-pre-commit/ * add pre-commit as dev dependency
- Loading branch information
1 parent
a15cd15
commit 9357716
Showing
7 changed files
with
245 additions
and
5 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,12 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: npm | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: weekly | ||
open-pull-requests-limit: 10 |
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,64 @@ | ||
name: Python test | ||
|
||
# On every pull request, but only on push to master | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8, 3.9, "3.10", "3.11"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
id: setup-python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install and configure Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
version: 1.6.1 | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
|
||
- name: Install root project | ||
run: poetry install --no-interaction | ||
|
||
# - name: Run tests | ||
# run: pytest | ||
|
||
- name: Cache pre-commit virtualenvs | ||
uses: actions/cache@v3 | ||
if: matrix.python-version == 3.9 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-3|${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
# TODO: switch this to run on e.g. 3.11 (how to get the if statement to | ||
# work?) | ||
# Run pre-commit (only for python-3.9) | ||
- name: run pre-commit | ||
if: matrix.python-version == 3.9 | ||
run: | | ||
poetry run pre-commit run --show-diff-on-failure --color=always --all-files |
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,34 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
|
||
# Default to Python 3 | ||
default_language_version: | ||
python: python3 | ||
|
||
# Optionally both commit and push | ||
default_stages: [commit] | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.4.0 | ||
hooks: | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
- id: check-added-large-files | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
language_version: python3 | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.0.291 | ||
hooks: | ||
- id: ruff |
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 |
---|---|---|
|
@@ -15,4 +15,3 @@ npm install esbuild | |
npm run build | ||
poetry install | ||
``` | ||
|
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 |
---|---|---|
@@ -1 +1 @@ | ||
from .widget import PointLayer, LineStringLayer, PolygonLayer | ||
from .widget import LineStringLayer, PointLayer, PolygonLayer |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ version = "0.1.0" | |
description = "Extremely fast geospatial data visualization in Python." | ||
authors = ["Kyle Barron <[email protected]>"] | ||
readme = "README.md" | ||
packages = [{include = "lonboard"}] | ||
packages = [{ include = "lonboard" }] | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.8" | ||
|
@@ -18,11 +18,22 @@ comm = "^0.1.4" | |
|
||
|
||
[tool.poetry.group.dev.dependencies] | ||
anywidget = {version = "^0.6.3", extras = ["dev"]} | ||
anywidget = { version = "^0.6.3", extras = ["dev"] } | ||
jupyterlab = "^4.0.5" | ||
watchfiles = "^0.20.0" | ||
pre-commit = "^3.4.0" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.isort] | ||
profile = "black" | ||
|
||
[tool.ruff] | ||
|
||
[tool.ruff.extend-per-file-ignores] | ||
"__init__.py" = [ | ||
"F401", # Allow unused imports in __init__.py files | ||
] |