Skip to content

Commit 60ba833

Browse files
chore: Use tox instead of hatch
1 parent 2eea4bc commit 60ba833

7 files changed

Lines changed: 586 additions & 475 deletions

File tree

.github/workflows/constraints.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
hatch==1.14.1
2-
pip==25.1.1
1+
tox==4.28.4
2+
tox-gh==1.5.0
3+
tox-uv==1.26.2

.github/workflows/test.yml

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,22 @@ on:
2222
# Run weekly on Monday at 12:00 PM UTC
2323
- cron: "0 12 * * 1"
2424

25+
env:
26+
FORCE_COLOR: "1"
27+
UV_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
28+
2529
jobs:
2630
test:
2731
runs-on: ubuntu-latest
28-
env:
29-
FORCE_COLOR: "1"
30-
PIP_CONSTRAINT: ${{ github.workspace }}/.github/workflows/constraints.txt
3132
strategy:
3233
fail-fast: false
3334
matrix:
34-
script: ["test:integration"]
3535
python-version:
3636
- "3.10"
3737
- "3.11"
3838
- "3.12"
3939
- "3.13"
40-
include:
41-
- { script: "test:dependencies", python-version: "3.x" }
42-
- { script: "typing:check", python-version: "3.x" }
40+
- "3.14"
4341

4442
steps:
4543
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -48,25 +46,16 @@ jobs:
4846
with:
4947
python-version: ${{ matrix.python-version }}
5048
allow-prereleases: true
51-
cache: pip
5249

53-
- name: Upgrade pip
54-
run: |
55-
pip install pip
56-
pip --version
57-
58-
- name: Install Hatch
59-
run: |
60-
pipx install hatch
61-
hatch --version
50+
- name: Install uv
51+
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # v6.4.3
6252

6353
- name: Run tests
6454
env:
65-
HATCH_PYTHON: ${{ steps.setup-python.outputs.python-path }}
6655
TAP_TRANSIFEX_TOKEN: ${{ secrets.TAP_TRANSIFEX_TOKEN }}
6756
TAP_TRANSIFEX_START_DATE: ${{ secrets.TAP_TRANSIFEX_START_DATE }}
6857
run: |
69-
hatch run ${{ matrix.script }}
58+
uvx --with tox-gh --with tox-uv tox -e ${{ matrix.python-version }}
7059
7160
pre-commit:
7261
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,31 @@ repos:
1010
- id: trailing-whitespace
1111

1212
- repo: https://github.com/tox-dev/pyproject-fmt
13-
rev: v2.5.0
13+
rev: v2.6.0
1414
hooks:
1515
- id: pyproject-fmt
1616

1717
- repo: https://github.com/astral-sh/ruff-pre-commit
18-
rev: v0.9.4
18+
rev: v0.12.7
1919
hooks:
20-
- id: ruff
21-
name: Ruff lint
20+
- id: ruff-check
2221
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
2322
- id: ruff-format
24-
name: Ruff format
2523

2624
- repo: https://github.com/pre-commit/pre-commit
27-
rev: v4.1.0
25+
rev: v4.2.0
2826
hooks:
2927
- id: validate_manifest
3028

3129
- repo: https://github.com/python-jsonschema/check-jsonschema
32-
rev: 0.31.1
30+
rev: 0.33.2
3331
hooks:
3432
- id: check-dependabot
3533
- id: check-github-workflows
34+
- id: check-meltano
3635

3736
- repo: https://github.com/astral-sh/uv-pre-commit
38-
rev: 0.7.21
37+
rev: 0.8.4
3938
hooks:
4039
- id: uv-lock
4140
- id: uv-sync

meltano.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ plugins:
1010
label: Transifex
1111
namespace: transifex
1212
description: Translation and Localization hub
13-
repository: https://github.com/edgarrmondragon/tap-transifex
13+
repo: https://github.com/edgarrmondragon/tap-transifex
1414
docs: https://github.com/edgarrmondragon/tap-transifex#readme
1515
pip_url: -e .
1616
capabilities:

pyproject.toml

