← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3only-lzma into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3only-lzma into launchpad:master.

Commit message:
Use Python 3 lzma module directly

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/406659
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3only-lzma into launchpad:master.
diff --git a/lib/lp/archivepublisher/publishing.py b/lib/lp/archivepublisher/publishing.py
index b87c7ce..301e526 100644
--- a/lib/lp/archivepublisher/publishing.py
+++ b/lib/lp/archivepublisher/publishing.py
@@ -27,6 +27,7 @@ from itertools import (
     groupby,
     )
 import logging
+import lzma
 from operator import attrgetter
 import os
 import shutil
@@ -69,7 +70,6 @@ from lp.registry.interfaces.pocket import (
     )
 from lp.registry.interfaces.series import SeriesStatus
 from lp.registry.model.distroseries import DistroSeries
-from lp.services.compat import lzma
 from lp.services.database.constants import UTC_NOW
 from lp.services.database.interfaces import IStore
 from lp.services.features import getFeatureFlag
diff --git a/lib/lp/archivepublisher/tests/test_publisher.py b/lib/lp/archivepublisher/tests/test_publisher.py
index b0173cb..53f2d76 100644
--- a/lib/lp/archivepublisher/tests/test_publisher.py
+++ b/lib/lp/archivepublisher/tests/test_publisher.py
@@ -19,6 +19,7 @@ from functools import partial
 import gzip
 import hashlib
 from itertools import product
+import lzma
 from operator import attrgetter
 import os
 import shutil
@@ -82,10 +83,7 @@ from lp.registry.interfaces.pocket import (
     pocketsuffix,
     )
 from lp.registry.interfaces.series import SeriesStatus
-from lp.services.compat import (
-    lzma,
-    mock,
-    )
+from lp.services.compat import mock
 from lp.services.config import config
 from lp.services.database.constants import UTC_NOW
 from lp.services.database.sqlbase import flush_database_caches
diff --git a/lib/lp/archivepublisher/tests/test_repositoryindexfile.py b/lib/lp/archivepublisher/tests/test_repositoryindexfile.py
index b7ebac3..c60da47 100644
--- a/lib/lp/archivepublisher/tests/test_repositoryindexfile.py
+++ b/lib/lp/archivepublisher/tests/test_repositoryindexfile.py
@@ -7,6 +7,7 @@ __metaclass__ = type
 
 import bz2
 import gzip
+import lzma
 import os
 import shutil
 import stat
@@ -14,7 +15,6 @@ import tempfile
 import unittest
 
 from lp.archivepublisher.utils import RepositoryIndexFile
-from lp.services.compat import lzma
 from lp.soyuz.enums import IndexCompressionType
 
 
diff --git a/lib/lp/archivepublisher/utils.py b/lib/lp/archivepublisher/utils.py
index 1736af9..3731675 100644
--- a/lib/lp/archivepublisher/utils.py
+++ b/lib/lp/archivepublisher/utils.py
@@ -13,11 +13,11 @@ __all__ = [
 
 import bz2
 import gzip
+import lzma
 import os
 import stat
 import tempfile
 
-from lp.services.compat import lzma
 from lp.soyuz.enums import (
     ArchivePurpose,
     IndexCompressionType,
diff --git a/lib/lp/archiveuploader/tests/test_nascentuploadfile.py b/lib/lp/archiveuploader/tests/test_nascentuploadfile.py
index 1d0df62..cedc89a 100644
--- a/lib/lp/archiveuploader/tests/test_nascentuploadfile.py
+++ b/lib/lp/archiveuploader/tests/test_nascentuploadfile.py
@@ -9,6 +9,7 @@ from functools import partial
 import gzip
 import hashlib
 import io
+import lzma
 import os
 import subprocess
 import tarfile
@@ -40,10 +41,7 @@ from lp.archiveuploader.nascentuploadfile import (
 from lp.archiveuploader.tests import AbsolutelyAnythingGoesUploadPolicy
 from lp.buildmaster.enums import BuildStatus
 from lp.registry.interfaces.pocket import PackagePublishingPocket
-from lp.services.compat import (
-    lzma,
-    mock,
-    )
+from lp.services.compat import mock
 from lp.services.log.logger import BufferLogger
 from lp.services.osutils import write_file
 from lp.soyuz.enums import (
diff --git a/lib/lp/services/compat.py b/lib/lp/services/compat.py
index 9f6d16a..2ee16dd 100644
--- a/lib/lp/services/compat.py
+++ b/lib/lp/services/compat.py
@@ -9,7 +9,6 @@ Use this for things that six doesn't provide.
 __metaclass__ = type
 __all__ = [
     'escape',
-    'lzma',
     'message_as_bytes',
     'message_from_bytes',
     'mock',
@@ -34,11 +33,6 @@ except ImportError:
 import io
 
 try:
-    import lzma
-except ImportError:
-    from backports import lzma
-
-try:
     import mock
 except ImportError:
     from unittest import mock
diff --git a/requirements/launchpad.txt b/requirements/launchpad.txt
index 2388633..603983a 100644
--- a/requirements/launchpad.txt
+++ b/requirements/launchpad.txt
@@ -14,7 +14,6 @@ asn1crypto==0.23.0
 attrs==19.3.0
 Automat==0.6.0
 backports.functools-lru-cache==1.5
-backports.lzma==0.0.3
 # ztk-versions.cfg uses 3.2.0 on Python 3, but that drops support for Python
 # 3.5.  Pin to 3.1.7 until we no longer care about xenial.
 bcrypt==3.1.7
diff --git a/setup.py b/setup.py
index 28a8d2f..235a234 100644
--- a/setup.py
+++ b/setup.py
@@ -150,7 +150,6 @@ setup(
     # used in zcml.
     install_requires=[
         'ampoule',
-        'backports.lzma; python_version < "3.3"',
         'beautifulsoup4[lxml]',
         'boto3',
         'breezy',
diff --git a/utilities/python_standard_libs.py b/utilities/python_standard_libs.py
index eb76673..9fd706e 100644
--- a/utilities/python_standard_libs.py
+++ b/utilities/python_standard_libs.py
@@ -165,6 +165,7 @@ python_standard_libs = [
     'linecache',
     'locale',
     'logging',
+    'lzma',
     'macerrors',
     'MacOS',
     'macostools',