Skip to content

Migrate from Makefile to PDM scripts for better Python development experience #111

Open
@rudeigerc

Description

@rudeigerc

The project currently utilizes a Makefile to manage dependencies, testing processes, and other project workflows based on related binaries in the virtual environment. PDM provides some powerful features such as standalone Python interpreters and PDM scripts. It would be great if we could leverage the power of PDM for a better development experience. Looking forward to the feedback :)

Development

For newcomers, they can easily install a Python interpreter that matches the project requirement according to pyproject.toml with only PDM installed.

pdm python install --min

And sync the requirements with auto-generated virtual environment:

pdm sync

Then users could start the development journey without worrying about the Python interpreters and virtual environments.

Linting and Testing

Here is an example of PDM scripts with lint:

Before:

.PHONY: lint
lint:
	@echo "Linting Python files with ruff check..."
	$(VENV)/bin/ruff check

After:

[tool.pdm.scripts]
check = "ruff check ."
fmt = "ruff format ."

Use pdm run check to lint Python files.

Metadata

Metadata

Assignees

Labels

kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions