Skip to content

Commit ec95ea9

Browse files
authored
Merge pull request #226 from mosquito/feautre/use-uv-and-ruff
Use UV and Ruff
2 parents d3e0387 + 5e898a7 commit ec95ea9

File tree

13 files changed

+1605
-1485
lines changed

13 files changed

+1605
-1485
lines changed

.coveragerc

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

.github/workflows/publish.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
FORCE_COLOR: 1
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v6
15+
- uses: astral-sh/setup-uv@v5
16+
17+
- name: Set version from release tag
18+
run: uv version "${GITHUB_REF_NAME#v}"
19+
20+
- name: Build package
21+
run: uv build
22+
23+
- uses: actions/upload-artifact@v4
24+
with:
25+
name: dist
26+
path: dist/
27+
28+
publish:
29+
runs-on: ubuntu-latest
30+
needs: build
31+
environment: pypi
32+
permissions:
33+
id-token: write
34+
steps:
35+
- uses: actions/download-artifact@v4
36+
with:
37+
name: dist
38+
path: dist/
39+
40+
- uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,30 @@ on:
99

1010

1111
jobs:
12-
pylama:
12+
ruff:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v6
1616
- name: Setup python3.10
17-
uses: actions/setup-python@v2
17+
uses: actions/setup-python@v6
1818
with:
1919
python-version: "3.10"
20-
- name: Cache virtualenv
21-
id: venv-cache
22-
uses: actions/cache@v3
23-
with:
24-
path: .venv
25-
key: venv-${{ runner.os }}-${{ github.job }}-${{ github.ref }}
26-
- run: python -m pip install poetry
27-
- run: poetry install
28-
- run: poetry run pylama
20+
- uses: astral-sh/setup-uv@v5
21+
- run: uv sync
22+
- run: uv run ruff check
2923
env:
3024
FORCE_COLOR: 1
3125
mypy:
3226
runs-on: ubuntu-latest
3327
steps:
34-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v6
3529
- name: Setup python3.10
36-
uses: actions/setup-python@v2
30+
uses: actions/setup-python@v6
3731
with:
3832
python-version: "3.10"
39-
- name: Cache virtualenv
40-
id: venv-cache
41-
uses: actions/cache@v3
42-
with:
43-
path: .venv
44-
key: venv-${{ runner.os }}-${{ github.job }}-${{ github.ref }}
45-
- run: python -m pip install poetry
46-
- run: poetry install
47-
- run: poetry run mypy
33+
- uses: astral-sh/setup-uv@v5
34+
- run: uv sync
35+
- run: uv run mypy
4836
env:
4937
FORCE_COLOR: 1
5038
docs:
@@ -53,24 +41,21 @@ jobs:
5341
rabbitmq:
5442
image: docker://mosquito/aiormq-rabbitmq
5543
ports:
56-
- 5672:5672
5744
- 5671:5671
45+
- 5672:5672
46+
- 15671:15671
47+
- 15672:15672
5848
steps:
59-
- uses: actions/checkout@v2
49+
- uses: actions/checkout@v6
6050
- name: Setup python3.10
61-
uses: actions/setup-python@v2
51+
uses: actions/setup-python@v6
6252
with:
6353
python-version: "3.10"
64-
- name: Cache virtualenv
65-
id: venv-cache
66-
uses: actions/cache@v3
67-
with:
68-
path: .venv
69-
key: venv-${{ runner.os }}-${{ github.job }}-${{ github.ref }}
70-
- run: python -m pip install poetry
71-
- run: poetry install
72-
- run: poetry run pytest -svv README.rst
54+
- uses: astral-sh/setup-uv@v5
55+
- run: uv sync
56+
- run: uv run pytest -svv README.rst
7357
env:
58+
AMQP_URL: amqp://guest:guest@localhost//
7459
FORCE_COLOR: 1
7560

7661
tests:
@@ -80,8 +65,10 @@ jobs:
8065
rabbitmq:
8166
image: docker://mosquito/aiormq-rabbitmq
8267
ports:
83-
- 5672:5672
8468
- 5671:5671
69+
- 5672:5672
70+
- 15671:15671
71+
- 15672:15672
8572

8673
strategy:
8774
fail-fast: false
@@ -94,31 +81,26 @@ jobs:
9481
- '3.13'
9582
- '3.14'
9683
steps:
97-
- uses: actions/checkout@v2
84+
- uses: actions/checkout@v6
9885
- name: Setup python${{ matrix.python }}
99-
uses: actions/setup-python@v2
86+
uses: actions/setup-python@v6
10087
with:
10188
python-version: "${{ matrix.python }}"
102-
- name: Cache virtualenv
103-
id: venv-cache
104-
uses: actions/cache@v3
105-
with:
106-
path: .venv
107-
key: venv-${{ runner.os }}-${{ github.job }}-${{ github.ref }}-${{ matrix.python }}
108-
- run: python -m pip install poetry
109-
- run: poetry install --with=uvloop
89+
- uses: astral-sh/setup-uv@v5
90+
- run: uv sync --group uvloop
11091
- name: pytest
11192
run: >-
112-
poetry run pytest \
93+
uv run pytest \
11394
-vv \
11495
--cov=aiormq \
11596
--cov-report=term-missing \
11697
--doctest-modules \
11798
--aiomisc-test-timeout=120 \
11899
tests
119100
env:
101+
AMQP_URL: amqp://guest:guest@localhost//
120102
FORCE_COLOR: 1
121-
- run: poetry run coveralls
103+
- run: uv run coveralls
122104
env:
123105
COVERALLS_PARALLEL: 'true'
124106
COVERALLS_SERVICE_NAME: github

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
all: clean test
22

3-
NAME:=$(shell poetry version -n | awk '{print $1}')
4-
VERSION:=$(shell poetry version -s)
53
RABBITMQ_CONTAINER_NAME:=aiormq_rabbitmq
64
RABBITMQ_IMAGE:=mosquito/aiormq-rabbitmq
75

@@ -16,14 +14,15 @@ rabbitmq:
1614
$(RABBITMQ_IMAGE)
1715

1816
upload:
19-
poetry publish --build --skip-existing
17+
uv build
18+
uv publish
2019

2120
test:
22-
poetry run pytest -vvx --cov=aiormq \
21+
uv run pytest -vvx --cov=aiormq \
2322
--cov-report=term-missing tests README.rst
2423

2524
clean:
2625
rm -fr *.egg-info .tox
2726

2827
develop: clean
29-
poetry install
28+
uv sync

gray.conf

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

0 commit comments

Comments
 (0)