Package standalone source CLI with verified runtime and notices

This commit is contained in:
2026-09-11 05:48:05 -07:00
parent 6a610616e7
commit 27df4a3945
23 changed files with 2239 additions and 115 deletions
+38
View File
@@ -61,6 +61,44 @@ class PackageContracts(unittest.TestCase):
self.assertEqual(archive.getmember('fixture/examples/temperature delta.txt').mode, 0o644)
self.assertEqual(len(archive.getmembers()), 3)
def test_cli_document_closure_uses_own_readme_and_transitive_links(self):
names = ['LICENSE', 'docs/source-cli.md', 'docs/language.rst', 'docs/language.html',
'examples/text-first/README.md', 'examples/text-first/project.arcadia',
'docs/linked.md', 'docs/linked.html', 'examples/release1/oa/module.arcadia']
for name in names:
self.file(name, b'fixture')
self.file('scripts/package-cli-readme.md', b'[CLI](docs/source-cli.md)')
self.file('docs/source-cli.md', b'[More](linked.md)')
self.file('docs/linked.md', b'[HTML](linked.html)')
with patch.object(packaging.subprocess, 'check_output', return_value='\0'.join(names).encode()):
result = packaging.document_inputs(self.root, 'windows', 'cli')
mapped = {entry['path']: entry['source'] for entry in result['files']}
self.assertEqual(Path(mapped['README.md']).name, 'package-cli-readme.md')
self.assertIn('docs/linked.html', mapped)
self.assertIn('examples/text-first/project.arcadia', mapped)
self.assertIn('examples/release1/oa/module.arcadia', mapped)
self.assertNotIn('docs/server.md', mapped)
self.file('docs/linked.md', b'[Missing](untracked.md)')
with patch.object(packaging.subprocess, 'check_output', return_value='\0'.join(names).encode()):
with self.assertRaisesRegex(ValueError, 'Untracked/missing'):
packaging.document_inputs(self.root, 'windows', 'cli')
def test_default_document_roots_equal_explicit_studio(self):
names = ['LICENSE', 'docs/server.md', 'docs/api.rst', 'docs/api.html',
'docs/language.rst', 'docs/language.html', 'docs/windows-packaging.md',
'deployment/Dockerfile', 'deployment/Dockerfile.dockerignore',
'deployment/arcadia-server.service', 'examples/sample.arcadia']
for name in names:
self.file(name, b'fixture')
self.file('scripts/package-readme.md', b'Studio fixture')
with patch.object(packaging.subprocess, 'check_output', return_value='\0'.join(names).encode()):
default = packaging.document_inputs(self.root, 'windows')
explicit = packaging.document_inputs(self.root, 'windows', 'studio')
with self.assertRaisesRegex(ValueError, 'Unknown package product'):
packaging.document_inputs(self.root, 'windows', 'unknown')
self.assertEqual(default, explicit)
self.assertEqual({entry['path'] for entry in default['files']}, set(names) | {'README.md'})
def test_archive_refuses_overwrite_and_case_collisions(self):
self.file('stage/a', b'first')
archive = self.file('archive.tar.gz', b'preserve')