Skip to content

Commit

Permalink
Migrate to uv/pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
gouline committed Aug 29, 2024
1 parent 371bdf7 commit 8977e61
Show file tree
Hide file tree
Showing 9 changed files with 807 additions and 80 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: "3.8.18"
python-version: "3.8"

- name: Requirements
run: make requirements
- name: Install uv
run: pipx install uv

- name: Dependencies
run: make dependencies

- name: Build
run: make build
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ jobs:
with:
python-version: "3.8"

- uses: actions/cache@v3
- name: Install uv
run: pipx install uv

- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/requirements-test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/uv.lock') }}

- name: Requirements
run: make requirements
- name: Dependencies
run: make dependencies

- name: Build
run: make build
Expand Down
4 changes: 0 additions & 4 deletions MANIFEST.in

This file was deleted.

26 changes: 12 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,36 +1,34 @@
build: clean
python3 -m build
uv run python3 -m build
.PHONY: build

clean:
rm -rf build dist
.PHONY: clean

requirements:
python3 -m pip install \
-r requirements.txt \
-r requirements-test.txt
.PHONY: requirements
dependencies:
uv sync --frozen --no-install-project
.PHONY: dependencies

fix:
ruff format .
ruff check --fix .
uv run ruff format .
uv run ruff check --fix .
.PHONY: fix

check-lint:
ruff format --check .
ruff check .
uv run ruff format --check .
uv run ruff check .
.PHONY: check-lint

check-type:
mypy molot
uv run mypy molot
.PHONY: check-type

check: check-lint check-type
.PHONY: check

test:
pytest tests
uv run pytest tests
.PHONY: test

pre: fix check test
Expand All @@ -45,9 +43,9 @@ dist-upload: check
.PHONY: dist-upload

dev-uninstall:
python3 -m pip uninstall -y molot
uv run python3 -m pip uninstall -y molot
.PHONY: dev-uninstall

dev-install: build dev-uninstall
python3 -m pip install dist/molot-*-py3-none-any.whl
uv pip install dist/molot-*-py3-none-any.whl
.PHONY: dev-install
38 changes: 37 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=60", "setuptools-scm"]

[project]
name = "molot"
description = "Simple execution orchestrator."
readme = "README.md"
requires-python = ">=3.8"
dependencies = ["python-dotenv>=1.0.0"]
dynamic = ["version"]
license = { text = "MIT License" }
authors = [{ name = "Mike Gouline" }]
classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
]

[project.urls]
Homepage = "https://github.com/gouline/molot"

[tool.uv]
dev-dependencies = [
"build>=1.0.3",
"twine>=4.0.2",
"ruff>=0.5.5",
"mypy>=1.7.1",
"pytest>=8.3.1",
]

[tool.setuptools_scm]
version_file = "molot/_version.py"
Expand Down
6 changes: 0 additions & 6 deletions requirements-test.txt

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt

This file was deleted.

44 changes: 0 additions & 44 deletions setup.py

This file was deleted.

Loading

0 comments on commit 8977e61

Please sign in to comment.