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

Problems using Python 3.9 #1659

Closed
thepabloaguilar opened this issue Oct 10, 2020 · 2 comments
Closed

Problems using Python 3.9 #1659

thepabloaguilar opened this issue Oct 10, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@thepabloaguilar
Copy link
Contributor

Bug report

What's wrong

I know Python 3.9 was too recent released but I would like do adopt it in some projects, when I try to run wemake-python-styleguide using the 3.9 version I get the following error:

Traceback (most recent call last):
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/checker.py", line 154, in run
    visitor.run()
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/visitors/base.py", line 191, in run
    self.visit(self.tree)
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/visitors/base.py", line 186, in visit
    return route_visit(self, tree)
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/compat/routing.py", line 36, in route_visit
    return getattr(
  File "/opt/hostedtoolcache/Python/3.9.0/x64/lib/python3.9/ast.py", line 415, in generic_visit
    self.visit(item)
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/visitors/base.py", line 186, in visit
    return route_visit(self, tree)
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/compat/routing.py", line 36, in route_visit
    return getattr(
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/visitors/ast/complexity/annotations.py", line 34, in visit_any_function
    self._check_function_annotations_complexity(node)
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/visitors/ast/complexity/annotations.py", line 58, in _check_function_annotations_complexity
    self._check_annotations_complexity(node, annotations)
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/visitors/ast/complexity/annotations.py", line 67, in _check_annotations_complexity
    complexity = get_annotation_compexity(annotation)
  File "/home/runner/work/returns/returns/.venv/lib/python3.9/site-packages/wemake_python_styleguide/logic/complexity/annotations.py", line 36, in get_annotation_compexity
    annotation_node.slice.value,  # type: ignore
AttributeError: 'Tuple' object has no attribute 'value'

For more information you can see the failed pipeline here

Something weird happened, if I add --bug-report flag everything works 🤔

How is that should be

Should runs without any error with Python 3.9

System information

ubuntu-18.04

flake8 information

Contents of flake8 --bug-report:

{
  "dependencies": [],
  "platform": {
    "python_implementation": "CPython",
    "python_version": "3.9.0",
    "system": "Linux"
  },
  "plugins": [
    {
      "is_local": false,
      "plugin": "flake8-bandit",
      "version": "2.1.2"
    },
    {
      "is_local": false,
      "plugin": "flake8-broken-line",
      "version": "0.2.1"
    },
    {
      "is_local": false,
      "plugin": "flake8-bugbear",
      "version": "19.8.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-comprehensions",
      "version": "3.2.3"
    },
    {
      "is_local": false,
      "plugin": "flake8-darglint",
      "version": "1.5.5"
    },
    {
      "is_local": false,
      "plugin": "flake8-debugger",
      "version": "3.2.1"
    },
    {
      "is_local": false,
      "plugin": "flake8-docstrings",
      "version": "1.5.0, pydocstyle: 5.1.1"
    },
    {
      "is_local": false,
      "plugin": "flake8-eradicate",
      "version": "0.3.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-pyi",
      "version": "20.5.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-pytest-style",
      "version": "1.3.0"
    },
    {
      "is_local": false,
      "plugin": "flake8-string-format",
      "version": "0.2.3"
    },
    {
      "is_local": false,
      "plugin": "flake8_commas",
      "version": "2.0.0"
    },
    {
      "is_local": false,
      "plugin": "flake8_isort",
      "version": "3.0.1"
    },
    {
      "is_local": false,
      "plugin": "flake8_quotes",
      "version": "2.1.2"
    },
    {
      "is_local": false,
      "plugin": "mccabe",
      "version": "0.6.1"
    },
    {
      "is_local": false,
      "plugin": "naming",
      "version": "0.9.1"
    },
    {
      "is_local": false,
      "plugin": "nitpick",
      "version": "0.23.0"
    },
    {
      "is_local": false,
      "plugin": "pycodestyle",
      "version": "2.6.0"
    },
    {
      "is_local": false,
      "plugin": "pyflakes",
      "version": "2.2.0"
    },
    {
      "is_local": false,
      "plugin": "rst-docstrings",
      "version": "0.0.12"
    },
    {
      "is_local": false,
      "plugin": "wemake_python_styleguide",
      "version": "0.14.1"
    }
  ],
  "version": "3.8.4"
}

Refs dry-python/returns#663

@thepabloaguilar thepabloaguilar added the bug Something isn't working label Oct 10, 2020
@sobolevn sobolevn added this to the python3.9 milestone Oct 10, 2020
@tirkarthi
Copy link

Seems to be duplicate of #1652

@sobolevn
Copy link
Member

Yeap.

@sobolevn sobolevn modified the milestones: python3.9, Version 0.15 aka New runtime Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants