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

ARXIVNG-2885: Implement support for TeX Produced check #77

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from

Conversation

DavidLFielding
Copy link
Contributor

@DavidLFielding DavidLFielding commented Feb 25, 2020

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.

@DavidLFielding DavidLFielding marked this pull request as ready for review March 3, 2020 23:50
@DavidLFielding DavidLFielding requested review from bmaltzan and SBBCornell and removed request for SBBCornell March 3, 2020 23:51
Copy link
Contributor

@bdc34 bdc34 left a 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:
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@mhl10 mhl10 left a 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.

@DavidLFielding
Copy link
Contributor Author

I'm done with this PR unless there are additional suggestions.

@DavidLFielding
Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SIZE_LIMIT = 15000000
SIZE_LIMIT = 15_000_000

(just for readability per PEP515)

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.

3 participants