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

Docker fix (#7228)

* Copy requirements file

* Test more files when building docker image

* Refactor install task

* Raise exception

* Run install task

* Fix typos

- The tests work!
This commit is contained in:
Oliver
2024-05-15 09:19:35 +10:00
committed by GitHub
parent d99bc0bcf9
commit 2265055785
3 changed files with 14 additions and 3 deletions

View File

@ -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)