From 080468cbc2a1a641428f670616c01a4f4d3c05c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20Ho=CC=88nicke?= Date: Mon, 1 May 2023 11:53:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20test:=20level=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/options/generate/generator.py | 2 +- src/options/generate/templates_user.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/options/generate/generator.py b/src/options/generate/generator.py index f3ef5fe..4174ce7 100644 --- a/src/options/generate/generator.py +++ b/src/options/generate/generator.py @@ -216,7 +216,7 @@ metas: def parse_result_fn_dockerfile(self, content_raw: str): json_string = self.extract_content_from_result(content_raw, 'apt-get-packages.json', match_single_block=True) - packages = json.loads(json_string)['packages'] + packages = ' '.join(json.loads(json_string)['packages']) docker_file_template = self.read_docker_template() return {DOCKER_FILE_NAME: docker_file_template.replace('{{apt_get_packages}}', '{apt_get_packages}').format(apt_get_packages=packages)} diff --git a/src/options/generate/templates_user.py b/src/options/generate/templates_user.py index aba7c60..266408b 100644 --- a/src/options/generate/templates_user.py +++ b/src/options/generate/templates_user.py @@ -181,16 +181,23 @@ Name all packages which need to be installed via `apt-get install` in above Dock Note that you must not list apt-get packages that are already installed in the Dockerfile. Note that openai does not require any apt-get packages. -Note that you only list packages where you are highly confident that they are really needed. +Note that you are only allowed to list packages where you are highly confident that they are really needed. +Note that you can assume that the standard python packages are already installed. Output the packages that need to me placed at {{apt_get_packages}} as json in the following format: **apt-get-packages.json** ```json {{"packages": ["", ""]}} ``` -Have in mind that the packages list can be empty like this: +Example for the following requirements.txt file: +**requirements.txt** +``` +numpy==1.19.5 +fitz +``` +The output would be: **apt-get-packages.json** ```json -{{"packages": []}} +{"packages": []} ``` ''' )