From 1d5aaf28ca9144a7fdfad50f756ae006c557a725 Mon Sep 17 00:00:00 2001 From: Jairo Llopis Date: Thu, 11 Oct 2018 11:21:23 +0100 Subject: [PATCH] Drop support for `$AUTO_REQUIREMENTS` This feature was introduced in #71, but time has proven it buggy and not much useful. This feature has a chicken-and-egg problem in the devel environment: code doesn't exist at build time, but it is expected to be able to find the `requirements.txt` files inside it. It confuses the developer and creates divergencies between devel and test/prod environments (where that problem doesn't exist). Also it's breaking #174, which is a more important and actually used feature. The best fix is to drop support for this. If you really want to have requirements from remotes, you can add this to your `dependencies/pip.txt` file: ``` # Assuming you are installing all from server-tools -r https://raw.githubusercontent.com/OCA/server-tools/11.0/requirements.txt ``` It's a better choice because: - It's basic official pip. - It's explicit. - It works fine across environments. --- 11.0.Dockerfile | 1 - 12.0.Dockerfile | 1 - 8.0.Dockerfile | 1 - build.d/200-dependencies | 4 ---- lib/doodbalib/__init__.py | 1 - tests/scaffoldings/dotd/custom/dependencies/pip.txt | 2 ++ tests/scaffoldings/settings/docker-compose.yaml | 1 - 7 files changed, 2 insertions(+), 9 deletions(-) diff --git a/11.0.Dockerfile b/11.0.Dockerfile index ea7a702c..80d9825f 100644 --- a/11.0.Dockerfile +++ b/11.0.Dockerfile @@ -136,7 +136,6 @@ FROM base AS onbuild ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true -ONBUILD ARG AUTO_REQUIREMENTS=false ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 diff --git a/12.0.Dockerfile b/12.0.Dockerfile index 988911ce..3b03718a 100644 --- a/12.0.Dockerfile +++ b/12.0.Dockerfile @@ -127,7 +127,6 @@ FROM base AS onbuild ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true -ONBUILD ARG AUTO_REQUIREMENTS=false ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 diff --git a/8.0.Dockerfile b/8.0.Dockerfile index 0fcda71e..bbdbb9a4 100644 --- a/8.0.Dockerfile +++ b/8.0.Dockerfile @@ -122,7 +122,6 @@ ONBUILD USER root ONBUILD ENTRYPOINT ["/opt/odoo/common/entrypoint"] ONBUILD CMD ["/usr/local/bin/odoo"] ONBUILD ARG AGGREGATE=true -ONBUILD ARG AUTO_REQUIREMENTS=false ONBUILD ARG DEFAULT_REPO_PATTERN="https://github.com/OCA/{}.git" ONBUILD ARG DEFAULT_REPO_PATTERN_ODOO="https://github.com/OCA/OCB.git" ONBUILD ARG DEPTH_DEFAULT=1 diff --git a/build.d/200-dependencies b/build.d/200-dependencies index ceae1c57..745566a2 100755 --- a/build.d/200-dependencies +++ b/build.d/200-dependencies @@ -5,7 +5,6 @@ from os.path import basename, join, splitext from glob import glob from doodbalib import ( - AUTO_REQUIREMENTS, CUSTOM_DIR, FILE_APT_BUILD, SRC_DIR, @@ -18,9 +17,6 @@ install("apt", FILE_APT_BUILD) for name in INSTALLERS: req_files = [] - # pip `requirements.txt` files found in repositories - if name == "pip" and AUTO_REQUIREMENTS: - req_files += glob(join(SRC_DIR, "*", "requirements.txt")) # Normal dependency installation req_files.append(join(CUSTOM_DIR, 'dependencies', '%s.txt' % name)) for req_file in req_files: diff --git a/lib/doodbalib/__init__.py b/lib/doodbalib/__init__.py index f677de2c..bdac6d2c 100644 --- a/lib/doodbalib/__init__.py +++ b/lib/doodbalib/__init__.py @@ -33,7 +33,6 @@ AUTO_REPOS_YAML = '%s.yaml' % AUTO_REPOS_YAML CLEAN = os.environ.get("CLEAN") == "true" -AUTO_REQUIREMENTS = os.environ.get("AUTO_REQUIREMENTS") == "true" LOG_LEVELS = ("DEBUG", "INFO", "WARNING", "ERROR") FILE_APT_BUILD = os.path.join( CUSTOM_DIR, 'dependencies', 'apt_build.txt', diff --git a/tests/scaffoldings/dotd/custom/dependencies/pip.txt b/tests/scaffoldings/dotd/custom/dependencies/pip.txt index 5b9322ed..bc8535dd 100644 --- a/tests/scaffoldings/dotd/custom/dependencies/pip.txt +++ b/tests/scaffoldings/dotd/custom/dependencies/pip.txt @@ -2,3 +2,5 @@ pycrypto==2.6.1 --no-binary :all: # Odoo pins docutils==0.12, so let's check it gets upgraded docutils==0.14 +# External dependency files can be included too; example: cfssl +-r https://raw.githubusercontent.com/Tecnativa/doodba/f1d5b4e65d463eb25b1bece981bc806e9237310f/tests/scaffoldings/dotd/custom/src/dummy_repo/requirements.txt diff --git a/tests/scaffoldings/settings/docker-compose.yaml b/tests/scaffoldings/settings/docker-compose.yaml index 73d45fc5..e83fc641 100644 --- a/tests/scaffoldings/settings/docker-compose.yaml +++ b/tests/scaffoldings/settings/docker-compose.yaml @@ -4,7 +4,6 @@ services: build: context: ./ args: - AUTO_REQUIREMENTS: "true" LOG_LEVEL: DEBUG ODOO_VERSION: $ODOO_MINOR tty: true