Is your feature request related to a problem? Please describe
A faster and more modern package manager (in addition to other benefits) compared to conda is uv. For example, uv provides a single unified interface which makes managing dependencies easier, as opposed to conda which sometimes requires a mix of conda and pip.
Describe the solution you'd like
The following steps should be done:
Describe alternatives you've considered
N/A
Additional context (converting environment.yml into pyproject.toml)
To convert environment.yml into pyproject.toml, take the following example. SANDAG/HistoricalForecastError contains an environment.yml with roughly the following contents:
name: HistoricalError
channels:
- defaults
- https://repo.anaconda.com/pkgs/main
- https://repo.anaconda.com/pkgs/r
- https://repo.anaconda.com/pkgs/msys2
dependencies:
- blas=1.0=mkl
# Nearly 40 more lines of dependencies, version numbers, and checksum/sha values
- zlib=1.2.13=h8cc25b3_1
- pip:
- pymssql==2.3.2
The corresponding pyproject.toml would be:
[project]
name = "HistoricalForecastError" # Required
version = "0.0.0" # Required, can leave as "0.0.0" if none available
requires-python = ">=3.11"
dependencies = [
"pymssql>=2.3.2,<3.0.0",
]
Note that the dependency version has a minimum version so bug fixes can be automatically pulled, but is capped by a major version release, which is required when the interface changes (see Semantic Versioning)
Additional context (creating a uv environment and running code)
uv environments are built on top of Python's virtual environment, so all you need to do navigate to the project root and run in the command line
In order to run scripts in the newly created uv environment, simply do
uv will automatically enter the virtual environment, run a bunch of checks, and run the script for you, all at blazing fast speed
Additional context (what should and shouldn't be committed)
You should commit pyproject.toml and uv.lock, the later of which is automatically created when running uv sync. Note that uv will ensure that the environment and pyproject.toml are synced up, so anytime you do uv run {script}, uv will automatically update the environment and uv.lock with any changes to pyproject.toml
You should not commit the virtual environment folder (default .venv/). This should be skipped via the .gitigonre
Is your feature request related to a problem? Please describe
A faster and more modern package manager (in addition to other benefits) compared to
condaisuv. For example,uvprovides a single unified interface which makes managing dependencies easier, as opposed tocondawhich sometimes requires a mix ofcondaandpip.Describe the solution you'd like
The following steps should be done:
uvfollowing the instructions on their websiteenvironment.ymlintopyproject.toml(seeAdditional contextfor basic example)README.mdwith information on the new environmentenvironment.ymlfileuvenvironment to ensure everything still works (seeAdditional contextfor basic instructions).gitignoreis still correct (seeAdditional contextfor details)Describe alternatives you've considered
N/A
Additional context (converting
environment.ymlintopyproject.toml)To convert
environment.ymlintopyproject.toml, take the following example. SANDAG/HistoricalForecastError contains anenvironment.ymlwith roughly the following contents:The corresponding
pyproject.tomlwould be:Note that the dependency version has a minimum version so bug fixes can be automatically pulled, but is capped by a major version release, which is required when the interface changes (see Semantic Versioning)
Additional context (creating a
uvenvironment and running code)uvenvironments are built on top of Python's virtual environment, so all you need to do navigate to the project root and run in the command lineIn order to run scripts in the newly created
uvenvironment, simply douvwill automatically enter the virtual environment, run a bunch of checks, and run the script for you, all at blazing fast speedAdditional context (what should and shouldn't be committed)
You should commit
pyproject.tomlanduv.lock, the later of which is automatically created when runninguv sync. Note thatuvwill ensure that the environment andpyproject.tomlare synced up, so anytime you douv run {script},uvwill automatically update the environment anduv.lockwith any changes topyproject.tomlYou should not commit the virtual environment folder (default
.venv/). This should be skipped via the.gitigonre