Skip to content

Commit

Permalink
Drop support for $AUTO_REQUIREMENTS
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yajo committed Oct 11, 2018
1 parent f1d5b4e commit 1d5aaf2
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion 11.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion 12.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion 8.0.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions build.d/200-dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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:
Expand Down
1 change: 0 additions & 1 deletion lib/doodbalib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions tests/scaffoldings/dotd/custom/dependencies/pip.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion tests/scaffoldings/settings/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ services:
build:
context: ./
args:
AUTO_REQUIREMENTS: "true"
LOG_LEVEL: DEBUG
ODOO_VERSION: $ODOO_MINOR
tty: true
Expand Down

0 comments on commit 1d5aaf2

Please sign in to comment.