Skip to content

Commit b1ee992

Browse files
authored
Merge pull request #182 from soumendrak/uv
add uv and ruff support
2 parents c02dc25 + bcc4923 commit b1ee992

29 files changed

+2860
-1186
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
version: 2
77
updates:
8-
- package-ecosystem: "pip" # See documentation for possible values
8+
- package-ecosystem: "pip" # uv uses standard pip ecosystem for dependabot
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "daily"

.github/workflows/codecov.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@ jobs:
66
strategy:
77
matrix:
88
os: [ubuntu-latest, macos-latest, windows-latest]
9+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
910
env:
1011
OS: ${{ matrix.os }}
11-
PYTHON: '3.9.12'
12+
PYTHON: ${{ matrix.python-version }}
1213
steps:
1314
- uses: actions/checkout@master
1415
- name: Setup Python
15-
uses: actions/setup-python@master
16+
uses: actions/setup-python@v4
1617
with:
17-
python-version: 3.9.12
18+
python-version: ${{ matrix.python-version }}
1819
- name: Install dependencies
1920
run: |
2021
python -m pip install -U pip
21-
pip install poetry && poetry install
22+
pip install uv && uv sync --all-extras
2223
- name: Generate coverage report
2324
run: |
24-
poetry run pytest --cov=./ --cov-report=xml
25+
uv run pytest --cov=./ --cov-report=xml
2526
- name: Upload coverage to Codecov
2627
uses: codecov/codecov-action@v2.1.0
2728
with:

.github/workflows/codequality.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,20 @@ on: [push]
55
jobs:
66
build-test:
77
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
811

912
steps:
1013
- uses: actions/checkout@v4
11-
- name: Set up Python 3.9
12-
uses: actions/setup-python@v2
14+
- name: Set up Python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v4
1316
with:
14-
python-version: "3.9"
17+
python-version: ${{ matrix.python-version }}
1518
- name: Install dependencies
1619
run: |
1720
python -m pip install --upgrade pip
18-
pip install poetry && poetry build
21+
pip install uv && uv build
1922
2023
# lint:
2124
# needs: build-test
@@ -30,28 +33,35 @@ jobs:
3033
code-quality:
3134
needs: build-test
3235
runs-on: ubuntu-latest
36+
strategy:
37+
matrix:
38+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
3339
steps:
3440
- uses: actions/checkout@v4
35-
- name: Set up Python 3.9
36-
uses: actions/setup-python@v2
41+
- name: Set up Python ${{ matrix.python-version }}
42+
uses: actions/setup-python@v4
3743
with:
38-
python-version: "3.9"
44+
python-version: ${{ matrix.python-version }}
3945

4046
- name: Install dependencies
4147
run: |
4248
python -m pip install --upgrade pip
43-
pip install poetry && poetry install
44-
- name: Lint with flake8
49+
pip install uv && uv sync --all-extras
50+
- name: Lint with ruff
4551
run: |
4652
# stop the build if there are Python syntax errors or undefined names
47-
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
48-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
49-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
53+
uv run ruff check --select=E9,F63,F7,F82 --statistics
54+
# Run full ruff linting
55+
uv run ruff check --statistics
56+
57+
- name: Check formatting with ruff
58+
run: |
59+
uv run ruff format --check
5060
5161
- name: Security Analysis with bandit
5262
run: |
5363
mkdir ci-logs
54-
poetry run bandit -r -lll -f txt -o ci-logs/bandit.log ./openodia ./tests
64+
uv run bandit -r -lll -f txt -o ci-logs/bandit.log ./openodia ./tests
5565
5666
- name: Archive bandit report
5767
uses: actions/upload-artifact@v4

.github/workflows/github-page.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ jobs:
1313
uses: actions/checkout@v4
1414

1515
- name: Set up Python 3.9
16-
uses: actions/setup-python@v2
16+
uses: actions/setup-python@v4
1717
with:
1818
python-version: '3.9'
1919

2020
- name: Install dependencies
2121
run: |
2222
python -m pip install --upgrade pip
23-
pip install poetry && poetry install
23+
pip install uv && uv sync --all-extras
2424
2525
- name: Deploy
2626
run: |
2727
git pull -r
28-
poetry run mkdocs gh-deploy
28+
uv run mkdocs gh-deploy

