-
Notifications
You must be signed in to change notification settings - Fork 18
Modernize: Add pre-commit, ruff linting and formatting, remove python 2 support #35
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 all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
0c9815d
Add pre-commit
jacomago c6d8c39
Add pre-commit to ci
jacomago 8b7a41e
Add pre-commit fixes
jacomago 86e54c0
Add ruff to pre-commit
jacomago e70a2e1
Add ruff auto format and fixes
jacomago 844fd9d
remove python 2 support
jacomago 0b73e3c
Fix F841 ruff lint
jacomago fc600fe
explicit imports
jacomago 89a3970
Fix E711 None comparison ruff lint
jacomago 29bc9a4
explicit exports
jacomago 1759601
Do not use bare except lint
jacomago e55a072
Remove python 2 code in tests
jacomago 98890b4
Update testcontainers version
jacomago 849fde7
Remove commented out code
jacomago d5d04d4
Fix tests
jacomago 08164ef
Allow running actions on push
jacomago d2b4b43
Need build to pass before running tests
jacomago 0a63dba
swap to ubuntu latest
jacomago 11e978b
Fix CFPropertyManger imports
jacomago 2098a2f
Remove commented out code
jacomago dcb548d
Add reasoning for test python versions
jacomago 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 |
|---|---|---|
|
|
@@ -3,21 +3,41 @@ | |
|
|
||
| name: Python package | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "master" ] | ||
| pull_request: | ||
| branches: [ "master" ] | ||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| test: | ||
| pre-commit: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: actions/setup-python@v3 | ||
| - uses: pre-commit/[email protected] | ||
| build: | ||
|
|
||
| runs-on: ubuntu-20.04 | ||
| runs-on: ubuntu-20.04 # 3.6 is not supported by Ubuntu 22.04 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | ||
| python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install . | ||
| test: | ||
|
|
||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] # testcontainers is not supported on <3.9 | ||
| needs: build | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
|
|
@@ -34,4 +54,4 @@ jobs: | |
| run: docker image prune -af | ||
| - name: Test with pytest | ||
| run: | | ||
| python -m unittest discover -v -s test -p "test*.py" | ||
| python -m unittest discover -v -s test -p "test*.py" | ||
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 |
|---|---|---|
|
|
@@ -2,4 +2,4 @@ | |
| *.pyc | ||
| build/ | ||
| *.egg-info/ | ||
| .vscode | ||
| .vscode | ||
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,15 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v4.4.0 | ||
| hooks: | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| # Ruff version. | ||
| rev: v0.9.0 | ||
| hooks: | ||
| # Run the linter. | ||
| - id: ruff | ||
| args: [ --fix ] | ||
| # Run the formatter. | ||
| - id: ruff-format | ||
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.
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.