Skip to content

add compresslevel to archive_util.make_tarball, fix test_archive_util - #418

Open
ds-cbo wants to merge 1 commit into
pypa:mainfrom
ds-cbo:archiveutil-compressionlevel
Open

add compresslevel to archive_util.make_tarball, fix test_archive_util#418
ds-cbo wants to merge 1 commit into
pypa:mainfrom
ds-cbo:archiveutil-compressionlevel

Conversation

@ds-cbo

@ds-cbo ds-cbo commented Jul 21, 2026

Copy link
Copy Markdown

title mostly speaks for itself, but as for the why: I notice that build -s is taking a very long time and 90% of it is spent hugely optimizing the tarball as level 9 is the default, I would like to fine-tune that in setuptools, but first distutils needs to support passing it along to tarfile.open

while testing, I noticed that the entire tets_archive_util file was ignored when running python3.14 -m pytest, which seemed to be fixed when prefixing the class with Test like any other class in the directory, presumably some leftover from a different testing framework



class ArchiveUtilTestCase(support.TempdirManager):
class TestArchiveUtil(TestCase, support.TempdirManager):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

class name must start with Test for pytest to detect it as something that is testable, TestCase must be added for the default addCleanup function that patch is using

def _make_tarball(self, tmpdir, target_name, suffix, **kwargs):
tmpdir2 = self.mkdtemp()
if same_drive(tmpdir, tmpdir2):
if not same_drive(tmpdir, tmpdir2):

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

this looked like a logic error to me, it would skip every test

@ds-cbo ds-cbo changed the title add compresslevel to archive_util, fix test_archive_util add compresslevel to archive_util.make_tarball, fix test_archive_util Jul 21, 2026
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.

1 participant