Skip to content

Commit abfaae4

Browse files
authored
Merge pull request #1257 from jakob-keller/uv
Leverage `uv`
2 parents 7432338 + 54ce93e commit abfaae4

File tree

6 files changed

+3280
-66
lines changed

6 files changed

+3280
-66
lines changed

.github/workflows/ci-cd.yml

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,12 @@ jobs:
2626

2727
steps:
2828
- uses: actions/checkout@v4
29-
- name: Set up Python
30-
uses: actions/setup-python@v5
31-
with:
32-
python-version: 3.x
33-
- name: Install build dependencies
34-
run: python -m pip install build twine
29+
- name: Install uv
30+
uses: astral-sh/setup-uv@v5
3531
- name: Build distribution 📦
36-
run: python -m build
32+
run: uv build
3733
- name: Check distribution 📦
38-
run: python -m twine check --strict dist/*
34+
run: uvx twine check --strict dist/*
3935
- name: Upload distribution 📦
4036
uses: actions/upload-artifact@v4
4137
with:
@@ -56,32 +52,27 @@ jobs:
5652
- 3.12
5753
- 3.13
5854
fail-fast: false
55+
env:
56+
UV_FROZEN: 1
5957
timeout-minutes: 5
6058

6159
steps:
6260
- name: Checkout
6361
uses: actions/checkout@v4
6462
with:
6563
submodules: true
66-
- name: Setup Python ${{ matrix.python-version }}
67-
uses: actions/setup-python@v5
64+
- name: Install uv
65+
uses: astral-sh/setup-uv@v5
6866
with:
6967
python-version: ${{ matrix.python-version }}
70-
allow-prereleases: true
71-
- name: Lock and sync dependencies
72-
run: |
73-
python -m pip install -U pip pip-tools
74-
pip-compile --all-extras pyproject.toml requirements-dev.in
75-
pip-sync
76-
pip install -e .
7768
- name: Run pre-commit hooks
7869
run: |
79-
make pre-commit
70+
uv run make pre-commit
8071
- name: Run unittests
8172
env:
8273
COLOR: 'yes'
8374
run: |
84-
make mototest
75+
uv run make mototest
8576
- name: Upload coverage to Codecov
8677
if: matrix.python-version == '3.11'
8778
uses: codecov/[email protected]

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
ci:
33
autoupdate_schedule: quarterly
4+
skip: [uv-lock] # https://github.com/astral-sh/uv/issues/10167
45

56
repos:
67
- repo: 'https://github.com/pre-commit/pre-commit-hooks'
@@ -19,6 +20,10 @@ repos:
1920
- id: ruff
2021
args: [--fix]
2122
- id: ruff-format
23+
- repo: https://github.com/astral-sh/uv-pre-commit
24+
rev: 0.5.15
25+
hooks:
26+
- id: uv-lock
2227
- repo: https://github.com/adrienverge/yamllint
2328
rev: v1.35.1
2429
hooks:

CONTRIBUTING.rst

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,24 @@ First of all, clone the repository::
1313

1414
$ git clone [email protected]:aio-libs/aiobotocore.git
1515

16-
Create virtualenv with at least python3.8 (older versions are not supported).
17-
For example, using ``virtualenvwrapper`` commands could look like::
16+
Make sure the Python package and project manager `uv <https://docs.astral.sh/uv/>`_ is installed.
1817

19-
$ cd aiobotocore
20-
$ mkvirtualenv --python=`which python3.8` aiobotocore
18+
Create a virtual environment::
2119

22-
23-
After that, please install libraries required for development::
24-
25-
$ pip install pip-tools
26-
$ pip-compile --all-extras pyproject.toml requirements-dev.in
27-
$ pip-sync
28-
$ pip install -e .
20+
$ cd aiobotocore
21+
$ uv venv
2922

3023
Install pre-commit hooks::
3124

32-
$ pre-commit install
25+
$ uv run pre-commit install
3326

3427
Congratulations, you are ready to run the test suite.
3528

3629
There are two set of tests, those that can be mocked through `moto <https://github.com/getmoto/moto>`_ running in docker, and those that require running against a personal amazon key. The CI only runs the moto tests.
3730

3831
To run the moto tests::
3932

40-
$ make mototest
33+
$ uv run make mototest
4134

4235
To run the non-moto tests, make sure you have your amazon key and secret accessible via environment variables::
4336

@@ -47,15 +40,15 @@ To run the non-moto tests, make sure you have your amazon key and secret accessi
4740

4841
Execute full tests suite::
4942

50-
$ make test
43+
$ uv run make test
5144

5245
Execute full tests suite with coverage::
5346

54-
$ make cov
47+
$ uv run make cov
5548

5649
To run individual use following command::
5750

58-
$ pytest -sv tests/test_monitor.py -k test_name
51+
$ uv run pytest -sv tests/test_monitor.py -k test_name
5952

6053

6154
Reporting an Issue

pyproject.toml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,45 @@ boto3 = [
5353
Repository = "https://github.com/aio-libs/aiobotocore"
5454
Documentation = "https://aiobotocore.aio-libs.org"
5555

56+
[dependency-groups]
57+
botocore-dev = [
58+
# keep in sync with https://github.com/boto/botocore/blob/develop/requirements-dev.txt
59+
# "wheel==0.43.0",
60+
# "behave==1.2.5",
61+
# "jsonschema==4.21.1",
62+
"coverage==7.2.7",
63+
# "setuptools==71.1.0;python_version>='3.12'",
64+
# "packaging==24.1;python_version>='3.12'", # Requirement for setuptools>=71
65+
66+
# Pytest specific deps
67+
"pytest==8.1.1",
68+
"pytest-cov==5.0.0",
69+
"pytest-xdist==3.5.0",
70+
# "atomicwrites>=1.0", # Windows requirement
71+
# "colorama>0.3.0", # Windows requirement
72+
]
73+
dev = [
74+
"dill ~=0.3.3", # Used in test_patches.py
75+
"docker ~=7.1",
76+
"docutils ~=0.16", # Used in test_version.py
77+
"moto[server,s3,sqs,awslambda,dynamodb,cloudformation,sns,batch,ec2,rds] ~=4.2.9",
78+
"packaging ~=24.1", # Used in test_version.py
79+
"pip ~=24.3.1", # Used in test_version.py
80+
"pre-commit ~=3.5.0",
81+
"pytest-asyncio ~=0.23.8",
82+
"requests ~=2.32.3", # Used in test_version.py
83+
"time-machine ~=2.15.0", # Used in test_signers.py
84+
"tomli; python_version<'3.11'", # Used in test_version.py
85+
"werkzeug ~=3.0.6", # Used in moto_server.py
86+
]
87+
88+
[tool.uv]
89+
default-groups = [
90+
"botocore-dev",
91+
"dev",
92+
]
93+
required-version = ">=0.5.14"
94+
5695
[tool.setuptools.dynamic]
5796
version = { attr = "aiobotocore.__version__" }
5897
readme = { file = ["README.rst", "CHANGES.rst"] }

requirements-dev.in

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

0 commit comments

Comments
 (0)