arxiv-to-prompt 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {arxiv_to_prompt-0.2.0/src/arxiv_to_prompt.egg-info → arxiv_to_prompt-0.2.1}/PKG-INFO +1 -1
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/pyproject.toml +1 -1
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt/core.py +2 -1
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1/src/arxiv_to_prompt.egg-info}/PKG-INFO +1 -1
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/tests/test_core.py +43 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/LICENSE +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/README.md +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/setup.cfg +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt/__init__.py +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt/cli.py +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt.egg-info/SOURCES.txt +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt.egg-info/dependency_links.txt +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt.egg-info/entry_points.txt +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt.egg-info/requires.txt +0 -0
- {arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt.egg-info/top_level.txt +0 -0
|
@@ -192,7 +192,8 @@ def flatten_tex(directory: str, main_file: str) -> str:
|
|
|
192
192
|
|
|
193
193
|
# Process the command normally
|
|
194
194
|
input_file = match.group(1)
|
|
195
|
-
|
|
195
|
+
# Only add .tex extension if the file has no extension at all
|
|
196
|
+
if not os.path.splitext(input_file)[1]:
|
|
196
197
|
input_file += '.tex'
|
|
197
198
|
input_path = os.path.join(directory, input_file)
|
|
198
199
|
return process_file(input_path, processed_files)
|
|
@@ -228,3 +228,46 @@ def test_process_latex_with_appendix_removal(sample_arxiv_id, temp_cache_dir):
|
|
|
228
228
|
|
|
229
229
|
# Check that appendix was removed (if it existed)
|
|
230
230
|
assert "\\appendix" not in result
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
def test_input_file_extensions(temp_cache_dir):
|
|
234
|
+
"""Test that input files with existing extensions are not modified."""
|
|
235
|
+
# Create test directory and files
|
|
236
|
+
tex_dir = temp_cache_dir / "test_extensions"
|
|
237
|
+
tex_dir.mkdir(parents=True)
|
|
238
|
+
|
|
239
|
+
# Create main file with various input commands
|
|
240
|
+
main_file = tex_dir / "main.tex"
|
|
241
|
+
main_content = """\\documentclass{article}
|
|
242
|
+
\\begin{document}
|
|
243
|
+
\\input{chapter1}
|
|
244
|
+
\\input{main.bbl}
|
|
245
|
+
\\input{mystyle.sty}
|
|
246
|
+
\\input{config.cls}
|
|
247
|
+
\\input{already.tex}
|
|
248
|
+
\\end{document}
|
|
249
|
+
"""
|
|
250
|
+
main_file.write_text(main_content)
|
|
251
|
+
|
|
252
|
+
# Create the files that should be included
|
|
253
|
+
files_to_create = [
|
|
254
|
+
("chapter1.tex", "Chapter 1 content"),
|
|
255
|
+
("main.bbl", "Bibliography content"),
|
|
256
|
+
("mystyle.sty", "Style content"),
|
|
257
|
+
("config.cls", "Class content"),
|
|
258
|
+
("already.tex", "Already tex content"),
|
|
259
|
+
]
|
|
260
|
+
|
|
261
|
+
for filename, content in files_to_create:
|
|
262
|
+
file_path = tex_dir / filename
|
|
263
|
+
file_path.write_text(content)
|
|
264
|
+
|
|
265
|
+
# Run the flatten_tex function
|
|
266
|
+
result = flatten_tex(str(tex_dir), "main.tex")
|
|
267
|
+
|
|
268
|
+
# Check that all files were included correctly
|
|
269
|
+
assert "Chapter 1 content" in result
|
|
270
|
+
assert "Bibliography content" in result
|
|
271
|
+
assert "Style content" in result
|
|
272
|
+
assert "Class content" in result
|
|
273
|
+
assert "Already tex content" in result
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{arxiv_to_prompt-0.2.0 → arxiv_to_prompt-0.2.1}/src/arxiv_to_prompt.egg-info/entry_points.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|