Skip to content

Commit

Permalink
UV packaging (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
freider authored Oct 22, 2024
1 parent 5033f08 commit cd0a319
Show file tree
Hide file tree
Showing 5 changed files with 408 additions and 47 deletions.
25 changes: 13 additions & 12 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install Python (3.11)
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install dependencies
run: poetry install --no-root

- name: Install the project
run: uv sync --all-extras --dev --no-install-project

- name: Ruff check
run: poetry run ruff check --diff
run: uv run ruff check --diff

- name: Ruff format
run: poetry run ruff format --diff
run: uv run ruff format --diff

- name: Mypy
run: poetry run mypy .
run: uv run mypy .
28 changes: 15 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,24 @@ jobs:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Install Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
uses: snok/install-poetry@v1
with:
version: 1.7.1
virtualenvs-create: true
virtualenvs-in-project: true
- name: Install packages
run: poetry install

- name: Install the project
run: uv sync --all-extras --dev

- name: Run tests with pytest
run: poetry run pytest
run: uv run pytest

- name: Downgrade to pytest 7
run: poetry run pip install pytest==7.4.4
run: uv pip install "pytest<8"

- name: Run tests with pytest 7
run: poetry run pytest
run: uv run pytest
46 changes: 24 additions & 22 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
[tool.poetry]
[project]
name = "pytest-markdown-docs"
version = "0.5.1"
version = "0.6.0"
description = "Run markdown code fences through pytest"
readme = "README.md"
authors = ["Modal Labs", "Elias Freider <[email protected]>"]
authors = [
{ name = "Modal Labs"},
{ name = "Elias Freider", email = "[email protected]" }
]
license = "MIT"
classifiers = ["Framework :: Pytest"]
repository = "https://github.com/modal-com/pytest-markdown-docs"
requires-python = ">=3.8"
dependencies = [
"markdown-it-py>=2.2.0,<4.0",
"pytest>=7.0.0",
]
include = ["LICENSE"]

[tool.poetry.dependencies]
python = "^3.8"
markdown-it-py = ">=2.2.0, <4.0"
pytest = ">=7.0.0"

[tool.poetry.plugins]
[project.entry-points.pytest11]
pytest_markdown_docs = "pytest_markdown_docs.plugin"

[tool.poetry.plugins."pytest11"]
"pytest_markdown_docs" = "pytest_markdown_docs.plugin"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.poetry.group.dev.dependencies]
ruff = "^0.2.1"
mypy = "^1.8"
pre-commit = [
{version="*", python=">=3.9.0"} # pre-commit only available for Python >= 3.9
[tool.uv]
package=true
dev-dependencies = [
"mypy>=1.12.1",
"pre-commit>=3.5.0",
"pytest~=8.1.0",
"ruff>=0.7.0",
]
pytest = "^8.1.0"

[build-system]
requires = ["poetry-core>=1.1.0"]
build-backend = "poetry.core.masonry.api"

Empty file.
Loading

0 comments on commit cd0a319

Please sign in to comment.