Skip to content

Commit 8d9de0f

Browse files
authored
Merge pull request #198 from libranet/poetry-to-uv
switch to uv
2 parents 116910f + 7cf8783 commit 8d9de0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2332
-3275
lines changed

.env.example renamed to .env.template

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
BASE_DIR="__CWD__"
3333

3434
# caching
35-
BLACK_CACHE_DIR="__CWD__/var/cache/black"
3635
PYLINTHOME="__CWD__/var/cache/pylint"
3736

3837
# tmp-dir

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ updates:
88
- package-ecosystem: "pip" # See documentation for possible values
99
directory: "/" # Location of package manifests
1010
schedule:
11-
interval: "weekly"
11+
interval: "monthly" # daily|weekly|monthly

.github/workflows/linting.yaml

Lines changed: 100 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Linting
22

3-
env:
4-
POETRY_VERSION: "1.8.4"
3+
# env:
4+
# POETRY_VERSION: "1.8.4"
55

66
on:
77
pull_request:
@@ -13,52 +13,106 @@ on:
1313
permissions:
1414
contents: read
1515

16+
1617
jobs:
18+
# see https://docs.astral.sh/uv/guides/integration/github/
1719
run-tests:
1820
name: Python linters
1921
runs-on: ubuntu-latest
20-
timeout-minutes: 5
21-
22+
strategy:
23+
matrix:
24+
python-version:
25+
- "3.8"
26+
- "3.9"
27+
- "3.10"
28+
- "3.11"
29+
- "3.12"
30+
- "3.13"
2231
steps:
23-
- uses: actions/checkout@v3
24-
with:
25-
persist-credentials: false
26-
fetch-depth: 0
27-
28-
- name: Set up Python 3.12
29-
uses: actions/setup-python@v4
30-
with:
31-
python-version: "3.12"
32-
33-
- name: Set up Poetry
34-
run: |
35-
pip install poetry==${{ env.POETRY_VERSION }}
36-
37-
- name: Install
38-
run: |
39-
make install
40-
41-
- name: Flake8
42-
run: |
43-
make flake8
44-
45-
- name: Ruff
46-
run: |
47-
make ruff-check
48-
49-
- name: Pylint
50-
run: |
51-
make pylint
52-
53-
- name: Mypy
54-
run: |
55-
make mypy
56-
57-
- name: Pyroma
58-
run: |
59-
make pyroma
60-
61-
- name: Check poetry
62-
run: |
63-
make poetry-check
64-
make poetry-lock-check
32+
- uses: actions/checkout@v4
33+
34+
- name: Install the latest version of uv
35+
uses: astral-sh/setup-uv@v5
36+
with:
37+
version: "latest"
38+
39+
# - name: Set up Python
40+
# run: uv python install
41+
42+
# - name: "Set up Python"
43+
# uses: actions/setup-python@v5
44+
# with:
45+
# python-version-file: ".python-version"
46+
47+
# - name: "Set up Python"
48+
# uses: actions/setup-python@v5
49+
# with:
50+
# python-version-file: "pyproject.toml"
51+
52+
- name: Set up Python ${{ matrix.python-version }}
53+
run: uv python install ${{ matrix.python-version }}
54+
55+
- name: Install the project
56+
run: uv sync --all-extras --dev
57+
58+
- name: Ruff check
59+
run: uv run ruff check .
60+
61+
- name: Flake8 check
62+
run: uv run flake8 src
63+
64+
# - name: Pylint
65+
# run: uv run pylint src
66+
67+
- name: Pyroma
68+
run: uv run pyroma .
69+
70+
# jobs:
71+
# run-tests:
72+
# name: Python linters
73+
# runs-on: ubuntu-latest
74+
# timeout-minutes: 5
75+
76+
# steps:
77+
# - uses: actions/checkout@v3
78+
# with:
79+
# persist-credentials: false
80+
# fetch-depth: 0
81+
82+
# - name: Set up Python 3.12
83+
# uses: actions/setup-python@v4
84+
# with:
85+
# python-version: "3.12"
86+
87+
# - name: Set up Poetry
88+
# run: |
89+
# pip install poetry==${{ env.POETRY_VERSION }}
90+
91+
# - name: Install
92+
# run: |
93+
# just install
94+
95+
# - name: Flake8
96+
# run: |
97+
# just flake8
98+
99+
# - name: Ruff
100+
# run: |
101+
# just ruff-check
102+
103+
# - name: Pylint
104+
# run: |
105+
# just pylint
106+
107+
# - name: Mypy
108+
# run: |
109+
# just mypy
110+
111+
# - name: Pyroma
112+
# run: |
113+
# just pyroma
114+
115+
# - name: Check poetry
116+
# run: |
117+
# just poetry-check
118+
# just poetry-lock-check

.github/workflows/testing.yaml

Lines changed: 101 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -30,60 +30,112 @@ concurrency:
3030
group: ${{ github.workflow }}-${{ github.ref }}
3131
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
3232

33+
3334
jobs:
35+
# see https://docs.astral.sh/uv/guides/integration/github/
3436
python-tests:
35-
name: Python tests
36-
runs-on: ${{ matrix.os }}
37-
timeout-minutes: 10
37+
name: python
38+
runs-on: ubuntu-latest
3839

