Skip to content
Merged
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
131 changes: 73 additions & 58 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,109 +1,124 @@
version: 2.1

orbs:
python: circleci/python@3.0.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interesting, could we skip the uv install phase if we used the right orb?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me revisit after this stack, so the tests we run have fewer resource requirements. :)

codecov: codecov/codecov@5.0.3

jobs:
linux310:
machine:
image: ubuntu-2204:2024.11.1
commands:
install-uv:
steps:
- checkout
- run:
name: Install python
command: pyenv install 3.10
name: Install uv
command: |
curl -LsSf https://astral.sh/uv/0.11.9/install.sh | sh
echo 'export PATH="$HOME/.local/bin:$PATH"' >> "$BASH_ENV"
install-python:
parameters:
python_version:
type: string
steps:
- run:
name: Load python
command: pyenv global 3.10
name: Install Python << parameters.python_version >>
command: uv python install << parameters.python_version >>
uv-run-dev:
parameters:
step_name:
type: string
default: Run command
python_version:
type: string
command:
type: string
steps:
- run:
name: Run tests
command: pip install tox==3.24.0 && tox -e py310
name: << parameters.step_name >>
command: uv run --python << parameters.python_version >> --with-requirements requirements.dev.txt << parameters.command >>
no_output_timeout: 60m

jobs:
linux310:
machine:
image: ubuntu-2404:2025.09.1
resource_class: large
steps:
- checkout
- install-uv
- install-python:
python_version: "3.10"
- uv-run-dev:
step_name: Run tests
python_version: "3.10"
command: tox -e py310
- codecov/upload
- store_artifacts:
path: prof/
- store_test_results:
path: .
resource_class: large
linux311:
machine:
image: ubuntu-2204:2024.11.1
image: ubuntu-2404:2025.09.1
resource_class: large
steps:
- checkout
- run:
name: Install python
command: pyenv install 3.11
- run:
name: Load python
command: pyenv global 3.11
- run:
name: Run tests
command: pip install tox==3.24.0 && tox -e py311
no_output_timeout: 60m
- install-uv
- install-python:
python_version: "3.11"
- uv-run-dev:
step_name: Run tests
python_version: "3.11"
command: tox -e py311
- codecov/upload
- store_artifacts:
path: prof/
- store_test_results:
path: .
resource_class: large
linux312:
machine:
image: ubuntu-2204:2024.11.1
image: ubuntu-2404:2025.09.1
resource_class: large
steps:
- checkout
- run:
name: Install python
command: pyenv install 3.12
- run:
name: Load python
command: pyenv global 3.12
- run:
name: Run tests
command: pip install tox==3.24.0 setuptools==75.8.0 && tox -e py312
no_output_timeout: 60m
- install-uv
- install-python:
python_version: "3.12"
- uv-run-dev:
step_name: Run tests
python_version: "3.12"
command: --with setuptools==75.8.0 tox -e py312
- codecov/upload
- store_artifacts:
path: prof/
- store_test_results:
path: .
resource_class: large
linters310:
docker:
- image: cimg/python:3.10
steps:
- checkout
- run:
name: Install dependencies
command: pip install -r requirements.dev.txt
- run:
name: Run linters
command: |
pre-commit run --all-files
- install-uv
- uv-run-dev:
step_name: Run linters
python_version: "3.10"
command: pre-commit run --all-files
linters311:
docker:
- image: cimg/python:3.11
steps:
- checkout
- run:
name: Install dependencies
command: pip install -r requirements.dev.txt
- run:
name: Run linters
command: |
pre-commit run --all-files
- install-uv
- uv-run-dev:
step_name: Run linters
python_version: "3.11"
command: pre-commit run --all-files
linters312:
docker:
- image: cimg/python:3.12
steps:
- checkout
- run:
name: Install dependencies
command: pip install -r requirements.dev.txt
- run:
name: Run linters
command: |
pre-commit run --all-files
- install-uv
- uv-run-dev:
step_name: Run linters
python_version: "3.12"
command: pre-commit run --all-files

