Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pyproject.toml, pdm and ruff for improved reproducibility and cleaner code #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nizhib
Copy link

@nizhib nizhib commented Feb 22, 2024

@karpathy , thank you for another interesting educational project!

This MR introduces pyproject.toml file to handle project metadata and dependencies in accordance with PEP-6211.

Using it with pdm2 and its lock files is more reliable than an unversioned dependency list stored in requirements.txt.

It also adds a dev dependency for ruff3 linter and code formatter as well as the missing one for pytest.

All the simple issues discovered by ruff and markdownlint4 are resolved.

All the tests are still passing as the result of no semantic code changes have been done.

NB: One can also use ruff or nbQA5 on Jupyter Notebooks.

TODO: Add more Ruff rule sets like the one for type hints and resolve newly discovered issues.

Footnotes

  1. PEP 621 – Storing project metadata in pyproject.toml.

  2. PDM is a modern Python package and dependency manager supporting the latest PEP standards.

  3. Ruff – An extremely fast Python linter and code formatter, written in Rust.

  4. markdownlint – Markdown linting and style checking for Visual Studio Code.

  5. nbQA – Run ruff, isort, pyupgrade, mypy, pylint, flake8, black, blacken-docs, and more on Jupyter Notebooks .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant