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

Validate command setup uses incorrect method for Scrapy Argparse #13

Open
s-j-b opened this issue Aug 1, 2022 · 0 comments
Open

Validate command setup uses incorrect method for Scrapy Argparse #13

s-j-b opened this issue Aug 1, 2022 · 0 comments
Assignees

Comments

@s-j-b
Copy link
Collaborator

s-j-b commented Aug 1, 2022

Summary

Issue appeared here: https://github.com/City-Bureau/city-scrapers-atl/runs/7603497825?check_suite_focus=true

CI Test failing due to the following error

  File "/home/runner/work/city-scrapers-atl/city-scrapers-atl/.venv/bin/scrapy", line 8, in <module>
    sys.exit(execute())
  File "/home/runner/work/city-scrapers-atl/city-scrapers-atl/.venv/lib/python3.9/site-packages/scrapy/cmdline.py", line 149, in execute
    cmd.add_options(parser)
  File "/home/runner/work/city-scrapers-atl/city-scrapers-atl/.venv/lib/python3.9/site-packages/city_scrapers_core/commands/validate.py", line 23, in add_options
    parser.add_option(
AttributeError: 'ScrapyArgumentParser' object has no attribute 'add_option'
Error: Process completed with exit code 123.

spider is using parser.add_option (which isn't an available method for the underlying object) instead of parser.add_argument.

Proposed fix

Just update the Command.add_options method to call parser.add_argument instead of parser.add_option.

  • NOTE: I haven't looked at where in production the validate --all command is being run, but the above fix should fix the error assuming that's the intended functionality

Status

PR incoming shortly

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

1 participant