Commit 8c2c7dee authored by Kirill Smelkov's avatar Kirill Smelkov

Fix handling of non-py2 eggs

namever restructuring caugh a thinko/bug in a2107a92 (Handle
%(__buildout_space_n__)s & co in .installed.cfg) - there test eggs were
wrongly emitted into BOM with .egg suffix in version.
parent 3c24faaa
......@@ -281,8 +281,11 @@ _osdn_f = re.compile(r'/osdn.net/frs/redir.php\?f=(?P<f>.+)$')
def namever(url, failonerr=True): # -> (name, ver) | None if !failonerr
# http://www.ijg.org/files/jpegsrc.v9d.tar.gz -> http://www.ijg.org/files/jpegsrc.v9d
def del_tgztail(s):
for tail in ('.tgz', '.tar.gz', '.tbz', '.tar.bz2', '.tar.xz', '.tar.lz', '.zip',
'-py2.7.egg', '-py2.7-linux-x86_64.egg'): # FIXME -> re to cover py2/py3 x86/arm ...
for tail in ('.tgz', '.tar.gz', '.tbz', '.tar.bz2', '.tar.xz', '.tar.lz', '.zip', '.egg'):
s = removesuffix(s, tail)
for tail in ('-linux-x86_64',): # FIXME x86/arm, non-linux ?
s = removesuffix(s, tail)
for tail in ['-py2.7'] + ['-py3.%d' % _ for _ in range(20)]:
s = removesuffix(s, tail)
return s
url = del_tgztail(url)
......
......@@ -249,8 +249,8 @@ eggs =
-- /ROOT/eggs/bbb-5.6.7.egg/x --
""", """
>>> eggs:
aaa 1.2.3.egg https://pypi.org/project/aaa/1.2.3.egg/
bbb 5.6.7.egg https://pypi.org/project/bbb/5.6.7.egg/
aaa 1.2.3 https://pypi.org/project/aaa/1.2.3/
bbb 5.6.7 https://pypi.org/project/bbb/5.6.7/
""")
# +slapospatchedXXX is removed from egg URL
......@@ -331,6 +331,25 @@ Cython 0.29.24 https://pypi.org/project/Cython/0.29.24/
cython_zstd 0.2 https://pypi.org/project/cython_zstd/0.2/
""")
# py3 eggs
case1("""\
[xxx]
recipe = zc.recipe.egg
_d = /ROOT/develop-eggs
_e = /ROOT/eggs
eggs = aaa
bbb
ccc
-- /ROOT/eggs/aaa-1.2-py3.7.egg/x --
-- /ROOT/eggs/bbb-3.4-py3.8.egg/x --
-- /ROOT/develop-eggs/ccc-5.6.7-py3.9-linux-x86_64.egg/x --
""", """
>>> eggs:
aaa 1.2 https://pypi.org/project/aaa/1.2/
bbb 3.4 https://pypi.org/project/bbb/3.4/
ccc 5.6.7 https://pypi.org/project/ccc/5.6.7/
""")
@pytest.mark.parametrize('build,bomok', testv)
def test_bom_software(tmpdir, build, bomok):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment