mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-18 18:56:31 +00:00
* Copy requirements file
* Test more files when building docker image
* Refactor install task
* Raise exception
* Run install task
* Fix typos
- The tests work!
(cherry picked from commit 2265055785
)
Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
committed by
GitHub
parent
258b8e4ecc
commit
be3b22ce36
11
tasks.py
11
tasks.py
@@ -230,7 +230,12 @@ def plugins(c, uv=False):
|
||||
@task(help={'uv': 'Use UV package manager (experimental)'})
|
||||
def install(c, uv=False):
|
||||
"""Installs required python packages."""
|
||||
print("Installing required python packages from 'src/backend/requirements.txt'")
|
||||
INSTALL_FILE = 'src/backend/requirements.txt'
|
||||
|
||||
print(f"Installing required python packages from '{INSTALL_FILE}'")
|
||||
|
||||
if not Path(INSTALL_FILE).is_file():
|
||||
raise FileNotFoundError(f"Requirements file '{INSTALL_FILE}' not found")
|
||||
|
||||
# Install required Python packages with PIP
|
||||
if not uv:
|
||||
@@ -238,13 +243,13 @@ def install(c, uv=False):
|
||||
'pip3 install --no-cache-dir --disable-pip-version-check -U pip setuptools'
|
||||
)
|
||||
c.run(
|
||||
'pip3 install --no-cache-dir --disable-pip-version-check -U --require-hashes -r src/backend/requirements.txt'
|
||||
f'pip3 install --no-cache-dir --disable-pip-version-check -U --require-hashes -r {INSTALL_FILE}'
|
||||
)
|
||||
else:
|
||||
c.run(
|
||||
'pip3 install --no-cache-dir --disable-pip-version-check -U uv setuptools'
|
||||
)
|
||||
c.run('uv pip install -U --require-hashes -r src/backend/requirements.txt')
|
||||
c.run(f'uv pip install -U --require-hashes -r {INSTALL_FILE}')
|
||||
|
||||
# Run plugins install
|
||||
plugins(c, uv=uv)
|
||||
|
Reference in New Issue
Block a user