I am the maintainer of latexmk, and the next version will have the ability to be configured to support pythontex properly, without the previous limitations. (This was provoked by a user request).
It would help latexmk (and other similar tools that automate the compilation of LaTeX files) if there were an easy way to determine the dependencies of a pythontex run. For example, if the user's code executes
pytex.add_dependencies("data.txt")
it would be useful for latexmk itself to know the file data.txt is a source file (i.e., a dependency) for the pythontex run, and thus a change in the file would cause latexmk to rerun pythontex.
The information is evidently written by pythontex to the pythontex_data.pkl file, but that is a binary file, and probably not appropriate for parsing by other software. So I would like to suggest that, for each dependency, python writes a line in a standardized format to the .pytxmcr file, say
%PythonTeX dependency: 'data.txt'
It's a TeX comment, so it doesn't affect what happens when the .pytxmcr file is read in by the document during a LaTeX compilation.
I am the maintainer of latexmk, and the next version will have the ability to be configured to support pythontex properly, without the previous limitations. (This was provoked by a user request).
It would help latexmk (and other similar tools that automate the compilation of LaTeX files) if there were an easy way to determine the dependencies of a pythontex run. For example, if the user's code executes
it would be useful for latexmk itself to know the file data.txt is a source file (i.e., a dependency) for the pythontex run, and thus a change in the file would cause latexmk to rerun pythontex.
The information is evidently written by pythontex to the pythontex_data.pkl file, but that is a binary file, and probably not appropriate for parsing by other software. So I would like to suggest that, for each dependency, python writes a line in a standardized format to the .pytxmcr file, say
It's a TeX comment, so it doesn't affect what happens when the .pytxmcr file is read in by the document during a LaTeX compilation.