Skip to content

Commit 727869e

Browse files
authored
Merge pull request #6 from youtux/ab/switch-to-uv
Switch to `uv` for project management
2 parents b055785 + c4f1268 commit 727869e

File tree

7 files changed

+480
-577
lines changed

7 files changed

+480
-577
lines changed

.envrc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,18 @@
1-
layout poetry
1+
# https://github.com/direnv/direnv/wiki/Python#uv
2+
layout_uv() {
3+
if [[ -d ".venv" ]]; then
4+
VIRTUAL_ENV="$(pwd)/.venv"
5+
fi
6+
7+
if [[ -z $VIRTUAL_ENV || ! -d $VIRTUAL_ENV ]]; then
8+
log_status "No virtual environment exists. Executing \`uv venv\` to create one."
9+
uv venv
10+
VIRTUAL_ENV="$(pwd)/.venv"
11+
fi
12+
13+
PATH_add "$VIRTUAL_ENV/bin"
14+
export UV_ACTIVE=1 # or VENV_ACTIVE=1
15+
export VIRTUAL_ENV
16+
}
17+
18+
layout_uv

.github/workflows/main.yml

Lines changed: 24 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,6 @@ jobs:
1111
strategy:
1212
matrix:
1313
include:
14-
- python-version: "3.7"
15-
toxfactor: py37
16-
ignore-typecheck-outcome: false
17-
ignore-test-outcome: false
18-
# `typed-ast` is not available for PyPy 3.7 (required by mypy)
19-
# - python-version: "pypy3.7"
20-
# toxfactor: py37
21-
# ignore-typecheck-outcome: false
22-
# ignore-test-outcome: true
23-
- python-version: "3.8"
24-
toxfactor: py38
25-
ignore-typecheck-outcome: false
26-
ignore-test-outcome: false
27-
- python-version: "pypy3.8"
28-
toxfactor: py38
29-
ignore-typecheck-outcome: false
30-
ignore-test-outcome: true
3114
- python-version: "3.9"
3215
toxfactor: py39
3316
ignore-typecheck-outcome: false
@@ -40,44 +23,46 @@ jobs:
4023
toxfactor: py310
4124
ignore-typecheck-outcome: false
4225
ignore-test-outcome: false
26+
- python-version: "pypy3.10"
27+
toxfactor: pypy310
28+
ignore-typecheck-outcome: false
29+
ignore-test-outcome: true
4330
- python-version: "3.11"
4431
toxfactor: py311
4532
ignore-typecheck-outcome: false
4633
ignore-test-outcome: false
47-
- python-version: "3.12-dev"
48-
toxfactor: py312
34+
- python-version: "pypy3.11"
35+
toxfactor: pypy311
4936
ignore-typecheck-outcome: false
5037
ignore-test-outcome: true
51-
38+
- python-version: "3.12"
39+
toxfactor: py312
40+
ignore-typecheck-outcome: false
41+
ignore-test-outcome: false
42+
- python-version: "3.13"
43+
toxfactor: py313
44+
ignore-typecheck-outcome: false
45+
ignore-test-outcome: false
5246

5347
steps:
5448
- uses: actions/checkout@v3
5549

50+
- name: Install uv
51+
uses: astral-sh/setup-uv@v5
52+
with:
53+
# Install a specific version of uv.
54+
version: "0.6.2"
55+
enable-cache: 'true'
56+
5657
- name: Set up Python ${{ matrix.python-version }}
57-
uses: actions/setup-python@v4
58+
uses: actions/setup-python@v5
5859
id: setup-python
5960
with:
6061
python-version: ${{ matrix.python-version }}
6162

62-
- name: Install poetry
63-
run: |
64-
python -m pip install poetry==1.3.1
65-
66-
- name: Configure poetry
67-
run: |
68-
python -m poetry config virtualenvs.in-project true
69-
70-
- name: Cache the virtualenv
71-
id: poetry-dependencies-cache
72-
uses: actions/cache@v3
73-
with:
74-
path: ./.venv
75-
key: ${{ runner.os }}-venv-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
76-
7763
- name: Install dev dependencies
78-
if: steps.poetry-dependencies-cache.outputs.cache-hit != 'true'
7964
run: |
80-
python -m poetry install --only=dev
65+
uv sync --group dev
8166
8267
- name: Type checking
8368
# Ignore errors for older pythons
@@ -100,5 +85,5 @@ jobs:
10085
# Explicitly using the token in order to avoid Codecov rate limit errors
10186
# See https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954
10287
token: ${{ secrets.CODECOV_TOKEN }}
103-
fail_ci_if_error: true
88+
fail_ci_if_error: false
10489
verbose: true # optional (default = false)

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2222

2323
## [Unreleased]
2424

25+
### Added
26+
27+
- Add compatibility with python 3.13.
28+
29+
### Changed
30+
31+
- Using `uv` as the project manager
32+
33+
### Deprecated
34+
35+
### Removed
36+
37+
- Drop compatibility with python 3.7 and 3.8. Supported versions are now 3.9, 3.10, 3.11, 3.12.
38+
39+
### Fixed
40+
41+
### Security
42+
2543
## [0.3.1] - 2023-02-27
2644

2745
### Fixed

0 commit comments

Comments
 (0)