This repository was archived by the owner on Apr 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Update build and deps #143
Merged
+816
−398
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,29 +1,66 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v5.0.0 | ||
- repo: local | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: ruff | ||
name: Format and lint with ruff | ||
entry: ./bin/run-ruff.bash | ||
language: system | ||
types: [python] | ||
pass_filenames: false | ||
verbose: true | ||
- id: mypy | ||
name: Check typing with mypy | ||
entry: ./bin/run-mypy.bash | ||
language: system | ||
types: [python] | ||
pass_filenames: false | ||
verbose: true | ||
- id: pymarkdown | ||
name: Markdownlint | ||
description: Run markdownlint on Markdown files | ||
entry: pymarkdown scan | ||
language: python | ||
files: \.(md|mdown|markdown)$ | ||
exclude: ^.github/pull_request_template.md$ | ||
- id: check-added-large-files | ||
name: Check for added large files | ||
entry: check-added-large-files | ||
language: system | ||
- id: check-toml | ||
name: Check Toml | ||
entry: check-toml | ||
language: system | ||
types: [toml] | ||
- id: check-yaml | ||
name: Check Yaml | ||
entry: check-yaml | ||
language: system | ||
types: [yaml] | ||
- id: mixed-line-ending | ||
name: Check mixed line endings | ||
entry: mixed-line-ending | ||
language: system | ||
types: [text] | ||
stages: [pre-commit, pre-push, manual] | ||
- id: end-of-file-fixer | ||
name: Fix End of Files | ||
entry: end-of-file-fixer | ||
language: system | ||
types: [text] | ||
stages: [pre-commit, pre-push, manual] | ||
- id: trailing-whitespace | ||
name: Trim Trailing Whitespace | ||
entry: trailing-whitespace-fixer | ||
language: system | ||
types: [text] | ||
stages: [pre-commit, pre-push, manual] | ||
- id: check-merge-conflict | ||
name: Check merge conflicts | ||
entry: check-merge-conflict | ||
language: system | ||
- id: no-commit-to-branch | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.7.4 | ||
hooks: | ||
- id: ruff | ||
args: [--fix, --exit-non-zero-on-fix] | ||
- id: ruff-format | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.13.0 | ||
hooks: | ||
- id: mypy | ||
args: [] # override default of [--strict, --ignore-missing-imports] | ||
files: src/ | ||
additional_dependencies: | ||
- types-pyRFC3339~=1.1.1 | ||
- pydantic~=2.10.1 | ||
- returns~=0.23.0 | ||
- fastapi~=0.115.0 | ||
- geojson_pydantic~=1.1.1 | ||
name: Check not committting to main | ||
entry: no-commit-to-branch | ||
language: system | ||
args: ["--branch", "main"] | ||
pass_filenames: false |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
# set -x # print each command before executing | ||
|
||
MYPYPATH=src mypy src/ tests/ |
This file contains hidden or 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,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
# set -x # print each command before executing | ||
|
||
ruff check --fix # lint python files | ||
ruff format # format python files |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know we've liked local pre-commit for dev, but they do not fully play nice with some popular tooling (aka VSCode), so I think it could be easier for new contributers to avoid dealing with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tylanderson Could you give a bit more context on the problems with a local repo for pre-commit? I feel like I've experienced issues with local pre-commit in the past (I also use VSCode), but I haven't had a problem with that in a while, so I'd benefit from a reminder on what they are 🙂 . I do remember problems where the tool versions specified in the pre-commit yaml (via remote repos) were out of sync with the same packages that were in my requirements-dev.txt: I'd end up where formatting with the version of ruff installed in my venv did something different than the version of ruff specified in the pre-commit yaml. I remember this because I still stumble across this problem in repos that do not use a local repo for pre-commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
avoiding having a version difference between the local venv (which is what vscode and I assume other tools use) and the pre-commit env was the intention with this. I haven't had any problems with this approach and VSCode, so also interested to hear about the problems.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pjhartzell I believe this issue tracks the issue I had seen in the past, it's a bit non-obvious from what I remember.
I do agree that the benefit of catching formatting, etc early is nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should document that issue in the README -- I think having a consistent environment that doesn't have to be independently maintained and with possibly different default configuration is worth making it easier to use a single IDE that has broken behavior (at least as I see it).