Skip to content

Commit

Permalink
Merge pull request #126 from narumiruna/uv
Browse files Browse the repository at this point in the history
migrate to uv
  • Loading branch information
narumiruna authored Oct 25, 2024
2 parents 8eb58e2 + bb23c39 commit 8d8df3f
Show file tree
Hide file tree
Showing 9 changed files with 401 additions and 491 deletions.
14 changes: 6 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ jobs:
strategy:
matrix:
python-version: ["3.11"]
poetry-version: ["1.8.3"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
- uses: narumiruna/setup-poetry@v1
with:
poetry-version: ${{ matrix.poetry-version }}
enable-cache: true
- name: Install Python
run: uv python install ${{ matrix.python-version }}
- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry build -f wheel
poetry publish -u __token__ -p $PYPI_TOKEN
uv build --wheel
uv publish --token $PYPI_TOKEN
18 changes: 8 additions & 10 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,21 @@ jobs:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
poetry-version: ["1.8.3"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@v3
with:
python-version: ${{ matrix.python-version }}
- uses: narumiruna/setup-poetry@v1
with:
poetry-version: ${{ matrix.poetry-version }}
enable-cache: true
- name: Install Python
run: uv python install ${{ matrix.python-version }}
- name: Install dependencies
run: poetry install
run: uv sync
- name: Lint
run: poetry run ruff check .
run: uv run ruff check .
- name: Type check
run: poetry run mypy --install-types --non-interactive .
run: uv run mypy --install-types --non-interactive .
- name: Test
run: poetry run pytest -v -s --cov=mlconfig --cov-report=xml tests
run: uv run pytest -v -s --cov=src --cov-report=xml tests
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
install:
poetry install

lint:
poetry run ruff check .
uv run ruff check .

type:
uv run mypy --install-types --non-interactive .

test:
poetry run pytest -v -s --cov=mlconfig tests
uv run pytest -v -s --cov=src tests

publish:
poetry build -f wheel
poetry publish
uv build --wheel
uv publish

.PHONY: lint test publish
443 changes: 0 additions & 443 deletions poetry.lock

This file was deleted.

40 changes: 17 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
[tool.poetry]
[project]
name = "mlconfig"
version = "0.2.2"
description = ""
authors = ["narumi <toucans-cutouts0f@icloud.com>"]
license = "MIT"

[tool.poetry.dependencies]
python = "^3.9"
omegaconf = "^2.3.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.3.3"
pytest-cov = "^5.0.0"
ruff = "^0.7.1"
toml = "^0.10.2"
mypy = "^1.13.0"


[tool.poetry.group.mypy.dependencies]
types-pyyaml = "^6.0.12.20240917"
types-pygments = "^2.18.0.20240506"
types-colorama = "^0.4.15.20240311"
types-setuptools = "^75.2.0.20241019"
readme = "README.md"
authors = [{ name = "narumi", email = "toucans-cutouts0f@icloud.com" }]
requires-python = ">=3.9"
dependencies = ["omegaconf>=2.3.0"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.uv]
dev-dependencies = [
"mypy>=1.13.0",
"pip>=24.2",
"pytest>=8.3.3",
"pytest-cov>=5.0.0",
"ruff>=0.7.1",
"toml>=0.10.2",
]

[tool.ruff]
exclude = ["build"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
363 changes: 363 additions & 0 deletions uv.lock

Large diffs are not rendered by default.

0 comments on commit 8d8df3f

Please sign in to comment.