Skip to content

Commit c562ea9

Browse files
committed
Modernize: adopt uv, ruff, black; drop Python 2
1 parent ea76071 commit c562ea9

17 files changed

Lines changed: 358 additions & 682 deletions

.github/workflows/publish.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,23 @@ on:
66

77
jobs:
88
deploy:
9-
109
runs-on: ubuntu-latest
11-
10+
permissions:
11+
id-token: write
12+
contents: read
13+
1214
steps:
13-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v4
19+
1420
- name: Set up Python
15-
uses: actions/setup-python@v2
16-
with:
17-
python-version: '3.x'
18-
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install setuptools wheel twine
22-
- name: Build python package
23-
run: |
24-
python setup.py sdist bdist_wheel
21+
run: uv python install 3.12
22+
23+
- name: Build package
24+
run: uv build
25+
2526
- name: Publish package
26-
uses: pypa/gh-action-pypi-publish@v1.4.2
27-
with:
28-
user: __token__
29-
password: ${{ secrets.PYPI_API_TOKEN }}
30-
skip_existing: true
31-
verbose: true
27+
uses: pypa/gh-action-pypi-publish@release/v1
28+

.github/workflows/pytest-python2.yml

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

.github/workflows/pytest.yml

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "pytest:py3 "
1+
name: "pytest"
22

33
on:
44
push:
@@ -8,36 +8,38 @@ on:
88
branches: [ master ]
99

1010
jobs:
11-
build:
12-
13-
runs-on: ${{ matrix.os }}
14-
strategy:
15-
matrix:
16-
python-version: [3.7, 3.8, 3.9]
17-
os: [ubuntu-latest, macOS-latest]
11+
test:
12+
runs-on: ubuntu-latest
1813

1914
steps:
20-
- uses: actions/checkout@v2
21-
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v2
15+
- uses: actions/checkout@v4
16+
17+
- name: Install uv
18+
uses: astral-sh/setup-uv@v4
2319
with:
24-
python-version: ${{ matrix.python-version }}
20+
enable-cache: true
21+
22+
- name: Set up Python 3.12
23+
run: uv python install 3.12
24+
2525
- name: Install dependencies
2626
run: |
27-
python -m pip install --upgrade pip
28-
python -m pip install wheel flake8 pytest pytest-cov
29-
pip install -r requirements.txt
30-
- name: Lint with flake8
27+
uv sync --all-extras
28+
29+
- name: Lint with ruff
30+
run: |
31+
uv run ruff check .
32+
33+
- name: Check formatting with black
3134
run: |
32-
# stop the build if there are Python syntax errors or undefined names
33-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
35+
uv run black --check .
36+
3637
- name: Test with pytest
3738
run: |
38-
pytest -v --cov=pingping
39+
uv run pytest
40+
3941
- name: Upload coverage
40-
uses: codecov/codecov-action@v1
42+
uses: codecov/codecov-action@v4
4143
with:
4244
name: ${{ matrix.os }} Python ${{ matrix.python-version }}
4345
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ profile_default/
8282
ipython_config.py
8383

8484
# pyenv
85-
.python-version
85+
# .python-version # Now used by uv, don't ignore
8686

8787
# celery beat schedule file
8888
celerybeat-schedule
@@ -117,6 +117,12 @@ dmypy.json
117117
# Pyre type checker
118118
.pyre/
119119

120+
# uv
121+
.uv/
122+
uv.lock
123+
124+
# Ruff
125+
.ruff_cache/
120126

121127
# editor
122128
.idea

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

MANIFEST.in

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

Pipfile

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

0 commit comments

Comments
 (0)