-
Notifications
You must be signed in to change notification settings - Fork 1
Consolidate Instrument Protocols #128
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ed87adf
Add code quality scripts and update workflow
Benjamin-Nussbaum ece9077
Consolidate instrument protocols
Benjamin-Nussbaum 0775317
Make Client context manager async
Benjamin-Nussbaum fecc67d
Add instrument client dependency
Benjamin-Nussbaum 092bfc8
Bump numpy version to 2.0 now supported by swabian
Benjamin-Nussbaum f2227dd
Use uv build system
Benjamin-Nussbaum 577a045
Fix and update
Benjamin-Nussbaum 7d74930
Add timeout_ms parameter to Client.get_device()
Benjamin-Nussbaum 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,49 +1,65 @@ | ||
| name: Code quality | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| lockfile: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| - run: uv lock --locked | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| needs: [lockfile] | ||
| needs: lockfile | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| - run: uv run ruff check | ||
| format: | ||
| runs-on: ubuntu-latest | ||
| needs: [lockfile] | ||
| needs: lockfile | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| - run: uv sync --locked --all-extras --dev | ||
| - run: uv run ruff format --check | ||
| typecheck: | ||
| runs-on: ubuntu-latest | ||
| needs: [lockfile] | ||
| needs: lockfile | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v4 | ||
| - run: uv sync --extra webapp | ||
| - uses: actions/checkout@v5 | ||
| - uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| - run: uv sync --locked --all-extras --dev | ||
| - run: uv run mypy | ||
| tests: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| needs: [lockfile] | ||
| needs: lockfile | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v4 | ||
| - run: uv run pytest -v --durations=0 | ||
| - uses: actions/checkout@v5 | ||
| - uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| - run: uv run scripts/test | ||
| build: | ||
| runs-on: [ubuntu-latest] | ||
| needs: [lint, format, typecheck, tests] | ||
| runs-on: ubuntu-latest | ||
| needs: [lint, format, typecheck, test] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v4 | ||
| - uses: actions/checkout@v5 | ||
| - uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| - run: uv build |
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,6 +1,6 @@ | ||
| [build-system] | ||
| requires = ["hatchling"] | ||
| build-backend = "hatchling.build" | ||
| requires = ["uv_build"] | ||
| build-backend = "uv_build" | ||
|
|
||
|
|
||
| [project] | ||
|
|
@@ -16,7 +16,7 @@ authors = [ | |
| { name = "Soroush Hoseini", email = "[email protected]" }, | ||
| ] | ||
| dependencies = [ | ||
| "numpy<2.0", | ||
| "numpy>=2.3.5", | ||
| "pyfirmata2>=2.5.0", | ||
| "pyzmq>=26.2.0", | ||
| "thorlabs-apt-device>=0.3.8", | ||
|
|
@@ -34,11 +34,11 @@ webapp = [ | |
| ] | ||
|
|
||
| [dependency-groups] | ||
| dev = ["mypy>=1.13.0", "pytest-cov>=6.0.0", "ruff>=0.8.0"] | ||
| dev = ["hypothesis", "mypy", "coverage", "pytest-randomly", "ruff"] | ||
|
|
||
|
|
||
| [tool.mypy] | ||
| files = ["src"] | ||
| files = ["src/**/*.py"] | ||
| strict = true | ||
| pretty = true | ||
|
|
||
|
|
@@ -76,8 +76,6 @@ extend-ignore = [ | |
| "ISC001", | ||
| "ISC002", | ||
| "E501", | ||
| "S101", # Assert | ||
| "S311", # We know its not secure | ||
| ] | ||
|
|
||
| [tool.ruff.lint.extend-per-file-ignores] | ||
|
|
@@ -95,5 +93,15 @@ force-single-line = true | |
| [tool.ruff.lint.pydocstyle] | ||
| convention = "numpy" # One of: "google" | "numpy" | "pep257" | ||
|
|
||
| [tool.uv.sources] | ||
| TimeTagger = { path = "/usr/lib/python3/dist-packages" } | ||
|
|
||
| [tool.coverage.run] | ||
| # source = ["app"] | ||
| dynamic_context = "test_function" | ||
|
|
||
| [tool.coverage.report] | ||
| show_missing = true | ||
| skip_empty = true | ||
| sort = "-Cover" | ||
|
|
||
| [tool.coverage.html] | ||
| show_contexts = true | ||
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,5 @@ | ||
| #!/usr/bin/env bash | ||
| set -eux | ||
|
|
||
| ruff format src | ||
| ruff check src --fix |
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 -eux | ||
|
|
||
| mypy | ||
| ruff format src --check | ||
| ruff check src |
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 -eux | ||
|
|
||
| coverage run -m pytest | ||
| coverage report | ||
| coverage html --title "${@-coverage}" |
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.