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

[IMP] Add option to automatically install repo requirements #71

Merged
merged 2 commits into from
Oct 24, 2017

Conversation

lasley
Copy link
Contributor

@lasley lasley commented Aug 24, 2017

Ref #28 except with defaults that don't suck! 🚀

@pedrobaeza
Copy link
Member

Why Travis is failing? Maybe it is expecting that value to be True?

@lasley
Copy link
Contributor Author

lasley commented Aug 24, 2017

Hrmmm same error as in #62 - I've been seeing this randomly across all PRs:

Traceback (most recent call last):
  File "/opt/odoo/common/build", line 26, in <module>
    subprocess.check_call(command)
  File "/usr/lib/python2.7/subprocess.py", line 535, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 522, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child
    raise child_exception
OSError: [Errno 26] Text file busy

@yajo yajo self-assigned this Aug 25, 2017
@yajo
Copy link
Contributor

yajo commented Aug 25, 2017

It seems to be #65

@yajo yajo force-pushed the master branch 7 times, most recently from 635050e to e88faa0 Compare October 5, 2017 07:20
@lasley
Copy link
Contributor Author

lasley commented Oct 5, 2017

@yajo - I'm about to rebase this, but it's going to suck with all the commits. Do you mind if I squash your's into mine in order to make the rebase easier in terms of conflicts? Admittedly I'm being lazy, but less commits are better right? 😆

@lasley
Copy link
Contributor Author

lasley commented Oct 5, 2017

Squashing actually made it so there were no conflicts. Pretty pleeeeaaaaseeee?!

@yajo
Copy link
Contributor

yajo commented Oct 9, 2017

Do it please 😊

@lasley lasley force-pushed the feature/requirements-auto branch from 95e5554 to c44858a Compare October 9, 2017 15:00
@lasley
Copy link
Contributor Author

lasley commented Oct 9, 2017

Done!

req_files = []
# pip `requirements.txt` files found in repositories
if name == "pip" and AUTO_REQUIREMENTS:
for repo in addons_config():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addons_config changed its return since #84. I think this should fail as it is.

Anyways, you can be dumber here and just use req_files += glob.glob(join(SRC_DIR, "*", "requirements.txt"))

8.0.Dockerfile Outdated
@@ -17,6 +17,7 @@ ONBUILD ARG DEPTH_MERGE=100
ONBUILD ARG CLEAN=true
ONBUILD ARG COMPILE=true
ONBUILD ARG CONFIG_BUILD=true
ONBUILD ARG AUTO_REQUIREMENTS=false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add this to 11.0.Dockerfile too

lasley and others added 2 commits October 24, 2017 12:36
Saner auto requirements installation

- Shortcut for installation that reduces the logic size.
- Cannot install from repositories before aggregation.
- Auto dependencies should come in before manual ones.
- Drop support of deprecated /opt/custom/src/requirements.txt file.

[FIX] Default requirements installation to false

Fix tests for auto installation of requirements.txt files found in repositories
- Sort arguments in py2 Dockerfiles.
- Add to py3 Dockerfile.
- Use glob to get files.
- Test it.
@yajo yajo force-pushed the feature/requirements-auto branch from c44858a to 5e58adf Compare October 24, 2017 10:43
@yajo
Copy link
Contributor

yajo commented Oct 24, 2017

Travis errors unrelated.

@yajo yajo merged commit 02aa051 into Tecnativa:master Oct 24, 2017
@lasley lasley deleted the feature/requirements-auto branch October 24, 2017 14:53
yajo added a commit that referenced this pull request Oct 11, 2018
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.
yajo added a commit that referenced this pull request Oct 11, 2018
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants