0
$\begingroup$

Rosanswers logo

Hi, I'm trying to run ament_flake8 in my workspace.

This is what I do

mkdir -p ws/src 
git clone MY_REPO ws/src/repo
cd ws
colcon build
ament_flake8 .    

And I get the error

Traceback (most recent call last):
File "/opt/ros/eloquent/bin/ament_flake8", line 11, in load_entry_point('ament-flake8==0.8.1', 'console_scripts', 'ament_flake8')()
File "/opt/ros/eloquent/lib/python3.6/site-packages/ament_flake8/main.py", line 75, in main max_line_length=args.linelength) File "/opt/ros/eloquent/lib/python3.6/site-packages/ament_flake8/main.py", line 163, in generate_flake8_report style = get_flake8_style_guide(flake8_argv)
File "/opt/ros/eloquent/lib/python3.6/site-packages/ament_flake8/main.py", line 131, in get_flake8_style_guide application.parse_preliminary_options_and_args([]) AttributeError: 'Application' object has no attribute 'parse_preliminary_options_and_args'

Note that if instead I run flake8 . this works as expected.

I'm using a Dockerfile FROM osrf/ros:eloquent-desktop

Thank you


Originally posted by alsora on ROS Answers with karma: 1322 on 2020-05-28

Post score: 2

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

A recent release of flake8 (3.8) broke API the ament_flake8 package uses. You can:


Originally posted by Dirk Thomas with karma: 16276 on 2020-05-28

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by alsora on 2020-05-29:
Thank you, this command did the job

pip install -Iv flake8==3.7
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.