Lines changed: 61 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requires = [
77

88
[project]
99
name = "tap-transifex"
10-
description = "`tap-transifex` is a Singer tap for Transifex, built with the Meltano SDK for Singer Taps."
10+
description = "Singer tap for Transifex, built with the Meltano SDK for Singer Taps"
1111
readme = "README.md"
1212
keywords = [
1313
"ELT",
@@ -25,54 +25,38 @@ classifiers = [
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
2727
"Programming Language :: Python :: 3.13",
28+
"Programming Language :: Python :: 3.14",
2829
]
2930
dynamic = [
3031
"version",
3132
]
3233
dependencies = [
33-
"requests~=2.32.2",
3434
"singer-sdk~=0.47.0",
3535
]
36-
optional-dependencies.dev = [
37-
"tap-transifex[testing,typing]",
36+
urls.Documentation = "https://github.com/edgarrmondragon/tap-transifex#readme"
37+
urls.Homepage = "https://github.com/edgarrmondragon/tap-transifex"
38+
urls.Repository = "https://github.com/edgarrmondragon/tap-transifex"
39+
scripts."tap-transifex" = "tap_transifex.tap:TapTransifex.cli"
40+
41+
[dependency-groups]
42+
dev = [
43+
{ include-group = "testing" },
44+
{ include-group = "typing" },
3845
]
39-
optional-dependencies.testing = [
46+
testing = [
4047
"deptry>=0.12",
4148
"pytest>=8",
4249
"singer-sdk[testing]",
4350
]
44-
optional-dependencies.typing = [
51+
typing = [
4552
"mypy>=1.8",
53+
"ty>=0.0.1a16",
4654
"types-requests>=2.31",
4755
]
48-
urls.Documentation = "https://github.com/edgarrmondragon/tap-transifex#readme"
49-
urls.Homepage = "https://github.com/edgarrmondragon/tap-transifex"
50-
urls.Repository = "https://github.com/edgarrmondragon/tap-transifex"
51-
scripts."tap-transifex" = "tap_transifex.tap:TapTransifex.cli"
5256

5357
[tool.hatch.version]
5458
source = "vcs"
5559

56-
[tool.hatch.envs.sync.scripts]
57-
console = "tap-transifex {args} --config ENV"
58-
jsonl = "tap-transifex {args} --config ENV > tap-transifex.jsonl"
59-
60-
[tool.hatch.envs.test]
61-
features = [ "testing" ]
62-
[tool.hatch.envs.test.scripts]
63-
integration = "pytest {args:tests}"
64-
dependencies = "deptry ."
65-
66-
[tool.hatch.envs.all]
67-
template = "test"
68-
[[tool.hatch.envs.all.matrix]]
69-
python = [ "3.10", "3.11", "3.12", "3.13" ]
70-
71-
[tool.hatch.envs.typing]
72-
features = [ "testing", "typing" ]
73-
[tool.hatch.envs.typing.scripts]
74-
check = "mypy --strict {args:tap_transifex tests}"
75-
7660
[tool.ruff]
7761
line-length = 88
7862

@@ -100,7 +84,7 @@ lint.pydocstyle.convention = "google"
10084
[tool.deptry.package_module_name_map]
10185
mypy = "mypy"
10286
pytest = "pytest"
103-
tap-transifex = "tap_transifex"
87+
ty = "ty"
10488
types-requests = "requests"
10589

10690
[tool.deptry.per_rule_ignores]
@@ -110,9 +94,55 @@ DEP002 = [
11094
"pytest",
11195
]
11296

97+
[tool.pyproject-fmt]
98+
max_supported_python = "3.14"
99+
113100
[tool.pytest.ini_options]
114101
addopts = "-vvv"
115102

103+
[tool.tox]
104+
min_version = "4.22"
105+
requires = [
106+
"tox~=4.22",
107+
"tox-gh~=1.5.0",
108+
"tox-uv~=1.17",
109+
]
110+
env_list = [
111+
"dependencies",
112+
"typing",
113+
"3.14",
114+
"3.13",
115+
"3.12",
116+
"3.11",
117+
"3.10",
118+
]
119+
120+
[tool.tox.gh.python]
121+
"3.14" = [ "3.14" ]
122+
"3.13" = [ "3.13", "dependencies", "typing" ]
123+
"3.12" = [ "3.12" ]
124+
"3.11" = [ "3.11" ]
125+
"3.10" = [ "3.10" ]
126+
127+
[tool.tox.env_run_base]
128+
pass_env = [ "TAP_TRANSIFEX_*" ]
129+
dependency_groups = [ "testing" ]
130+
commands = [ [ "pytest", { replace = "posargs", default = [ "tests" ], extend = true } ] ]
131+
132+
[tool.tox.env.dependencies]
133+
dependency_groups = [ "testing" ]
134+
commands = [ [ "deptry", "." ] ]
135+
136+
[tool.tox.env.sync]
137+
commands = [ [ "tap-transifex", { replace = "posargs", default = [ "--config=ENV" ], extend = true } ] ]
138+
139+
[tool.tox.env.typing]
140+
dependency_groups = [ "testing", "typing" ]
141+
commands = [
142+
[ "mypy", "--strict", { replace = "posargs", default = [ "tap_transifex", "tests" ], extend = true } ],
143+
[ "ty", "check", { replace = "posargs", default = [ "tap_transifex", "tests" ], extend = true } ],
144+
]
145+
116146
[tool.mypy]
117147
warn_redundant_casts = true
118148
warn_return_any = true

tap_transifex/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,6 @@ def get_url_params(
7474
params: dict[str, t.Any] = {}
7575

7676
if next_page_token:
77-
params.update(parse_qs(next_page_token.query))
77+
params |= parse_qs(next_page_token.query)
7878

7979
return params

0 commit comments

Comments
 (0)