Skip to content
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
4 changes: 4 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
build:
name: Build distributions
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:

test:
name: Test
needs: build
uses: ./.github/workflows/test.yaml
secrets: inherit

Expand Down
27 changes: 19 additions & 8 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,38 @@ on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

concurrency: lint-${{ github.sha }}

jobs:
lint:
name: Lint and type check with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.10"
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python ${{ env.PYTHON_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}

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

- name: Install the project
run: uv sync --all-extras --dev
- name: Install project dependencies
run: uv sync --all-groups --python ${{ matrix.python-version }}

- name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1
- name: Run hooks
uses: j178/prek-action@v1
33 changes: 27 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,51 @@ on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

concurrency: test-${{ github.sha }}

jobs:
test:
name: Test with Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
- "3.13"
- "3.14"
env:
PYTHON_VERSION: "3.10"
CONTIGUITY_PROJECT_ID: ${{ secrets.CONTIGUITY_PROJECT_ID }}
CONTIGUITY_TOKEN: ${{ secrets.CONTIGUITY_TOKEN }}
CONTIGUITY_DATA_KEY: ${{ secrets.CONTIGUITY_DATA_KEY }}
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Python ${{ env.PYTHON_VERSION }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}

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

- name: Install the project
run: uv sync --all-extras --dev
- name: Install project dependencies
run: uv sync --no-install-project --all-groups --python ${{ matrix.python-version }}

- name: Download sdist artifact
uses: actions/download-artifact@v6
with:
name: sdist
path: ./dist

- name: Install package
run: uv pip install dist/*.tar.gz

- name: Run tests
- name: Run pytest
run: uv run pytest tests
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
- repo: builtin
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand All @@ -11,12 +10,12 @@ repos:
args: [--markdown-linebreak-ext=md]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.9
rev: v0.15.17
hooks:
- id: ruff
- id: ruff-check
- id: ruff-format

- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.407
- repo: https://github.com/astral-sh/ty-pre-commit
rev: v0.0.49
hooks:
- id: pyright
- id: ty
22 changes: 6 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
[build-system]
requires = [
"setuptools>=61",
]
requires = ["setuptools>=61"]
build-backend = "setuptools.build_meta"

[project]
name = "contiguity"
dynamic = ["version"]
description = "Contiguity's official Python SDK"
readme = "README.md"
license = {file = "LICENSE.txt"}
license = { file = "LICENSE.txt" }
requires-python = ">=3.10"
authors = [
{name = "Contiguity", email = "help@contiguity.support"},
]
authors = [{ name = "Contiguity", email = "help@contiguity.support" }]
keywords = [
"python",
"contiguity",
Expand Down Expand Up @@ -42,7 +38,7 @@ dependencies = [

[dependency-groups]
dev = [
"pre-commit~=4.5.0",
"prek~=0.4.5",
"pytest~=9.0.2",
"pytest-asyncio~=1.3.0",
"pytest-cov~=7.0.0",
Expand All @@ -53,15 +49,14 @@ dev = [
Repository = "https://github.com/contiguity/python"

[tool.setuptools]
package-data = {contiguity = ["py.typed"]}
package-data = { contiguity = ["py.typed"] }

[tool.setuptools.dynamic]
version = {attr = "contiguity.__version__"}
version = { attr = "contiguity.__version__" }

[tool.ruff]
src = ["src"]
line-length = 119
target-version = "py310"

[tool.ruff.lint]
select = ["ALL"]
Expand All @@ -70,10 +65,5 @@ ignore = ["A", "D", "T201"]
[tool.ruff.lint.per-file-ignores]
"**/tests/*" = ["S101", "S311"]

[tool.pyright]
venvPath = "."
venv = ".venv"
reportUnnecessaryTypeIgnoreComment = true

[tool.pytest.ini_options]
asyncio_mode = "auto"
Loading
Loading