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

[FIX] Add pbr to requirements #328

Merged
merged 1 commit into from
Apr 13, 2021
Merged

Conversation

joao-p-marques
Copy link
Member

The library is needed for the setup, but it is not specified in requirements.
Its installation depends on setuptools' easy_install, which is unreliable:

Example of the error that might be caused: https://github.com/Tecnativa/doodba/runs/2314862208?check_suite_focus=true#step:7:1476
Pre-installing pbr with pip solves the issue, so it could be added to the requirements.txt to force the installation that way.

ping @yajo

The library is needed for the setup, but it is not specified in requirements.
Its installation depends on setuptools' easy_install, which is unrealiable: https://docs.openstack.org/pbr/latest/#pbr-python-build-reasonableness
@yajo
Copy link
Member

yajo commented Apr 13, 2021

To reproduce easily:

docker container run --rm -it python:3.5-stretch bash -c 'python -m venv --system-site-packages /qa/venv && . /qa/venv/bin/activate && pip install pylint-odoo'

Result:

Collecting pylint-odoo
  Downloading https://files.pythonhosted.org/packages/74/ae/9cc3d387291e1e2866e0af906e1b76e766885867fe765a3f296f5879fd42/pylint-odoo-3.7.1.tar.gz (69kB)
    100% |████████████████████████████████| 71kB 3.2MB/s 
    Complete output from command python setup.py egg_info:
    Couldn't find index page for 'pbr' (maybe misspelled?)
    No local packages or working download links found for pbr
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-mrr8e_ga/pylint-odoo/setup.py", line 8, in <module>
        package_data={'': ['*.yaml']})
      File "/usr/local/lib/python3.5/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/qa/venv/lib/python3.5/site-packages/setuptools/dist.py", line 315, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/qa/venv/lib/python3.5/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
        replace_conflicting=True,
      File "/qa/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 850, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/qa/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1122, in best_match
        return self.obtain(req, installer)
      File "/qa/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1134, in obtain
        return installer(requirement)
      File "/qa/venv/lib/python3.5/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
        return cmd.easy_install(req)
      File "/qa/venv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 659, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-mrr8e_ga/pylint-odoo/
You are using pip version 9.0.1, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

However, this doesn't fix the problem. @joao-p-marques you probably need to patch something in setup.py and/or setup.cfg too. See:

╰─ docker container run --rm -it python:3.5-stretch bash -c 'python -m venv --system-site-packages /qa/venv && . /qa/venv/bin/activate && pip install git+https://github.com/Tecnativa/pylint-odoo.git@add-pbr-req'
Collecting git+https://github.com/Tecnativa/pylint-odoo.git@add-pbr-req
  Cloning https://github.com/Tecnativa/pylint-odoo.git (to add-pbr-req) to /tmp/pip-3sedwkrj-build
    Complete output from command python setup.py egg_info:
    Couldn't find index page for 'pbr' (maybe misspelled?)
    No local packages or working download links found for pbr
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-3sedwkrj-build/setup.py", line 8, in <module>
        package_data={'': ['*.yaml']})
      File "/usr/local/lib/python3.5/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/qa/venv/lib/python3.5/site-packages/setuptools/dist.py", line 315, in __init__
        self.fetch_build_eggs(attrs['setup_requires'])
      File "/qa/venv/lib/python3.5/site-packages/setuptools/dist.py", line 361, in fetch_build_eggs
        replace_conflicting=True,
      File "/qa/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 850, in resolve
        dist = best[req.key] = env.best_match(req, ws, installer)
      File "/qa/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1122, in best_match
        return self.obtain(req, installer)
      File "/qa/venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 1134, in obtain
        return installer(requirement)
      File "/qa/venv/lib/python3.5/site-packages/setuptools/dist.py", line 429, in fetch_build_egg
        return cmd.easy_install(req)
      File "/qa/venv/lib/python3.5/site-packages/setuptools/command/easy_install.py", line 659, in easy_install
        raise DistutilsError(msg)
    distutils.errors.DistutilsError: Could not find suitable distribution for Requirement.parse('pbr')
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-3sedwkrj-build/
You are using pip version 9.0.1, however version 21.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

@moylop260 moylop260 merged commit 455ac91 into OCA:master Apr 13, 2021
@yajo yajo deleted the add-pbr-req branch April 14, 2021 06:55
moylop260 added a commit that referenced this pull request Oct 21, 2022
- Remove checks already migrated to oca-odoo-pre-commit-hooks
- Remove deprecated checks
- Remove py2 compatibility or dual old pylint compatibility
- Migrate CI to github actions instead of travis-CI
  - Add MACOS environments to CI
- Remove pbr dependency using setup.py out-of-the-box Rename master branch to main (github fashion)
- Fix DeprecationWarning: Please use rfc3986.validators.Validator instead. This method will be eventually removed. Rename packages paths:
  - pylint_odoo -> src/pylint_odoo (Based on popular templates)
  - pylint_odoo/test* -> test* (The tests and theirs resources are not part of the package) Add tox in order to run tests in isolated way and parallels
- Add bump2version
  - Bump version: 7.0.4 → 8.0.0

Fix #259
Fix #264
Fix #267
Fix #277
Fix #380
Fix #381
Fix #393
Fix #328

Related to OCA/maintainer-quality-tools#623 (comment)

Closes #329

Related to https://github.com/OCA/odoo-pre-commit-hooks
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.

None yet

3 participants