Skip to content

Commit

Permalink
fix linux-ppc64 for linux-ppc64le subdir recognition
Browse files Browse the repository at this point in the history
  • Loading branch information
kalefranz committed Apr 24, 2020
1 parent c69f178 commit 7a5b83d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions conda/base/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"linux-aarch64",
"linux-armv6l",
"linux-armv7l",
"linux-ppc64",
"linux-ppc64le",
"linux-ppc64le", # ppc64le needs to come before ppc64 because
"linux-ppc64", # conda.common.url.split_platform() will find the first match for the subdir
"osx-64",
"win-32",
"win-64",
Expand Down
4 changes: 2 additions & 2 deletions conda/common/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@ def split_platform(url, known_subdirs):
Examples:
>>> from conda.base.constants import PLATFORM_DIRECTORIES
>>> split_platform("https://1.2.3.4/t/tk-123/osx-64/path", PLATFORM_DIRECTORIES)
(u'https://1.2.3.4/t/tk-123/path', u'osx-64')
>>> split_platform("https://1.2.3.4/t/tk-123/linux-ppc64le/path", PLATFORM_DIRECTORIES)
(u'https://1.2.3.4/t/tk-123/path', u'linux-ppc64le')
"""
_platform_match_regex = r'/(%s)/?' % r'|'.join(r'%s' % d for d in known_subdirs)
Expand Down
8 changes: 8 additions & 0 deletions tests/models/test_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,3 +1083,11 @@ def test_multichannel_priority():
('https://conda.anaconda.org/conda-forge/linux-32', ('conda-forge', 3)),
('https://conda.anaconda.org/conda-forge/noarch', ('conda-forge', 3)),
])


def test_ppc64le_vs_ppc64():
ppc64le_channel = Channel("https://conda.anaconda.org/dummy-channel/linux-ppc64le")
assert ppc64le_channel.url() == "https://conda.anaconda.org/dummy-channel/linux-ppc64le"

ppc64_channel = Channel("https://conda.anaconda.org/dummy-channel/linux-ppc64")
assert ppc64_channel.url() == "https://conda.anaconda.org/dummy-channel/linux-ppc64"

0 comments on commit 7a5b83d

Please sign in to comment.