-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run doctests in pytest. Add linters to pre-commit. Add a pre-commit workflow. #96
Merged
aliddell
merged 28 commits into
acquire-project:main
from
aliddell:92-run-tests-on-documented-examples
Dec 13, 2023
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
9774ec4
add test_docs.py
aliddell 0013842
doctest all python files
aliddell f8b98fa
add pre-commit.yml
aliddell 9035cba
always_run: false, types are markdown, text, and python
aliddell 82e293f
.md/.py
aliddell f13049a
remove doctest from pyproject.toml (part of the standard library �)
aliddell 0d00968
check rust files in doctests
aliddell 03245c8
Install dependencies for pre-commit workflow
aliddell cf6ee4d
don't forget test_rust_sources
aliddell edd81ab
reformat test_spinnaker.py
aliddell 0961751
add ruff and cargo-fmt to pre-commit
aliddell 39d81fe
remove 'triggered' label from 'Finite triggered acquisition'
aliddell 5f1452e
install ruff with testing dependencies
aliddell 8b4f482
wip
aliddell a9c8135
wip
aliddell 5690cd7
wip
aliddell 419b48d
skip .pyi files when ruff linting
aliddell 07a3fcb
permit from acquire import * in __init__.py, instruct ruff to ignore it.
aliddell 199ccb0
Update doctest name
aliddell b6fbf45
update submodules
aliddell 565c78e
Remove doctests from pre-commit. Add them to test_pr.yml. Check .pyi …
aliddell f74b2bc
Revert "update submodules"
aliddell e0ef3b3
Merge remote-tracking branch 'upstream/main' into 92-run-tests-on-doc…
aliddell e6fced1
Cargo format.
aliddell dfbfaab
Update ruff config to ignore __init__.py (from .acquire import *) is …
aliddell afcfa05
Fix pyi files to make ruff happy.
aliddell f3b6a43
Update pre-commit job name.
aliddell a5c0718
Remove test_docs.py. Update `add_opts` entry in pytest config. Trunca…
aliddell 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 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,27 @@ | ||
name: Run pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e '.[testing]' | ||
|
||
- name: Run pre-commit | ||
uses: pre-commit/action@v3.0.0 |
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
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
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,23 +1,37 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
- repo: https://github.com/psf/black | ||
rev: 22.6.0 | ||
hooks: | ||
- id: black | ||
pass_filenames: true | ||
- repo: https://github.com/PyCQA/flake8 | ||
- id: black | ||
pass_filenames: true | ||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 5.0.4 | ||
hooks: | ||
- id: flake8 | ||
additional_dependencies: [flake8-typing-imports] | ||
pass_filenames: true | ||
exclude: __init__.py | ||
- repo: https://github.com/asottile/pyupgrade | ||
- id: flake8 | ||
additional_dependencies: [ flake8-typing-imports ] | ||
pass_filenames: true | ||
exclude: __init__.py | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v2.37.3 | ||
hooks: | ||
- id: pyupgrade | ||
args: ["--py38-plus", "--keep-runtime-typing"] | ||
- repo: https://github.com/seddonym/import-linter | ||
- id: pyupgrade | ||
args: [ "--py38-plus", "--keep-runtime-typing" ] | ||
- repo: https://github.com/seddonym/import-linter | ||
rev: v1.2.7 | ||
hooks: | ||
- id: import-linter | ||
stages: [manual] | ||
- id: import-linter | ||
stages: [ manual ] | ||
- repo: local | ||
hooks: | ||
- id: ruff | ||
name: Lint Python files | ||
entry: python -m ruff check . | ||
language: system | ||
types: [ file ] | ||
files: \.py$ | ||
- id: cargo-fmt | ||
name: Format Rust files | ||
entry: cargo fmt --all -- --check | ||
language: system | ||
types: [ file ] | ||
files: \.rs$ |
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
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
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
Oops, something went wrong.
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'm OK to start with these excludes and ignores, though I'd prefer to have none of them in the long term.