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

Upgrade tbump to 6.7.0 #5572

Closed
Pierre-Sassoulas opened this issue Dec 21, 2021 · 7 comments
Closed

Upgrade tbump to 6.7.0 #5572

Pierre-Sassoulas opened this issue Dec 21, 2021 · 7 comments
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow Needs astroid update Needs an astroid update (probably a release too) before being mergable python 3.9 python 3.10
Milestone

Comments

@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented Dec 21, 2021

When upgrading tbump to 6.6.1 in #5561, it broke the main branch. @DanielNoord fixed the root issue with #5566, and the change was reverted in #5567. Now we need to revert the revert and fix the primer.

We could add tbump to the primers. I think it's a small project. I realized some project takes a lot of time like django, but we can add small project without too much drawbacks.

@Pierre-Sassoulas Pierre-Sassoulas added task Maintenance Discussion or action around maintaining pylint or the dev workflow labels Dec 21, 2021
@DanielNoord
Copy link
Collaborator

I'm not sure the break is actually in tbump. The stdlib primer was failing after this change, so running over tbump likely wouldn't have catched this issue. I do wonder though why a change to tbump broke the stdlib primer..

@Pierre-Sassoulas
Copy link
Member Author

Pierre-Sassoulas commented Dec 21, 2021

It only happened in python 3.9 and 3.10. Here's the traceback so we don't have to search for old github actions jobs later:

AssertionError: Traceback (most recent call last):
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/manager.py", line 252, in file_from_module_name
      value = self._mod_file_cache[(modname, contextfile)]
  KeyError: ('pip', None)
  
  During handling of the above exception, another exception occurred:
  
  Traceback (most recent call last):
    File "/home/runner/work/pylint/pylint/pylint/utils/ast_walker.py", line 72, in walk
      callback(astroid)
    File "/home/runner/work/pylint/pylint/pylint/checkers/imports.py", line 519, in visit_import
      imported_module = self._get_imported_module(node, name)
    File "/home/runner/work/pylint/pylint/pylint/checkers/imports.py", line 808, in _get_imported_module
      return importnode.do_import_module(modname)
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/mixins.py", line 101, in do_import_module
      return mymodule.import_module(
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/nodes/scoped_nodes.py", line 735, in import_module
      return AstroidManager().ast_from_module_name(absmodname)
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/manager.py", line 167, in ast_from_module_name
      found_spec = self.file_from_module_name(modname, context_file)
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/manager.py", line 255, in file_from_module_name
      value = file_info_from_modpath(
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/modutils.py", line 389, in file_info_from_modpath
      return _spec_from_modpath(modpath, path, context)
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/modutils.py", line 610, in _spec_from_modpath
      found_spec = spec.find_spec(modpath, path)
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/interpreter/_import/spec.py", line 365, in find_spec
      finder, spec = _find_spec_with_path(
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/interpreter/_import/spec.py", line 329, in _find_spec_with_path
      spec = finder.find_module(modname, module_parts, processed, submodule_path)
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/interpreter/_import/spec.py", line 113, in find_module
      spec = importlib.util.find_spec(modname)
    File "/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/importlib/util.py", line 103, in find_spec
      return _find_spec(fullname, parent_path)
    File "<frozen importlib._bootstrap>", line 925, in _find_spec
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 83, in find_spec
      return method()
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 104, in spec_for_pip
      if self.pip_imported_during_build():
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 115, in pip_imported_during_build
      return any(
    File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/_distutils_hack/__init__.py", line 116, in <genexpr>
      frame.f_globals['__file__'].endswith('setup.py')
  KeyError: '__file__'
  
assert not 'Traceback (most recent call last):\n  File "/home/runner/work/pylint/pylint/venv/lib/python3.9/site-packages/astroid/...init__.py", line 116, in <genexpr>\n    frame.f_globals[\'__file__\'].endswith(\'setup.py\')\nKeyError: \'__file__\'\n'

@DanielNoord
Copy link
Collaborator

DanielNoord commented Dec 29, 2021

Looking at the stacktrace and what I changed in pylint-dev/astroid#1321 I think this might actually be a "requires astroid update". We should at least try and see if this gets fixed with an astroid version that includes that fix. It seems as if this might be the type of issue that was solved with the initial fix in pylint-dev/astroid@6ca01e0 but which doesn't work anymore on setuptools >= 60.0.0.

@Pierre-Sassoulas
Copy link
Member Author

My next goal is to release astroid 2.9.1, let's see how it goes after this is done.

@Pierre-Sassoulas Pierre-Sassoulas added the Needs astroid update Needs an astroid update (probably a release too) before being mergable label Dec 30, 2021
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.13.0 milestone Dec 30, 2021
@cdce8p
Copy link
Member

cdce8p commented Dec 31, 2021

The primer tests do seem to work in #5600. The CACHE_VERSION bump might have fixed it.

@Pierre-Sassoulas
Copy link
Member Author

We upgraded tbump to 6.6.1 in #5561, I4m going to rename this to 6.7.0 and put it in the milestone for pylint 2.14 as we need to drop python 3.6 first.

@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.13.0, 2.14.0 Dec 31, 2021
@Pierre-Sassoulas Pierre-Sassoulas changed the title Upgrade tbump to 6.6.1, fix the primer tests Upgrade tbump to 6.7.0, fix the primer tests Dec 31, 2021
@Pierre-Sassoulas Pierre-Sassoulas changed the title Upgrade tbump to 6.7.0, fix the primer tests Upgrade tbump to 6.7.0 Dec 31, 2021
@Pierre-Sassoulas Pierre-Sassoulas added the Blocked 🚧 Blocked by a particular issue label Apr 2, 2022
@DanielNoord DanielNoord removed the Blocked 🚧 Blocked by a particular issue label Apr 11, 2022
@Pierre-Sassoulas
Copy link
Member Author

The required tbump version is now 6.8.0, it was done automatically by dependabot in #6259 and #5600 following the migration from python 3.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Maintenance Discussion or action around maintaining pylint or the dev workflow Needs astroid update Needs an astroid update (probably a release too) before being mergable python 3.9 python 3.10
Projects
None yet
Development

No branches or pull requests

3 participants