-
Notifications
You must be signed in to change notification settings - Fork 2
Modernise #2
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
Modernise #2
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c67371e
build: migrate from poetry to uv with hatch build backend
anentropic a0d68c8
chore: update dev tooling and config files
anentropic 4a868bc
refactor: modernize codebase for transformers 5.x and Python 3.10+
anentropic 1c4bb3f
fix: stub is_tf_available in vendored exporters for transformers 5.x
anentropic 47b1395
test: update fixtures and fix roberta model references
anentropic 51e5972
fix: match transformers 5.x attention forward() return signature
anentropic 836812d
ci: add GitHub Actions quality and test workflows
anentropic 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 |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| version: 2 | ||
| updates: | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| groups: | ||
| github-actions: | ||
| patterns: | ||
| - "*" | ||
|
|
||
| - package-ecosystem: "pip" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| groups: | ||
| dev-dependencies: | ||
| dependency-type: "development" |
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,11 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| concurrency: | ||
| group: ci-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| quality: | ||
| uses: ./.github/workflows/quality.yml |
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,70 @@ | ||
| name: Quality | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| quality: | ||
| name: Quality gates | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 10 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: "uv.lock" | ||
| python-version: "3.13" | ||
|
|
||
| - name: Sync dev dependencies | ||
| run: uv sync --only-group dev --locked | ||
|
|
||
| - name: Lint | ||
| run: uv run ruff check hft2ane tests | ||
|
|
||
| - name: Format check | ||
| run: uv run ruff format --check hft2ane tests | ||
|
|
||
| - name: Type check | ||
| run: uv run basedpyright | ||
|
|
||
| - name: Cache pruning | ||
| if: always() | ||
| run: uv cache prune --ci | ||
|
|
||
| tests: | ||
| name: Tests | ||
| runs-on: macos-latest | ||
| timeout-minutes: 15 | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| submodules: true | ||
|
|
||
| - name: Set up uv | ||
| uses: astral-sh/setup-uv@v7 | ||
| with: | ||
| enable-cache: true | ||
| cache-dependency-glob: "uv.lock" | ||
| python-version: "3.13" | ||
|
|
||
| - name: Sync dependencies | ||
| run: uv sync --locked | ||
|
|
||
| - name: Tests | ||
| run: uv run pytest -m "not convert" | ||
|
|
||
| - name: Cache pruning | ||
| if: always() | ||
| run: uv cache prune --ci |
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 |
|---|---|---|
| @@ -1,22 +1,30 @@ | ||
| exclude: ^vendor/ | ||
| repos: | ||
| - repo: https://github.com/charliermarsh/ruff-pre-commit | ||
| rev: 'v0.0.264' | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix] | ||
| exclude: ^vendor/ | ||
| - repo: https://github.com/psf/black | ||
| rev: "23.3.0" | ||
| hooks: | ||
| - id: black | ||
| exclude: ^vendor/ | ||
| - repo: local | ||
| hooks: | ||
| - id: mypy | ||
| name: mypy | ||
| entry: mypy | ||
| args: ["-p", "hft2ane"] | ||
| pass_filenames: false | ||
| language: system | ||
| types: [python] | ||
| require_serial: true | ||
| - repo: builtin | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: end-of-file-fixer | ||
| - id: check-json | ||
| - id: check-toml | ||
| - id: check-yaml | ||
|
|
||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.1 | ||
| hooks: | ||
| - id: ruff | ||
| args: [--fix] | ||
| - id: ruff-format | ||
|
|
||
| - repo: https://github.com/astral-sh/uv-pre-commit | ||
| rev: 0.10.3 | ||
| hooks: | ||
| - id: uv-lock | ||
|
|
||
| - repo: local | ||
| hooks: | ||
| - id: basedpyright | ||
| name: Type checking (basedpyright) | ||
| entry: uv run basedpyright | ||
| language: system | ||
| types: [python] | ||
| 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,14 @@ | ||
| { | ||
| "python.analysis.autoImportCompletions": true, | ||
| "python.testing.pytestArgs": [ | ||
| "tests" | ||
| ], | ||
| "python.testing.pytestArgs": ["tests"], | ||
| "python.testing.unittestEnabled": false, | ||
| "python.testing.pytestEnabled": true | ||
| , | ||
| "files.exclude": { | ||
| "**/__pycache__": true | ||
| }, | ||
| "search.exclude": { | ||
| "**/__pycache__": true | ||
| }, | ||
| "files.watcherExclude": { | ||
| "**/__pycache__": true | ||
| } | ||
| } | ||
| "python.testing.pytestEnabled": true, | ||
| "python.analysis.typeCheckingMode": "standard", | ||
| "python.analysis.extraPaths": [ | ||
| "vendor/ml-ane-transformers", | ||
| "vendor/exporters/src" | ||
| ], | ||
| "files.exclude": { "**/__pycache__": true }, | ||
| "search.exclude": { "**/__pycache__": true, "vendor/**": true }, | ||
| "files.watcherExclude": { "**/__pycache__": 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
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.