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

Finish typing support. #116

Merged

Conversation

jschwartzentruber
Copy link
Collaborator

This finishes the work by @nth10sd in #115 . Much of the nicer syntax depends on __future__ annotations which has other caveats, so I've backported this to 3.6 for now.

This also enables mypy in pre-commit, enables Python 3.10 CI, and enables lint across all Python versions in CI.

Supersedes #115.

@codecov
Copy link

codecov bot commented Dec 23, 2021

Codecov Report

Merging #116 (238464c) into master (d0f59c6) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 238464c differs from pull request most recent head fd5d843. Consider uploading reports for the commit fd5d843 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##            master      #116   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         1258      1290   +32     
=========================================
+ Hits          1258      1290   +32     
Impacted Files Coverage Δ
ffpuppet/bootstrapper.py 100.00% <100.00%> (ø)
ffpuppet/checks.py 100.00% <100.00%> (ø)
ffpuppet/core.py 100.00% <100.00%> (ø)
ffpuppet/helpers.py 100.00% <100.00%> (ø)
ffpuppet/main.py 100.00% <100.00%> (ø)
ffpuppet/minidump_parser.py 100.00% <100.00%> (ø)
ffpuppet/puppet_logger.py 100.00% <100.00%> (ø)
ffpuppet/sanitizer_util.py 100.00% <100.00%> (ø)

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 d0f59c6...fd5d843. Read the comment docs.

@nth10sd
Copy link
Contributor

nth10sd commented Dec 24, 2021

In a new fresh Python 3.6 venv on rev 238464c, there still are the following errors:

$ mypy .
ffpuppet/test_sanitizer_util.py:15: error: Untyped decorator makes function "test_sanitizer_options_01" untyped  [misc]
ffpuppet/test_minidump_parser.py:165: error: Untyped decorator makes function "test_minidump_parser_06" untyped  [misc]
ffpuppet/test_ffpuppet.py:88: error: Untyped decorator makes function "test_ffpuppet_00" untyped  [misc]
ffpuppet/test_main.py:17: error: Untyped decorator makes function "test_main_01" untyped  [misc]
Found 4 errors in 4 files (checked 21 source files)

@jschwartzentruber
Copy link
Collaborator Author

In a new fresh Python 3.6 venv on rev 238464c, there still are the following errors:

$ mypy .
ffpuppet/test_sanitizer_util.py:15: error: Untyped decorator makes function "test_sanitizer_options_01" untyped  [misc]
ffpuppet/test_minidump_parser.py:165: error: Untyped decorator makes function "test_minidump_parser_06" untyped  [misc]
ffpuppet/test_ffpuppet.py:88: error: Untyped decorator makes function "test_ffpuppet_00" untyped  [misc]
ffpuppet/test_main.py:17: error: Untyped decorator makes function "test_main_01" untyped  [misc]
Found 4 errors in 4 files (checked 21 source files)

Yes, that's because of missing annotations for pytest fixtures when pytest isn't installed. Using tox or pre-commit will install pytest to avoid these errors.

@nth10sd
Copy link
Contributor

nth10sd commented Jan 7, 2022

Yes, you're right!

Copy link
Collaborator

@tysmith tysmith left a comment

Choose a reason for hiding this comment

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

Looks good, thank you!

@jschwartzentruber jschwartzentruber merged commit f783286 into MozillaSecurity:master Feb 22, 2022
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.

None yet

3 participants