2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 18:45:40 +00:00

Switch to uv (#6499)

* test UV performance

* second dummy change

* fix CI

* set version - uv is already proving to be great

* dummy bump

* bump to newer uv

* use uv in more places

* revert uv

* add flag to disable UV

* fix vevn for CI

* bump uv version

* bump to uv-016

* bump

* bump

* switch to uv
This commit is contained in:
Matthias Mair
2024-02-22 22:55:19 +00:00
committed by GitHub
parent 5dbd3030d1
commit f5e02fd292
5 changed files with 67 additions and 159 deletions

View File

@ -207,8 +207,8 @@ def check_file_existance(filename: str, overwrite: bool = False):
# Install tasks
@task
def plugins(c):
@task(help={'nouv': 'Do not use UV'})
def plugins(c, nouv=False):
"""Installs all plugins as specified in 'plugins.txt'."""
from InvenTree.InvenTree.config import get_plugin_file
@ -217,20 +217,29 @@ def plugins(c):
print(f"Installing plugin packages from '{plugin_file}'")
# Install the plugins
c.run(f"pip3 install --disable-pip-version-check -U -r '{plugin_file}'")
if nouv:
c.run(f"pip3 install --disable-pip-version-check -U -r '{plugin_file}'")
else:
c.run('pip3 install --no-cache-dir --disable-pip-version-check uv')
c.run(f"uv pip install -r '{plugin_file}'")
@task(post=[plugins])
def install(c):
@task(post=[plugins], help={'nouv': 'Do not use UV'})
def install(c, nouv=False):
"""Installs required python packages."""
print("Installing required python packages from 'requirements.txt'")
# Install required Python packages with PIP
c.run('pip3 install --upgrade pip')
c.run('pip3 install --upgrade setuptools')
c.run(
'pip3 install --no-cache-dir --disable-pip-version-check -U -r requirements.txt'
)
if nouv:
c.run('pip3 install --upgrade pip')
c.run('pip3 install --upgrade setuptools')
c.run(
'pip3 install --no-cache-dir --disable-pip-version-check -U -r requirements.txt'
)
else:
c.run('pip3 install --upgrade uv')
c.run('uv pip install --upgrade setuptools')
c.run('uv pip install -U -r requirements.txt')
@task(help={'tests': 'Set up test dataset at the end'})