3940
strategy:
40-
fail-fast: false
4141
matrix:
42-
os:
43-
- ubuntu-latest
4442
python-version:
45-
- "3.8"
46-
- "3.9"
47-
- "3.10"
48-
- "3.11"
49-
- "3.12"
50-
# include:
51-
# # Run 3.12 tests with relaxed constraints
52-
# - python-version: "3.12-dev"
53-
# relax: true # ??
43+
- "3.8"
44+
- "3.9"
45+
- "3.10"
46+
- "3.11"
47+
- "3.12"
48+
- "3.13"
5449

5550
steps:
56-
- uses: actions/checkout@v3
57-
with:
58-
persist-credentials: false
59-
fetch-depth: 0
60-
61-
- name: Set up Python ${{ matrix.python-version }}
62-
uses: actions/setup-python@v4
63-
with:
64-
python-version: ${{ matrix.python-version }}
65-
# TODO: This appears to require poetry to be installed before usage
66-
# cache: "poetry"
67-
68-
- name: Set up Poetry
69-
run: |
70-
pip install poetry==${{ env.POETRY_VERSION }}
71-
72-
- name: Install packages
73-
run: |
74-
make install
75-
76-
- name: Run tests with coverage
77-
run: |
78-
make pytest-cov
79-
80-
# https://github.com/codecov/codecov-action
81-
- name: "Upload coverage to Codecov"
82-
uses: codecov/codecov-action@v3
83-
with:
84-
fail_ci_if_error: false # optional (default = false)
85-
# files: var/coverage/coverage.xml, # optional
86-
directory: var/coverage
87-
flags: unittests # optional
88-
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
89-
verbose: true # optional (default = false)
51+
- uses: actions/checkout@v4
52+
53+
- name: Install the latest version of uv
54+
uses: astral-sh/setup-uv@v5
55+
with:
56+
version: "latest"
57+
58+
# - name: Set up Python
59+
# run: uv python install
60+
61+
# - name: "Set up Python"
62+
# uses: actions/setup-python@v5
63+
# with:
64+
# python-version-file: ".python-version"
65+
66+
# - name: "Set up Python"
67+
# uses: actions/setup-python@v5
68+
# with:
69+
# python-version-file: "pyproject.toml"
70+
71+
- name: Set up Python ${{ matrix.python-version }}
72+
run: uv python install ${{ matrix.python-version }}
73+
74+
- name: Install the project
75+
run: uv sync --all-extras --dev
76+
77+
- name: Run tests
78+
# For example, using `pytest`
79+
# run: uv run pytest tests
80+
run: uv run pytest tests --cov=src --cov-report html --cov-report xml --cov-report term -v
81+
82+
83+
# jobs:
84+
# python-tests:
85+
# name: Python tests
86+
# runs-on: ${{ matrix.os }}
87+
# timeout-minutes: 10
88+
89+
# strategy:
90+
# fail-fast: false
91+
# matrix:
92+
# os:
93+
# - ubuntu-latest
94+
# python-version:
95+
# - "3.8"
96+
# - "3.9"
97+
# - "3.10"
98+
# - "3.11"
99+
# - "3.12"
100+
# # include:
101+
# # # Run 3.12 tests with relaxed constraints
102+
# # - python-version: "3.12-dev"
103+
# # relax: true # ??
104+
105+
# steps:
106+
# - uses: actions/checkout@v3
107+
# with:
108+
# persist-credentials: false
109+
# fetch-depth: 0
110+
111+
# - name: Set up Python ${{ matrix.python-version }}
112+
# uses: actions/setup-python@v4
113+
# with:
114+
# python-version: ${{ matrix.python-version }}
115+
# # TODO: This appears to require poetry to be installed before usage
116+
# # cache: "poetry"
117+
118+
# - name: Set up Poetry
119+
# run: |
120+
# pip install poetry==${{ env.POETRY_VERSION }}
121+
122+
# - name: Install packages
123+
# run: |
124+
# just install
125+
126+
# - name: Run tests with coverage
127+
# run: |
128+
# just pytest-cov
129+
130+
# # https://github.com/codecov/codecov-action
131+
# - name: "Upload coverage to Codecov"
132+
# uses: codecov/codecov-action@v3
133+
# with:
134+
# fail_ci_if_error: false # optional (default = false)
135+
# # files: var/coverage/coverage.xml, # optional
136+
# directory: var/coverage
137+
# flags: unittests # optional
138+
# token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
139+
# verbose: true # optional (default = false)
140+
141+

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,3 @@
4242

4343
# exclude generated python-files Byte-compiled / optimized / DLL files
4444
__pycache__/
45-
46-
# makefile
47-
targets.log
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
# See ../makefile
1+
# See ../justfile
22

3-
.PHONY: create-dirs ## initialize dir-structure, create dirs
3+
4+
# initialize dir-structure, create dirs
5+
[group: 'dir-structure']
46
create-dirs:
57
@echo -e "In current working dir: ${PWD}"
68
mkdir -p var ;\
@@ -10,9 +12,10 @@ create-dirs:
1012
mkdir -p var/tmp
1113

1214

13-
.PHONY: symlink-venv-dirs ## symlinks to venv-dirs to make bin/python work
15+
# symlinks to venv-dirs to make bin/python work
16+
[group: 'dir-structure']
1417
symlink-venv-dirs:
1518
ln -sf ${VENV_DIR}/bin ;\
1619
ln -sf ${VENV_DIR}/lib ;\
17-
ln -sf ${VENV_DIR}/lib64 ;\
20+
# ln -sf ${VENV_DIR}/lib64 ;\
1821
ln -sf ${VENV_DIR}/pyvenv.cfg

0 commit comments

Comments
 (0)