Skip to content

Commit

Permalink
chore: Switch to uv (#507)
Browse files Browse the repository at this point in the history
edgarrmondragon authored Jan 31, 2025
1 parent 0e5813f commit d897edd
Showing 7 changed files with 1,238 additions and 1,606 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
pip==25.0
poetry==2.0.1
tox==4.24.1
35 changes: 9 additions & 26 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ jobs:
tests:
runs-on: ubuntu-latest
env:
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
strategy:
matrix:
python-version:
@@ -56,19 +56,13 @@ jobs:
python-version: ${{ matrix.python-version }}
allow-prereleases: true

- name: Upgrade pip
run: |
pip install pip
pip --version
- name: Install Poetry
run: |
pipx install poetry
poetry --version
- uses: astral-sh/setup-uv@v5
with:
version: ">=0.5.19"

- name: Install tox
run: |
pipx install tox
uv tool install tox
tox --version
- name: Run tests
@@ -88,21 +82,10 @@ jobs:
with:
python-version: "3.x"

- name: Upgrade pip
run: |
pip install pip
pip --version
- name: Install Poetry
run: |
pipx install poetry
poetry --version
poetry self show plugins
- name: Install dependencies
run: |
poetry install
- uses: astral-sh/setup-uv@v5
with:
version: ">=0.5.19"

- name: Run typing checks
run: |
poetry run mypy tap_stackexchange
uv run mypy tap_stackexchange
7 changes: 0 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -35,13 +35,6 @@ repos:
additional_dependencies:
- types-requests

- repo: https://github.com/pycqa/flake8
rev: 7.1.1
hooks:
- id: flake8
additional_dependencies:
- darglint

- repo: https://github.com/pre-commit/pre-commit
rev: v4.0.1
hooks:
1,520 changes: 0 additions & 1,520 deletions poetry.lock

This file was deleted.

80 changes: 38 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,69 +1,65 @@
[build-system]
build-backend = "poetry_dynamic_versioning.backend"
build-backend = "hatchling.build"
requires = [
"poetry-core==1.9",
"poetry-dynamic-versioning==1.4",
"hatch-vcs==0.4",
"hatchling==1.27",
]

[tool.poetry]
[project]
name = "tap-stackexchange"
version = "0.0.0"
description = "Singer tap for StackExchange, built with the Meltano SDK for Singer Taps."
authors = [
"Edgar Ramírez-Mondragón <[email protected]>",
readme = "README.md"
keywords = [
"ELT",
"meltano",
"singer-io",
"StackExchange",
]
license = "Apache-2.0"
authors = [ { name = "Edgar Ramírez-Mondragón", email = "[email protected]" } ]
requires-python = ">=3.9"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
keywords = [
"ELT",
"meltano",
"singer-io",
"StackExchange",
dynamic = [ "version" ]
dependencies = [
"pyrate-limiter==3.*; python_version<'4'",
"requests-cache==1.*; python_version<'4'",
"singer-sdk==0.44.*",
]
license = "Apache-2.0"
readme = "README.md"
homepage = "https://github.com/MeltanoLabs/tap-stackexchange"
repository = "https://github.com/MeltanoLabs/tap-stackexchange"
documentation = "https://github.com/MeltanoLabs/tap-stackexchange/blob/main/README.md"

[tool.poetry.dependencies]
python = ">=3.9"
pyrate-limiter = { version = "==3.*", python = "<4" }
requests-cache = { version = "==1.*", python = "<4" }
singer-sdk = "==0.44.*"

[tool.poetry.group.dev.dependencies]
mypy = ">=1.11.1"
pytest-httpserver = { version = "^1.0.8", python = "<4" }
singer-sdk = { extras = [
"testing",
], version = ">=0.23.0" }
types-requests = "*"
urls.Documentation = "https://github.com/MeltanoLabs/tap-stackexchange/blob/main/README.md"
urls.Homepage = "https://github.com/MeltanoLabs/tap-stackexchange"
urls.Repository = "https://github.com/MeltanoLabs/tap-stackexchange"
scripts.tap-stackexchange = "tap_stackexchange.tap:TapStackExchange.cli"

[tool.poetry.scripts]
# CLI declaration
tap-stackexchange = 'tap_stackexchange.tap:TapStackExchange.cli'
[dependency-groups]
dev = [
{ include-group = "test" },
{ include-group = "typing" },
]
test = [
"pytest-httpserver>=1.0.8,<2; python_version<'4'",
"singer-sdk[testing]>=0.23",
]
typing = [
"mypy>=1.11.1",
"types-requests",
]

[tool.poetry-dynamic-versioning]
enable = true
style = "pep440"
[tool.hatch.version]
source = "vcs"

[tool.ruff]
target-version = "py39"

line-length = 88
lint.select = [
"ALL",
]
lint.ignore = [
"ANN101", # missing-type-self
]

lint.flake8-annotations.allow-star-arg-any = true
lint.isort.known-first-party = [
11 changes: 2 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -7,14 +7,7 @@ envlist = py{39,310,311,312,313}

[testenv]
passenv = TAP_STACKEXCHANGE_*
deps =
pytest-httpserver
singer-sdk[testing]
dependency_groups =
test
commands =
pytest

[flake8]
select = DAR
docstring-convention = google
per-file-ignores =
tests/*:DAR
1,189 changes: 1,189 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit d897edd

Please sign in to comment.