.github/workflows/release.yml

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,41 @@ on:
66
jobs:
77
Quality:
88
runs-on: ubuntu-latest
9+
strategy:
10+
matrix:
11+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
912
steps:
1013
- uses: actions/checkout@v4
11-
- uses: actions/setup-python@v2
14+
- uses: actions/setup-python@v4
1215
with:
13-
python-version: "3.9"
16+
python-version: ${{ matrix.python-version }}
1417

15-
- name: Configure poetry & Install dependencies
18+
- name: Configure uv & Install dependencies
1619
run: |
1720
python -m pip install --upgrade pip
18-
pip install poetry && poetry install
21+
pip install uv && uv sync --all-extras
1922
20-
- name: View poetry version
21-
run: poetry --version
23+
- name: View uv version
24+
run: uv --version
2225

23-
- name: Lint with flake8
26+
- name: Lint with ruff
2427
run: |
2528
# stop the build if there are Python syntax errors or undefined names
26-
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
27-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
28-
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
29+
uv run ruff check --select=E9,F63,F7,F82 --show-source --statistics
30+
# Run full ruff linting
31+
uv run ruff check --statistics
32+
33+
- name: Check formatting with ruff
34+
run: |
35+
uv run ruff format --check
2936
3037
- name: Security Analysis with bandit
3138
run: |
3239
# stop pipeline if level 3 vulnerability found
33-
poetry run bandit -r -lll ./openodia ./tests
40+
uv run bandit -r -lll ./openodia ./tests
3441
- name: Test with pytest
3542
run: |
36-
poetry run python -m pytest -v tests
43+
uv run python -m pytest -v tests
3744
3845
Release:
3946
needs: Quality

.pre-commit-config.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ repos:
66
repo: https://github.com/commitizen-tools/commitizen
77
rev: v2.20.0
88
- hooks:
9-
- id: black
10-
language_version: python3.9
11-
repo: https://github.com/ambv/black
12-
rev: 21.12b0
9+
- id: ruff
10+
types: [python]
11+
args: [--fix]
12+
- id: ruff-format
13+
types: [python]
14+
repo: https://github.com/astral-sh/ruff-pre-commit
15+
rev: v0.8.0
1316
# - repo: https://github.com/pre-commit/mirrors-mypy
1417
# rev: v0.910-1
1518
# hooks:

