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

Fixing requirements object not iterable on bad schema. #393

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nicholasks
Copy link

This will avoid raise "'NoneType' object is not iterable" error when user has a bad schema regarding requirements.txt on .pyup.yml file.

Example schema that was triggering the error:

# Specify requirement files by hand, default is empty
# default: empty
# allowed: list
requirements:
#  - requirements/staging.txt:

Should we warn users about the bad schema? And how about the documentation (.pyup.yml example file), maybe the "default empty" is leading users to do that, and I think is in certain way controversial, since below says "allowed: list".

@nicholasks nicholasks self-assigned this Sep 19, 2020
@codecov
Copy link

codecov bot commented Sep 19, 2020

Codecov Report

Merging #393 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #393   +/-   ##
=======================================
  Coverage   94.20%   94.21%           
=======================================
  Files          11       11           
  Lines        1157     1159    +2     
=======================================
+ Hits         1090     1092    +2     
  Misses         67       67           
Impacted Files Coverage Δ
pyup/config.py 98.91% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6fb8638...deab8bd. Read the comment docs.

Copy link
Contributor

@rafaelpivato rafaelpivato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We had something like this happening before and fixed with #395. We certainly need better schema validation for our configuration file. Do you have suggestions?

If you don't want to bring that with this PR, I would just urge you to consider, besides an empty None value for requirements, what could happen if someone adds unwelcome or unwanted types, like hashes instead of lists, integers instead of strings and so on.

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.

2 participants