workflows:
main:
Expand Down
23 changes: 13 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
UV_RUN_DEV := uv run --with-requirements requirements.dev.txt

dist: clean ## builds source and wheel package
python setup.py sdist bdist_wheel
ls -l dist
Expand Down Expand Up @@ -26,29 +28,30 @@ clean-pyc: ## remove Python file artifacts
find . -name '__pycache__' -exec rm -fr {} +

test:
tox -e "black,flake8,py310"
$(MAKE) format
$(MAKE) test-short

test-full:
tox
$(UV_RUN_DEV) tox

test-short:
tox -e "py310"
$(UV_RUN_DEV) tox -e py310

format:
pre-commit run --all-files
$(UV_RUN_DEV) pre-commit run --all-files

release: dist ## package and upload release
pip install -qq twine
uv pip install -qq twine
twine upload dist/*

release-test: dist ## package and upload test release
pip install -qq twine
uv pip install -qq twine
twine upload --repository testpypi dist/*

bumpversion-to-dev:
pip install -qq bumpversion==0.5.3
python ./tools/bumpversion-tool.py --to-dev
uv pip install -qq bumpversion==0.5.3
uv run python ./tools/bumpversion-tool.py --to-dev

bumpversion-from-dev:
pip install -qq bumpversion==0.5.3
python ./tools/bumpversion-tool.py --from-dev
uv pip install -qq bumpversion==0.5.3
uv run python ./tools/bumpversion-tool.py --from-dev
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,18 @@ make test-full

__Review the [Contributing Instructions](https://github.com/wandb/client/blob/master/CONTRIBUTING.md)__

Install the development requirements:
Create and activate a uv-managed virtual environment:

```
pip install -r requirements.dev.txt
uv python install 3.10
uv venv --python 3.10
source .venv/bin/activate
```

Install the package in editable mode with development and test dependencies:

```
uv pip install -r requirements.dev.txt -e .
```

Install the pre-commit hooks:
Expand All @@ -181,3 +189,8 @@ Run formatting and tests:
make format
make test
```

### Releasing

```
make
8 changes: 7 additions & 1 deletion requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ black==22.8.0
flake8==7.3.0
types-PyYAML==5.4.3
mypy==1.14.1
tox>=3.24.0
tox==4.54.0
pytest==7.4.0
pytest-cov==2.11.1
pytest-randomly==3.8.0
matplotlib>=3
pytest-xdist>=2.2.1
pytest-profiling>=1.7.0
8 changes: 0 additions & 8 deletions requirements.test.txt

This file was deleted.

26 changes: 10 additions & 16 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
[tox]
minversion=3.24.0
minversion=4.54.0
envlist = py{310,311,312}

[python]
lint = python3.10

[testenv:py{310,311,312}]
deps =
-r{toxinidir}/requirements.test.txt
-r{toxinidir}/requirements.dev.txt

install_command =
pip install {opts} {packages}
Expand All @@ -17,14 +20,14 @@ deps=
black==22.8.0

[testenv:black]
basepython = python3
basepython = {[python]lint}
skip_install = true
deps = {[black]deps}
commands =
black --check src/ tests/ tools/ examples/

[testenv:format]
basepython = python3
basepython = {[python]lint}
skip_install = true
deps=
pre-commit==4.6.0
Expand All @@ -35,20 +38,11 @@ commands =
max-line-length = 80
select = C,E,F,W,B,B950
ignore = E501, E721, W503
deps =
flake8
flake8-colors
grpcio==1.40.0

[testenv:flake8]
basepython=python3
basepython = {[python]lint}
skip_install = true
deps =
{[flake8]deps}
flake8-bugbear>=21.4.2
pep8-naming
flake8-fixme
flake8-typing-imports>=1.1
flake8-import-order>=0.9
flake8==7.3.0
commands =
flake8 {posargs}
flake8 src/ tests/ tools/ examples/ {posargs}