Skip to content
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

refactor: use dependency groups #195

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 16 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@ name: CI

on:
workflow_dispatch:

pull_request:

push:
branches:
- master

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
FORCE_COLOR: 3 # "3" -> "256-bit color".

jobs:
test:
runs-on: ubuntu-latest
Expand All @@ -30,27 +35,29 @@ jobs:
extra-install: ""
- name: "3.11-pre-beartype"
python-version: "3.11"
extra-install: "pip install --upgrade --pre beartype"
extra-install: "uv pip install --upgrade --pre beartype"

name: Test ${{ matrix.value.name }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.value.python-version }}
uses: actions/setup-python@v2
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.value.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python ${{ matrix.value.python-version }}
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade --no-cache-dir -e '.[dev]'
uv sync --group dev
${{ matrix.value.extra-install }}
- name: Test linter assertions
run: |
python check_linter_assertions.py tests/typechecked
- name: Run tests
run: |
PRAGMA_VERSION=`python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))"` \
pytest -v --cov=plum --cov-report term-missing
uv run pytest -v --cov=plum --cov-report term-missing
- name: Coveralls parallel
uses: coverallsapp/github-action@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.16
rev: v0.23
hooks:
- id: validate-pyproject

Expand Down
38 changes: 23 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,39 @@ requires-python = ">=3.8"
dependencies = [
"beartype>=0.16.2",
"typing-extensions>=4.9.0",
"rich>=10.0"
"rich>=10.0",
"setuptools"
]

[project.optional-dependencies]
[project.urls]
repository = "https://github.com/beartype/plum"


[dependency-groups]
dev = [
"numpy",
"pytest>=6",
"pytest-cov",
"coveralls",
{ include-group = "docs" },
{ include-group = "lint" },
{ include-group = "test" },
]
lint = [
"pre-commit",
]
test = [
"IPython",
"black==23.9.0",
"ghp-import",
"wheel",
"build",
"tox",
"jupyter-book",
"pytest>=6",
"pytest-cov",
"coveralls",
"sybil",
"mypy",
"pyright>=1.1.331",
"ruff>=0.2.1",
"sybil",
"numpy>=1.24.4",
"setuptools>=75.3.0",
]
docs = [
"jupyter-book",
]

[project.urls]
repository = "https://github.com/beartype/plum"


[build-system]
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ envlist = p37, p38, p39, p310

[testenv]
commands =
black --check setup.py plum tests
isort --check --profile black setup.py plum tests
pytest -v --cov plum --cov-report term --cov-report html {posargs: tests}
deps = -r requirements.txt
Loading
Loading