-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tox configuration and remove pre_push.py
- Loading branch information
Showing
8 changed files
with
731 additions
and
157 deletions.
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 |
---|---|---|
@@ -1,10 +1,42 @@ | ||
concurrency: | ||
group: check-${{ github.ref }} | ||
cancel-in-progress: true | ||
jobs: | ||
ci: | ||
name: CI | ||
secrets: inherit | ||
uses: praw-dev/.github/.github/workflows/ci.yml@main | ||
with: | ||
package: prawcore | ||
test: | ||
name: test with ${{ matrix.env }} on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
env: | ||
- "3.9" | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
- "3.13" | ||
include: | ||
- env: "3.9" | ||
version: macos-latest | ||
- env: "3.9" | ||
version: windows-latest | ||
os: | ||
- ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install the latest version of uv | ||
uses: astral-sh/setup-uv@v5 | ||
- name: Install tox | ||
run: uv tool install --python-preference only-managed --python ${{ matrix.env }} tox --with tox-uv | ||
- name: Run test suite | ||
run: | | ||
tox run --skip-pkg-install -e ${{ fromJson('{ "3.9": "py39", "3.10": "py310", "3.11": "py311", "3.12": "py312", "3.13": "py313", }')[matrix.env] }} | ||
- name: Run lint tests | ||
if: matrix.env == '3.9' | ||
run: tox run --skip-pkg-install --skip-env py | ||
|
||
name: CI | ||
on: [ pull_request, push ] | ||
permissions: read-all | ||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: ["main"] | ||
pull_request: |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,6 +2,25 @@ | |
build-backend = "flit_core.buildapi" | ||
requires = ["flit_core >=3.4,<4"] | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"tox-uv>=1.22.1" | ||
] | ||
lint = [ | ||
"pre-commit", | ||
"ruff>=0.9.5" | ||
] | ||
test = [ | ||
"betamax >=0.8, <0.9", | ||
"coverage>=7.6.10", | ||
"pytest>=8.3.4", | ||
"urllib3 ==1.*" | ||
] | ||
type = [ | ||
"pyright>=1.1.393", | ||
"pytest>=8.3.4" | ||
] | ||
|
||
[project] | ||
authors = [{name = "Bryce Boe", email = "[email protected]"}] | ||
classifiers = [ | ||
|
@@ -31,23 +50,6 @@ name = "prawcore" | |
readme = "README.rst" | ||
requires-python = "~=3.9" | ||
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"prawcore[lint]", | ||
"prawcore[test]" | ||
] | ||
lint = [ | ||
"pre-commit", | ||
"ruff ==0.9.*" | ||
] | ||
test = [ | ||
"betamax >=0.8, <0.9", | ||
"pyright", | ||
"pytest ==7.*", | ||
"types-requests", | ||
"urllib3 ==1.*" | ||
] | ||
|
||
[project.urls] | ||
"Issue Tracker" = "https://github.com/praw-dev/prawcore/issues" | ||
"Source Code" = "https://github.com/praw-dev/prawcore" | ||
|
@@ -117,6 +119,50 @@ suppress-dummy-args = true | |
|
||
[tool.ruff.lint.per-file-ignores] | ||
"__init__.py" = ["F401"] | ||
"pre_push.py" = ["T201"] | ||
"examples/*.py" = ["ANN", "PLR2004", "T201"] | ||
"tests/**.py" = ["ANN", "D", "PLR2004", "S101", "S105", "S106", "S301"] | ||
|
||
[tool.tox] | ||
envlist = ["py39", "py310", "py311", "py312", "py313", "pre-commit", "style", "type"] | ||
minversion = "4.22" | ||
|
||
[tool.tox.env.pre-commit] | ||
commands = [ | ||
["pre-commit", "run", "--all-files"] | ||
] | ||
description = "run pre-commit on code base" | ||
dependency_groups = ["lint"] | ||
runner = "uv-venv-lock-runner" | ||
|
||
[tool.tox.env.style] | ||
commands = [ | ||
["ruff", "check"], | ||
["ruff", "format", "--diff", "--target-version", "py39"] | ||
] | ||
description = "run lint check on code base" | ||
dependency_groups = ["lint"] | ||
runner = "uv-venv-lock-runner" | ||
|
||
[tool.tox.env.stylefix] | ||
commands = [ | ||
["ruff", "check", "--fix"], | ||
["ruff", "format", "--target-version", "py39"] | ||
] | ||
description = "run lint check on code base" | ||
dependency_groups = ["lint"] | ||
runner = "uv-venv-lock-runner" | ||
|
||
[tool.tox.env.type] | ||
commands = [["pyright", "prawcore"]] | ||
dependency_groups = ["type"] | ||
description = "run type check on code base" | ||
runner = "uv-venv-lock-runner" | ||
|
||
[tool.tox.env_run_base] | ||
commands = [ | ||
["coverage", "run", "-m", "pytest", "{posargs}"], | ||
["coverage", "report", "-m", "--fail-under=100"] | ||
] | ||
description = "Run test under {base_python}" | ||
dependency_groups = ["test"] | ||
runner = "uv-venv-lock-runner" |
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
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.