-
Notifications
You must be signed in to change notification settings - Fork 2
Description
This project currently uses a requirements.txt
file for specifying dependencies, and politely tells us students to create a virtual environment.
That is absolutely the correct way of doing it today. 🎉
However, the requirements.txt
file comes with a number of shortcomings (main one being that there's no separation between "dependencies that I'm using" and "dependencies of dependencies")1.
The Python world is currently fixing this, by very recently having adopted
pyproject.toml
: Direct dependencies and Python version go in here.- PEP 751, a standardized lockfile: All dependencies, with their exact versions go in here. This was adopted less than a month ago!
Those files are currently being implemented in the various Python package managers. Notably
- UV implements them today Add support for PEP 751 lockfiles astral-sh/uv#12584
- Pip is going to implement them Implement installation from PEP 751 aka standardized lockfiles pypa/pip#13334
With that in mind, I would love it if eventually, we would be using a pyproject.toml
in this repository!
Big Limitation
One of the dependencies is no longer in active development, and does not work with the new pyproject.toml
standard. It seems like it won't ever be updated.
rusty1s/pytorch_cluster#185
Tangential Note
On that note, if you haven't tried out uv for Python, I can wholeheartedly recommend it. It's super fast, implements official Python standards, and automatically creates virtual environments. ✨
With that, the whole step instructions in the Readme can be shortened down to:
- Install UV
- Install all necessary dependencies with
uv sync
- Run the code with
uv run make_dataset.py
(or select the interpreter in Pycharm, as per usual)
Footnotes
-
If that dependency management stuff doesn't immediately make sense, I'm happy to properly explain it. ↩