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

Anthem not working with OCA Wheelhouse due to PIP problems #38

Closed
codingforfun opened this issue Sep 12, 2017 · 3 comments
Closed

Anthem not working with OCA Wheelhouse due to PIP problems #38

codingforfun opened this issue Sep 12, 2017 · 3 comments

Comments

@codingforfun
Copy link

codingforfun commented Sep 12, 2017

I tried to integrate the OCA approach of installing Odoo addons via pip instead of importing external source repositories.
More about this can be found here and here.
Also I prepared a minimal example based on https://github.com/camptocamp/test-odoo-project demonstrating this for the example of installing disable_odoo_online from OCA server-tools here: camptocamp/test-odoo-project@master...codingforfun:pip-issue
https://github.com/codingforfun/test-odoo-project/tree/pip-issue

I run into the problem that anthem isn't finding odoo anymore if requirements from requirements.txt inside the child container contain dependencies to Odoo.
The reason seams to be that Odoo gets installed in the parent container with 'pip install -e'.

I did some research but don't have any conclusion yet and hope you maybe have an idea. It seams to have something to do with namespace packages. Pip packaged Odoo modules adds namespace_packages: ['odoo', 'odoo.addons'] inside setup.py for the module.
I was able to run anthem inside the container again after removal of the corresponding nspkg.pth from dist-packages.

Some relevant references I found:

The error log I get from docker-compose up --build:

[...]
Step 1/1 : RUN cd /opt/odoo && pip install -r src_requirements.txt
 ---> Running in c5f7fb4b75ee
Obtaining file:///opt/odoo (from -r src_requirements.txt (line 7))
Obtaining file:///opt/odoo/src (from -r src_requirements.txt (line 8))
Requirement already satisfied: babel>=1.0 in /usr/local/lib/python2.7/dist-packages (from odoo==10.0->-r src_requirements.txt (line 8))
[...]
Requirement already satisfied: python-stdnum in /usr/local/lib/python2.7/dist-packages (from vatnumber->odoo==10.0->-r src_requirements.txt (line 8))
Installing collected packages: test-odoo-project, odoo
  Running setup.py develop for test-odoo-project
  Running setup.py develop for odoo
Successfully installed odoo test-odoo-project
 ---> 6625234dcd4b
[...]
Step 4/5 : RUN cd /opt/odoo && find . -maxdepth 1 -name "*requirements.txt" ! -name src_requirements.txt ! -name base_requirements.txt -exec pip install --extra-index-url=https://wheelhouse.odoo-community.org/oca-simple -r {} \;
 ---> Running in d8d69d9a0631
Collecting odoo10-addon-disable-odoo-online (from -r ./requirements.txt (line 2))
  Downloading odoo10_addon_disable_odoo_online-10.0.1.0.0-py2-none-any.whl
Requirement already satisfied: odoo<10.1dev,>=10.0 in ./src (from odoo10-addon-disable-odoo-online->-r ./requirements.txt (line 2))
Requirement already satisfied: babel>=1.0 in /usr/local/lib/python2.7/dist-packages (from odoo<10.1dev,>=10.0->odoo10-addon-disable-odoo-online->-r ./requirements.txt (line 2))
[...]
Requirement already satisfied: python-stdnum in /usr/local/lib/python2.7/dist-packages (from vatnumber->odoo<10.1dev,>=10.0->odoo10-addon-disable-odoo-online->-r ./requirements.txt (line 2))
Installing collected packages: odoo10-addon-disable-odoo-online
Successfully installed odoo10-addon-disable-odoo-online-10.0.1.0.0
 ---> 90257035d29e
[...]
odoo_1   | |> migration: processing version 10.0.0
odoo_1   | |> version 10.0.0: start
odoo_1   | |> version 10.0.0: execute base pre-operations
odoo_1   | |> version 10.0.0: anthem songs.install.pre::main
odoo_1   | Traceback (most recent call last):
odoo_1   |   File "/usr/local/bin/anthem", line 7, in <module>
odoo_1   |     from anthem.cli import main
odoo_1   |   File "/usr/local/lib/python2.7/dist-packages/anthem/cli.py", line 22, in <module>
odoo_1   |     import openerp as odoo  # noqa
odoo_1   | ImportError: No module named openerp
odoo_1   | Traceback (most recent call last):
odoo_1   |   File "/usr/local/bin/marabunta", line 11, in <module>
odoo_1   |     sys.exit(main())
odoo_1   |   File "/usr/local/lib/python2.7/dist-packages/marabunta/core.py", line 126, in main
odoo_1   |     migrate(config)
odoo_1   |   File "/usr/local/lib/python2.7/dist-packages/marabunta/core.py", line 115, in migrate
odoo_1   |     runner.perform()
odoo_1   |   File "/usr/local/lib/python2.7/dist-packages/marabunta/runner.py", line 85, in perform
odoo_1   |     VersionRunner(self, version).perform()
odoo_1   |   File "/usr/local/lib/python2.7/dist-packages/marabunta/runner.py", line 143, in perform
odoo_1   |     operation.execute(self.log)
odoo_1   |   File "/usr/local/lib/python2.7/dist-packages/marabunta/model.py", line 259, in execute
odoo_1   |     self._execute(log, interactive=sys.stdout.isatty())
odoo_1   |   File "/usr/local/lib/python2.7/dist-packages/marabunta/model.py", line 246, in _execute
odoo_1   |     child.exitstatus
odoo_1   | marabunta.exception.OperationError: command 'anthem songs.install.pre::main' returned 1
testodooproject_odoo_1 exited with code 1
[...]
@codingforfun
Copy link
Author

This has been worked on and solved by @sbidoul in acsone/odoo-autodiscover#3.
I will update the minimal example with the final solution as soon as the final release of the library has happened.

@sbidoul
Copy link
Contributor

sbidoul commented Sep 18, 2017

@codingforfun I released odoo-autodiscover 2.0.0b1.

@codingforfun
Copy link
Author

I updated my example branch above. It's as simple as adding odoo-autodiscover>=2.0.0b1 to the requirements.txt

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

No branches or pull requests

2 participants