MIGRATION_TO_UV.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Migration to uv - Next Steps
2+
3+
This repository has been migrated from Poetry to uv. Here's what to do next:
4+
5+
## 1. Install uv
6+
```bash
7+
# Install uv (if not already installed)
8+
pip install uv
9+
```
10+
11+
## 2. Initialize uv project
12+
```bash
13+
# Navigate to project directory
14+
cd openodia
15+
16+
# Initialize uv and generate lock file
17+
uv sync --all-extras
18+
```
19+
20+
## 3. Common uv commands (replacements for poetry commands)
21+
22+
| Poetry Command | uv Equivalent |
23+
|---|---|
24+
| `poetry install` | `uv sync` |
25+
| `poetry install --extras dev` | `uv sync --all-extras` |
26+
| `poetry add package` | `uv add package` |
27+
| `poetry add --group dev package` | `uv add --dev package` |
28+
| `poetry remove package` | `uv remove package` |
29+
| `poetry run command` | `uv run command` |
30+
| `poetry build` | `uv build` |
31+
| `poetry shell` | `uv shell` |
32+
| `poetry lock` | `uv lock` |
33+
| `poetry show` | `uv tree` |
34+
35+
## 4. Development workflow
36+
```bash
37+
# Install all dependencies (including dev)
38+
uv sync --all-extras
39+
40+
# Run tests
41+
uv run pytest
42+
43+
# Run linting
44+
uv run ruff check
45+
46+
# Run formatting (if needed)
47+
uv run ruff format --check
48+
49+
# Run security analysis
50+
uv run bandit -r ./openodia ./tests
51+
52+
# Run linting and formatting
53+
uv run ruff check
54+
uv run ruff format --check
55+
56+
# Build documentation
57+
uv run mkdocs serve
58+
59+
# Build package
60+
uv build
61+
```
62+
63+
## 5. What changed
64+
65+
### Files modified:
66+
- `pyproject.toml` - Converted from Poetry format to standard Python project format
67+
- `.github/workflows/*` - Updated all CI/CD workflows to use uv
68+
- `poetry.lock` - Removed (will be replaced by `uv.lock`)
69+
70+
### Benefits of uv:
71+
- **Faster**: 10-100x faster than Poetry for dependency resolution
72+
- **Better lockfiles**: More deterministic dependency resolution
73+
- **Standards compliant**: Uses standard `pyproject.toml` format
74+
- **Modern**: Active development and frequent updates
75+
- **Compatible**: Drop-in replacement for most Poetry workflows
76+
77+
## 6. Verification
78+
After running `uv sync --all-extras`, verify everything works:
79+
```bash
80+
# Run tests
81+
uv run pytest
82+
83+
# Try importing the package
84+
uv run python -c "import openodia; print(openodia.__version__)"
85+
```
86+
87+
The migration preserves all functionality while making dependency management faster and more reliable.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h4 align="center">
44
<a href="https://img.shields.io/badge/Python-3.9-blue"><img alt="python 3.9" src="https://img.shields.io/badge/Python-3.9-blue"></a>
55
<a href="https://github.com/soumendrak/openodia/actions/workflows/codecov.yml"><img alt="Code coverage" src="https://github.com/soumendrak/openodia/actions/workflows/codecov.yml/badge.svg"></a>
6-
<a href="https://github.com/psf/black/blob/main/LICENSE"><img alt="License: MIT" src="https://black.readthedocs.io/en/stable/_static/license.svg"></a>
6+
<a href="https://github.com/soumendrak/openodia/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
77
<a href="https://codecov.io/gh/soumendrak/openodia"><img alt="code coverage" src="https://codecov.io/gh/soumendrak/openodia/branch/main/graph/badge.svg?token=1TOQIKGDQ2"/></a>
88
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fsoumendrak%2Fopenodia?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsoumendrak%2Fopenodia.svg?type=shield" alt="license"/></a>
99
<a href="https://pepy.tech/project/openodia" alt="downloads"><img src="https://static.pepy.tech/personalized-badge/openodia?period=total&units=none&left_color=black&right_color=orange&left_text=Downloads"/></a>

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h4 align="center">
44
<a href="https://img.shields.io/badge/Python-3.9-blue"><img alt="python 3.9" src="https://img.shields.io/badge/Python-3.9-blue"></a>
55
<a href="https://github.com/soumendrak/openodia/actions/workflows/codecov.yml"><img alt="Code coverage" src="https://github.com/soumendrak/openodia/actions/workflows/codecov.yml/badge.svg"></a>
6-
<a href="https://github.com/psf/black/blob/main/LICENSE"><img alt="License: MIT" src="https://black.readthedocs.io/en/stable/_static/license.svg"></a>
6+
<a href="https://github.com/soumendrak/openodia/blob/main/LICENSE"><img alt="License: MIT" src="https://img.shields.io/badge/License-MIT-yellow.svg"></a>
77
<a href="https://codecov.io/gh/soumendrak/openodia"><img alt="code coverage" src="https://codecov.io/gh/soumendrak/openodia/branch/main/graph/badge.svg?token=1TOQIKGDQ2"/></a>
88
<a href="https://app.fossa.com/projects/git%2Bgithub.com%2Fsoumendrak%2Fopenodia?ref=badge_shield" alt="FOSSA Status"><img src="https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsoumendrak%2Fopenodia.svg?type=shield" alt="license"/></a>
99
<a href="https://pepy.tech/project/openodia" alt="downloads"><img src="https://static.pepy.tech/personalized-badge/openodia?period=total&units=none&left_color=black&right_color=orange&left_text=Downloads"/></a>

openodia/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Open Odia language tools"""
22

3-
__version__ = "0.1.11"
3+
__version__ = "0.1.12"
44

55
from .common.constants import STOPWORDS
66
from ._letters import Letters as alphabet

0 commit comments

Comments
 (0)