Skip to content

Commit

Permalink
Update dependency groups; use newer uv features (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood authored Sep 23, 2024
1 parent 1565b00 commit 4385b02
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 103 deletions.
64 changes: 0 additions & 64 deletions .github/workflows/check-requirements.yml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
with:
python-version: "3.12"
- name: Install uv
run: curl -LsSf https://astral.sh/uv/install.sh | sh
uses: astral-sh/setup-uv@v1
with:
version: "latest"
- run: uv pip install build --system
- run: uv pip freeze
- if: ${{ github.event_name != 'push' }}
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/regen-examples-and-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ jobs:
git config --global user.email ''
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv pip install -e .[docs] --system
python-version: "3.12"
- uses: astral-sh/setup-uv@v1
with:
version: "latest"
- run: uv pip install -e .[dev] --system
- run: uv pip freeze
- name: Regenerate examples and docs
id: regen
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv pip install -e .[docs] --system
python-version: "3.12"
- uses: astral-sh/setup-uv@v1
with:
version: "latest"
- run: uv pip install -e .[dev] --system
- run: uv pip freeze
- name: Regenerate examples and docs
run: python scripts/regenerate.py --download-typeshed
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v5
- name: Set up uv
uses: astral-sh/setup-uv@v1
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- uses: hynek/setup-cached-uv@v2
- name: Install dependencies
run: uv pip install -e ".[pytest]" --system
- run: uv pip freeze
version: "latest"
- name: Run tests under coverage
shell: bash
run: |
coverage run -m pytest --doctest-modules
coverage report --no-skip-covered
uv python pin ${{ matrix.python-version }}
uv run --extra=dev coverage run -m pytest --doctest-modules
uv run --extra=dev coverage report --no-skip-covered
create-issue-on-failure:
name: Create an issue if daily test failed
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -LsSf https://astral.sh/uv/install.sh | sh
- run: uv run --python=3.11 --extra=typecheck mypy
- uses: astral-sh/setup-uv@v1
with:
version: "latest"
- run: uv run --python=3.11 --extra=dev mypy

pyright:
name: Run pyright on the codebase
Expand All @@ -46,8 +48,10 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- uses: hynek/setup-cached-uv@v2
- run: uv pip install -e ".[typecheck]" --system
- uses: astral-sh/setup-uv@v1
with:
version: "latest"
- run: uv pip install -e ".[dev]" --system
- run: uv pip freeze
- name: Run pyright
uses: jakebailey/pyright-action@v2
Expand Down
19 changes: 1 addition & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,14 @@ typeshed-stats = "typeshed_stats._cli:main"

[project.optional-dependencies]
rich = ["rich", "rich-argparse>=1"]
# Include the [rich] extra in the [docs] extra
# so the CLI docs generated from --help are consistent
docs = [
dev = [
"typeshed-stats[rich]",
"MarkDown==3.7",
"mkdocs==1.6.0",
"mkdocs-macros-plugin==1.0.5",
"mkdocs-material==9.5.31",
"mkdocstrings==0.25.2",
"mkdocstrings-python==1.10.8",
]
pytest = [
"typeshed-stats[rich]",
"beautifulsoup4>=4,<5",
"covdefaults==2.3.0",
"coverage==7.6.1",
Expand All @@ -74,22 +69,10 @@ pytest = [
"pytest-dependency==0.6.0",
"pytest-mock==3.14.0",
"pytest-subtests==0.13.1",
]
typecheck = [
"typeshed-stats[rich,docs,pytest]",
"mypy==1.11.1",
"types-beautifulsoup4==4.12.0.20240511",
"types-Markdown==3.6.0.20240316",
]
# All of these must match .pre-commit-config.yaml
#
# Note that not all of the dependencies in the pre-commit config file are listed here.
# That's deliberate (it's not necessary to run them all locally).
# This file just lists the ones which it's convenient to have around locally.
misc-lint = [
"ruff==0.6.1",
]
dev = ["typeshed-stats[rich,docs,typecheck,pytest,misc-lint]"]

[tool.hatch.version]
source = "vcs"
Expand Down

0 comments on commit 4385b02

Please sign in to comment.