Skip to content

Commit c35d932

Browse files
authored
feat: move codecov-cli to uv to simplify dependency management and build APIs (#28)
I did try out uv workspaces to manage both with uv commands from the project root, but I found it a bit blah without totally changing the project structure. We can revisit that later if we want. For now the output of this is moving codecov-cli to uv for dependency management and build. README overhaul to come later with documentation of the commands here. Just trying to get our builds published first. Next PR will update the build and publish workflows.
1 parent 04e3bb0 commit c35d932

13 files changed

Lines changed: 736 additions & 177 deletions

File tree

.github/workflows/ci-job.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ jobs:
3636

3737
- name: Install dependencies
3838
run: |
39-
python -m pip install --upgrade pip
40-
pip install -r codecov-cli/requirements.txt
41-
python -m pip install -e codecov-cli
42-
python -m pip install -e prevent-cli
39+
python -m pip install uv
40+
uv sync --project prevent-cli
4341
4442
- name: Run command_dump
4543
run: |
46-
python command_dump.py
44+
make command_dump
4745
4846
- name: Detect changes on commit
4947
run: |
@@ -66,7 +64,6 @@ jobs:
6664
python-version: "3.12"
6765

6866
- name: Install CLI
69-
# todo: update this to dogfood prevent cli, maybe try both?
7067
run: |
7168
pip install codecov-cli
7269
@@ -97,27 +94,25 @@ jobs:
9794

9895
- name: Install dependencies
9996
run: |
100-
python -m pip install --upgrade pip
101-
pip install -r codecov-cli/requirements.txt
102-
python -m pip install -e codecov-cli
103-
python -m pip install -e prevent-cli
104-
pip install -r codecov-cli/tests/requirements.txt
97+
python -m pip install uv
98+
uv sync --project codecov-cli
99+
uv sync --project prevent-cli
105100
106101
- name: Test with pytest
107102
run: |
108103
cd codecov-cli
109-
pytest --cov --junitxml=${{matrix.os}}-${{matrix.python-version}}junit.xml
104+
uv run pytest --cov --junitxml=${{matrix.os}}-${{matrix.python-version}}junit.xml
110105
env:
111106
CODECOV_ENV: test
112107

113108
- name: Dogfooding codecov-cli
114109
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'getsentry' }}
115110
run: |
116-
codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag codecovcli
117-
codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag codecovcli
111+
uv run --project codecov-cli codecovcli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag codecovcli
112+
uv run --project codecov-cli codecovcli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag codecovcli
118113
119114
- name: Dogfooding sentry-prevent-cli
120115
if: ${{ !github.event.pull_request.head.repo.fork && github.repository_owner == 'getsentry' }}
121116
run: |
122-
sentry-prevent-cli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag sentry-prevent-cli
123-
sentry-prevent-cli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag sentry-prevent-cli
117+
uv run --project prevent-cli sentry-prevent-cli -v do-upload --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag sentry-prevent-cli
118+
uv run --project prevent-cli sentry-prevent-cli do-upload --report-type test_results --fail-on-error -t ${{ secrets.CODECOV_TOKEN }} --plugin pycoverage --flag python${{matrix.python-version}} --flag sentry-prevent-cli

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ lint:
2323
make lint.install
2424
make lint.run
2525

26+
command_dump:
27+
cd prevent-cli && uv run command_dump.py
28+
2629
tag.release:
2730
ifeq ($(shell echo ${version} | egrep "${tag_regex}"),)
2831
@echo "Version '${version}' is not a valid git tag.\nUsage: make tag.release version=v0.0.0"

codecov-cli/pyproject.toml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ maintainers = [
1212
description = "Codecov Command Line Interface"
1313
dependencies = [
1414
"click==8.*",
15-
"pyyaml==6.*",
1615
"ijson==3.*",
16+
"PyYAML==6.*",
1717
"responses==0.21.*",
18-
"sentry-sdk>=2.20.0",
18+
"sentry-sdk==2.*",
1919
"test-results-parser==0.5.4",
2020
]
2121
license = {file = "LICENSE"}
@@ -36,12 +36,12 @@ env = [
3636
[tool.setuptools]
3737
packages = ["codecov_cli"]
3838

39-
[tool.cibuildwheel]
40-
skip = ["pp*", "cp313-*"]
41-
test-command = "codecovcli --help"
42-
43-
[tool.cibuildwheel.config-settings]
44-
pure-python = "true"
45-
46-
[tool.cibuildwheel.environment]
47-
PIP_CONSTRAINT = "requirements.txt"
39+
[dependency-groups]
40+
dev = [
41+
"pre-commit==3.*",
42+
"pytest==7.*",
43+
"pytest-asyncio==0.21.1",
44+
"pytest-cov==4.*",
45+
"pytest-env==1.*",
46+
"pytest-mock==3.*",
47+
]

codecov-cli/requirements.txt

Lines changed: 0 additions & 36 deletions
This file was deleted.

codecov-cli/tests/requirements.in

Lines changed: 0 additions & 7 deletions
This file was deleted.

codecov-cli/tests/requirements.txt

Lines changed: 0 additions & 52 deletions
This file was deleted.

0 commit comments

Comments
 (0)