-
Notifications
You must be signed in to change notification settings - Fork 0
feat: use uv as package manager, ruff added, github actions added #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
Changes from all commits
Commits
Show all changes
2 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 |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Python CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["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 uv | ||
| uses: astral-sh/setup-uv@v4 | ||
| with: | ||
| enable-cache: true | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --all-extras | ||
|
|
||
| - name: Run linting | ||
| run: uv run ruff check . | ||
|
|
||
| - name: Run tests | ||
| run: uv run pytest |
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,37 @@ | ||
| name: Python Deployment | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - '*' | ||
|
|
||
| jobs: | ||
| deploy: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ["3.12"] | ||
| 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 uv | ||
| uses: astral-sh/setup-uv@v4 | ||
|
|
||
| - name: Install dependencies | ||
| run: uv sync --all-extras | ||
|
|
||
| - name: Run tests | ||
| run: uv run pytest | ||
|
|
||
| - name: Build package | ||
| run: uv build | ||
|
|
||
| - name: Publish to PyPI | ||
| run: uv publish | ||
| env: | ||
| UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }} | ||
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,23 @@ | ||
| name: Close inactive issues | ||
| on: | ||
| schedule: | ||
| - cron: "30 1 * * *" | ||
|
|
||
| jobs: | ||
| close-issues: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| issues: write | ||
| pull-requests: write | ||
| steps: | ||
| - uses: actions/stale@v5 | ||
| with: | ||
| days-before-issue-stale: 365 | ||
| days-before-issue-close: 14 | ||
| exempt-issue-labels: "pinned, security" | ||
| stale-issue-label: "stale" | ||
| stale-issue-message: "This issue is stale because it has been open for a year with no activity. It will be closed if no further activity occurs. Thank you for your contributions." | ||
| close-issue-message: "This issue was closed because it has been inactive for 14 days since being marked as stale. Feel free to re-open it if it is still relevant." | ||
| days-before-pr-stale: -1 | ||
| days-before-pr-close: -1 | ||
| repo-token: ${{ secrets.GITHUB_TOKEN }} |
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 |
|---|---|---|
|
|
@@ -27,6 +27,11 @@ coverage | |
| *.sln | ||
| *.sw? | ||
|
|
||
| .serena/ | ||
| # VSCode | ||
| .history | ||
| __pycache__ | ||
|
|
||
| debug.py | ||
| .serena/ | ||
| plans/ | ||
| .venv/ | ||
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,46 @@ | ||
| # Ruff configuration file | ||
|
|
||
| # Exclude a variety of commonly ignored directories. | ||
| extend-exclude = [ | ||
| "__pycache__", | ||
| ".git", | ||
| ".venv", | ||
| ".eggs", | ||
| ".nox", | ||
| ".tox", | ||
| ".svn", | ||
| ".hg", | ||
| "build", | ||
| "dist", | ||
| ".mypy_cache", | ||
| ".pytest_cache", | ||
| ] | ||
|
|
||
| # Assume Python 3.10. | ||
| target-version = "py310" | ||
|
|
||
| # Line length with preview to format | ||
| line-length = 120 | ||
| preview = true | ||
|
|
||
| [lint] | ||
| # Enable flake8-bugbear rules | ||
| select = [ | ||
| "E", # pycodestyle errors | ||
| "W", # pycodestyle warnings | ||
| "F", # pyflakes | ||
| "B", # flake8-bugbear | ||
| "C4", # flake8-comprehensions | ||
| "UP", # pyupgrade | ||
| "SIM", # flake8-simplify | ||
| ] | ||
|
|
||
| # Allow autofix for all enabled rules (when `--fix`) is provided. | ||
| fixable = ["ALL"] | ||
|
|
||
| # Ignore B008 for Typer - typer.Option in argument defaults is standard Typer practice | ||
| # Ignore E501 - long lines in help text are acceptable | ||
| ignore = ["B008", "E501"] | ||
|
|
||
| # Allow unused variables when underscore-prefixed. | ||
| dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" |
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,17 +1,28 @@ | ||
| install: | ||
| uv sync | ||
| uv sync --all-extras | ||
|
|
||
| test: | ||
| uv run pytest | ||
| uv run --all-extras pytest | ||
|
|
||
| lint: | ||
| uv run ruff check . | ||
|
|
||
| fix: | ||
| uv run ruff check . --fix | ||
|
|
||
| format: | ||
| uv run ruff format . | ||
|
|
||
| check: format fix | ||
|
|
||
| build: | ||
| uv build | ||
|
|
||
| publish: | ||
| uv publish | ||
|
|
||
| clean: | ||
| rm -rf dist | ||
|
|
||
| local-install: | ||
| local-install: clean build | ||
| pip install ./dist/datashield-*.tar.gz | ||
|
|
||
| local-install-force: clean build | ||
| pip install ./dist/datashield-*.tar.gz --break-system-packages |
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,2 +1,7 @@ | ||
| from datashield.interface import DSConnection, DSLoginInfo, DSDriver, DSError | ||
| from datashield.api import DSLoginBuilder, DSSession | ||
| from datashield.interface import ( | ||
| DSConnection as DSConnection, | ||
| DSLoginInfo as DSLoginInfo, | ||
| DSDriver as DSDriver, | ||
| DSError as DSError, | ||
| ) | ||
| from datashield.api import DSLoginBuilder as DSLoginBuilder, DSSession as DSSession |
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.