launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #28548
[Merge] ~jugmac00/launchpad:artifact-pattern-matching-for-conda into launchpad:master
Jürgen Gmach has proposed merging ~jugmac00/launchpad:artifact-pattern-matching-for-conda into launchpad:master.
Commit message:
Add artifact pattern matching for Conda
Requested reviews:
Launchpad code reviewers (launchpad-reviewers)
For more details, see:
https://code.launchpad.net/~jugmac00/launchpad/+git/launchpad/+merge/424191
--
Your team Launchpad code reviewers is requested to review the proposed merge of ~jugmac00/launchpad:artifact-pattern-matching-for-conda into launchpad:master.
diff --git a/lib/lp/archivepublisher/artifactory.py b/lib/lp/archivepublisher/artifactory.py
index 5ce6460..6d43b6c 100644
--- a/lib/lp/archivepublisher/artifactory.py
+++ b/lib/lp/archivepublisher/artifactory.py
@@ -372,6 +372,11 @@ class ArtifactoryPool:
]
elif repository_format == ArchiveRepositoryFormat.PYTHON:
return ["*.whl"]
+ elif repository_format == ArchiveRepositoryFormat.CONDA:
+ return [
+ "*.tar.bz2",
+ "*.conda",
+ ]
else:
raise AssertionError(
"Unknown repository format %r" % repository_format)
diff --git a/lib/lp/archivepublisher/tests/test_artifactory.py b/lib/lp/archivepublisher/tests/test_artifactory.py
index 8f3e7b1..6fe9ad1 100644
--- a/lib/lp/archivepublisher/tests/test_artifactory.py
+++ b/lib/lp/archivepublisher/tests/test_artifactory.py
@@ -192,6 +192,16 @@ class TestArtifactoryPool(TestCase):
["*.whl"],
pool.getArtifactPatterns(ArchiveRepositoryFormat.PYTHON))
+ def test_getArtifactPatterns_conda(self):
+ pool = self.makePool()
+ self.assertEqual(
+ [
+ "*.tar.bz2",
+ "*.conda",
+ ],
+ pool.getArtifactPatterns(ArchiveRepositoryFormat.CONDA)
+ )
+
def test_getAllArtifacts(self):
# getAllArtifacts mostly relies on constructing a correct AQL query,
# which we can't meaningfully test without a real Artifactory
@@ -211,6 +221,10 @@ class TestArtifactoryPool(TestCase):
pool=pool, source_name="bar", source_version="1.0",
filename="bar-1.0.whl", release_type=FakeReleaseType.BINARY,
release_id=3).addToPool()
+ ArtifactoryPoolTestingFile(
+ pool=pool, source_name="qux", source_version="1.0",
+ filename="qux-1.0.conda", release_type=FakeReleaseType.BINARY,
+ release_id=4).addToPool()
self.assertEqual(
{
PurePath("pool/f/foo/foo-1.0.deb"): {
@@ -236,6 +250,17 @@ class TestArtifactoryPool(TestCase):
},
pool.getAllArtifacts(
self.repository_name, ArchiveRepositoryFormat.PYTHON))
+ self.assertEqual(
+ {
+ PurePath("pool/q/qux/qux-1.0.conda"): {
+ "launchpad.release-id": ["binary:4"],
+ "launchpad.source-name": ["qux"],
+ "launchpad.source-version": ["1.0"],
+ },
+ },
+ pool.getAllArtifacts(
+ self.repository_name, ArchiveRepositoryFormat.CONDA))
+
class TestArtifactoryPoolFromLibrarian(TestCaseWithFactory):
diff --git a/lib/lp/soyuz/enums.py b/lib/lp/soyuz/enums.py
index 39b8ceb..96acc2e 100644
--- a/lib/lp/soyuz/enums.py
+++ b/lib/lp/soyuz/enums.py
@@ -682,3 +682,10 @@ class ArchiveRepositoryFormat(DBEnumeratedType):
A Python package index (https://www.python.org/dev/peps/pep-0301/).
""")
+
+ CONDA = DBItem(2, """
+ Conda
+
+ A Conda channel
+ (https://docs.conda.io/projects/conda/en/latest/user-guide/concepts/channels.html).
+ """)