Merge ~ilasc/launchpad:add-name-to-conda-pkg into launchpad:master

Proposed by Ioana Lasc
Status: Merged
Approved by: Ioana Lasc
Approved revision: 2b024955bc1cb1cbc83c7792ef5e4f85d5cc447d
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~ilasc/launchpad:add-name-to-conda-pkg
Merge into: launchpad:master
Diff against target: 39 lines (+16/-1)
2 files modified
lib/lp/archivepublisher/artifactory.py (+5/-1)
lib/lp/archivepublisher/tests/test_artifactory.py (+11/-0)
Reviewer Review Type Date Requested Status
Jürgen Gmach Approve
Review via email: mp+432894@code.launchpad.net

Commit message

Add the name to Conda packages

To post a comment you must log in.
Revision history for this message
Jürgen Gmach (jugmac00) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/archivepublisher/artifactory.py b/lib/lp/archivepublisher/artifactory.py
2index f56799e..2df8e2c 100644
3--- a/lib/lp/archivepublisher/artifactory.py
4+++ b/lib/lp/archivepublisher/artifactory.py
5@@ -67,7 +67,11 @@ def _path_for(
6 elif repository_format == ArchiveRepositoryFormat.CONDA:
7 subdir = release.getUserDefinedField("subdir")
8 if subdir is None:
9- raise ValueError("Cannot publish a Conda package with no subdir")
10+ raise ValueError(
11+ "Cannot publish the Conda package '%s' "
12+ "with version '%s', missing the 'subdir' "
13+ "Conda property)" % (source_name, source_version)
14+ )
15 path = rootpath / subdir
16 elif repository_format == ArchiveRepositoryFormat.GO_PROXY:
17 module_path = release.getUserDefinedField("module-path")
18diff --git a/lib/lp/archivepublisher/tests/test_artifactory.py b/lib/lp/archivepublisher/tests/test_artifactory.py
19index 8cea8dd..730e8a9 100644
20--- a/lib/lp/archivepublisher/tests/test_artifactory.py
21+++ b/lib/lp/archivepublisher/tests/test_artifactory.py
22@@ -126,6 +126,17 @@ class TestArtifactoryPool(TestCase):
23 pool.pathFor(None, "foo", "1.0", pub_file),
24 )
25
26+ def test_pathFor_conda_with_file_no_subir(self):
27+ pool = self.makePool(ArchiveRepositoryFormat.CONDA)
28+ pub_file = FakePackageReleaseFile(
29+ b"foo",
30+ "foo-1.0.tar.bz2",
31+ user_defined_fields=[("bogus_filed", "instead_of_subdir")],
32+ )
33+ self.assertRaises(
34+ ValueError, pool.pathFor, None, "foo", "1.0", pub_file
35+ )
36+
37 def test_pathFor_go_proxy_with_file(self):
38 pool = self.makePool(ArchiveRepositoryFormat.GO_PROXY)
39 pub_file = FakePackageReleaseFile(

Subscribers

People subscribed via source and target branches

to status/vote changes: