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

Add type annotations to secure_tempfile.py and models.py #5534

Conversation

nabla-c0d3
Copy link
Contributor

@nabla-c0d3 nabla-c0d3 commented Sep 26, 2020

Status

Ready.

Description of Changes

To help with #4399 , this PR adds type annotations in the following files:

  • secure_tempfile.py
  • models.py
  • upload-screenshots.py

@nabla-c0d3 nabla-c0d3 force-pushed the typing-annotations-models-and-secure-tempfile branch from 3f4a9e1 to 37ceed5 Compare September 27, 2020 02:50
@nabla-c0d3 nabla-c0d3 marked this pull request as ready for review September 27, 2020 02:51
@eloquence eloquence added this to Ready for Review in SecureDrop Team Board Oct 1, 2020
@nabla-c0d3 nabla-c0d3 force-pushed the typing-annotations-models-and-secure-tempfile branch from 37ceed5 to fe75388 Compare October 10, 2020 21:15
Copy link
Contributor

@rmol rmol left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me, except I had a couple of questions about Any usage, and would like not to lose test coverage. 🙂

securedrop/models.py Show resolved Hide resolved
securedrop/models.py Show resolved Hide resolved
securedrop/models.py Show resolved Hide resolved
securedrop/request_that_secures_file_uploads.py Outdated Show resolved Hide resolved
securedrop/tests/test_db.py Show resolved Hide resolved
securedrop/upload-screenshots.py Show resolved Hide resolved
Add type annotations to upload-screenshots.py

Add type annotations to request_that_secures_file_uploads.py

Add type annotations to models.py

Fix type

Fix type

Remove legacy tests

Add more specific types to _secure_file_stream
@nabla-c0d3 nabla-c0d3 force-pushed the typing-annotations-models-and-secure-tempfile branch from fe75388 to 85a4582 Compare October 17, 2020 03:39
@rmol rmol merged commit 6246482 into freedomofpress:develop Oct 20, 2020
SecureDrop Team Board automation moved this from Ready for Review to Done Oct 20, 2020
@nabla-c0d3 nabla-c0d3 deleted the typing-annotations-models-and-secure-tempfile branch October 24, 2020 17:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants