Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#181: Remove torch package index from pyproject.toml #182

Merged
merged 7 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/changes/changes_0.9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ T.B.D

### Refactorings

- n/a
- #182: Removed torch package index from pyproject.toml

### Documentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ def add_wheel_to_flavor(flavor_base_path):

def add_requirements_to_flavor(flavor_base_path: Path):
project_directory = find_project_directory()
requirements = subprocess.check_output(["poetry", "export"], cwd=project_directory)
requirements_bytes = subprocess.check_output(["poetry", "export", "--without-hashes", "--without-urls"],
cwd=project_directory)
requirements = requirements_bytes.decode("UTF-8")
requirements_without_cuda = "\n".join(line
for line in requirements.splitlines()
if not line.startswith("nvidia"))
requirements_file = flavor_base_path / "dependencies" / "requirements.txt"
requirements_file.write_bytes(requirements)
requirements_file.write_text(requirements_without_cuda)
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM exasol/script-language-container:python-3.8-minimal-EXASOL-6.2.0-build_run_

Run mkdir /project
COPY dependencies/requirements.txt /project/requirements.txt
RUN python3.8 -m pip install -r /project/requirements.txt
RUN python3.8 -m pip install --extra-index-url https://download.pytorch.org/whl/cpu -r /project/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
1,292 changes: 776 additions & 516 deletions poetry.lock

Large diffs are not rendered by default.

8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ keywords = ['exasol']
[tool.poetry.dependencies]
python = "^3.8.0"
pandas = ">=1.4.2,<2.0.0"
torch = { version="2.0.1+cpu", source = "torch"} # we use cpu version until GPUs are supported from Exasol
torch = "^2.0.1"
transformers = {extras = ["torch"], version = "^4.36.2"}
Jinja2 = "^3.0.3"
importlib-resources = "^5.4.0"
Expand All @@ -35,12 +35,6 @@ exasol-udf-mock-python = "^0.1.0"
exasol-script-languages-container-tool = "^0.18.1"
toml = "^0.10.2"

[[tool.poetry.source]]
name = "torch"
url = "https://download.pytorch.org/whl/cpu"
secondary = true


[tool.poetry.group.dev.dependencies]
nox = "^2023.4.22"

Expand Down
9 changes: 9 additions & 0 deletions tests/integration_tests/without_db/test_slc_size.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from pathlib import Path

import humanfriendly
from exasol_script_languages_container_tool.lib.tasks.export.export_info import ExportInfo


def test_slc_size_below_2gb(export_slc: ExportInfo):
stat_result = Path(export_slc.cache_file).resolve().stat()
assert stat_result.st_size < humanfriendly.parse_size(size="2GB")
Loading