-
Notifications
You must be signed in to change notification settings - Fork 12
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
ARXIVNG-2885: Implement support for TeX Produced check #77
base: develop
Are you sure you want to change the base?
Conversation
…heck. [ARXIVNG-2885] David
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not run the tests by changing to the directory and running nose2.
I did cd arxiv-submittion-core/core ; pytest -v arxiv/submission/process/checks
The tests passed for me.
|
||
try: | ||
line = stream.read() | ||
while len(line) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this have a maximum size it will read? Just to avoid a runaway loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added size and time limits to this read to avoid misbehaving File manager.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good! Please address failing tests before merging.
…RXIVNG-2885] David
I'm done with this PR unless there are additional suggestions. |
Final package version arxiv-submission-core-0.7.2rc16. |
@@ -58,6 +60,10 @@ | |||
IN_PROGRESS: Status = 'in_progress' | |||
NOT_STARTED: Status = 'not_started' | |||
|
|||
# Limits for reading stream of content | |||
SIZE_LIMIT = 15000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SIZE_LIMIT = 15000000 | |
SIZE_LIMIT = 15_000_000 |
(just for readability per PEP515)
Task [ ARXIVNG-2885 ] implements the TeX produced check. This check examines PDF and Postscript submissions to determine whether they were generated from TeX source. In cases of TeX produced single-file submissions arXiv would like the submitter to upload actual TeX source wherever possible.
The code that runs when a user hits the 'process' step in the Submission UI is implemented in the arxiv-submission-core package so the new TeX Produced check is located with this processing code.
The new TeXProduced check lives in core/arxiv/submission/process/checks/TexProduced. A large number of test files are included with the tests. The module has methods to process files using the 'pdfinfo' and 'pdffonts' commands along with methods that process steams using the PyPDF2 package. To manually run the new test you will want to cd into the checks directory and fire up a pipenv shell and run: 'nose2 -v test_tex_produced'. You will need the pdfinfo and pdffonts commands installed on your system for the file-bases tests to run successfully.
There is additional code in the Submission UI repository which presents the TeX produced error to the end-user.
The latest changes have been pushed to PyPi as version 0.7.2rc14. The accompanying Submission UI PR has been modified to use this newer image.