Commit 43321e47 authored by Xavier Thompson's avatar Xavier Thompson

[test] Add test for PEP 625 workaround

parent 498215d6
...@@ -113,6 +113,23 @@ def create_sample_eggs(test, executable=sys.executable): ...@@ -113,6 +113,23 @@ def create_sample_eggs(test, executable=sys.executable):
os.rename(file, file.lower()) os.rename(file, file.lower())
os.chdir(curdir) os.chdir(curdir)
# PEP 625 sdist for PEP 625 workaround test
write(tmp, 'pep625_wkrd.py', 'def f():\n pass')
write(
tmp, 'setup.py',
"from setuptools import setup\n"
"setup(name='pep625.wkrd', py_modules=['pep625_wkrd'],"
" author='bob', url='bob', author_email='bob',"
" zip_safe=True, version='1.0')\n"
)
zc.buildout.testing.sdist(tmp, dest)
curdir = os.getcwd()
os.chdir(dest)
for file in os.listdir(dest):
if 'pep625.wkrd' in file:
os.rename(file, file.replace('pep625.wkrd', 'pep625_wkrd'))
os.chdir(curdir)
write(tmp, 'eggrecipebigdemo.py', 'import eggrecipedemo') write(tmp, 'eggrecipebigdemo.py', 'import eggrecipedemo')
write( write(
tmp, 'setup.py', tmp, 'setup.py',
...@@ -162,7 +179,6 @@ def create_sample_eggs(test, executable=sys.executable): ...@@ -162,7 +179,6 @@ def create_sample_eggs(test, executable=sys.executable):
"import builddep" "import builddep"
) )
zc.buildout.testing.sdist(tmp, dest) zc.buildout.testing.sdist(tmp, dest)
finally: finally:
shutil.rmtree(tmp) shutil.rmtree(tmp)
......
...@@ -47,6 +47,7 @@ download: ...@@ -47,6 +47,7 @@ download:
<a href="index/">index/</a><br> <a href="index/">index/</a><br>
<a href="mixedcase-0.5.zip">mixedcase-0.5.zip</a><br> <a href="mixedcase-0.5.zip">mixedcase-0.5.zip</a><br>
<a href="other-1.0-pyN.N.egg">other-1.0-pyN.N.egg</a><br> <a href="other-1.0-pyN.N.egg">other-1.0-pyN.N.egg</a><br>
<a href="pep625_wkrd-1.0.zip">pep625_wkrd-1.0.zip</a><br>
<a href="withbuildsystemrequires-0.1.zip">withbuildsystemrequires-0.1.zip</a><br> <a href="withbuildsystemrequires-0.1.zip">withbuildsystemrequires-0.1.zip</a><br>
<a href="withsetuprequires-0.1.zip">withsetuprequires-0.1.zip</a><br> <a href="withsetuprequires-0.1.zip">withsetuprequires-0.1.zip</a><br>
</body></html> </body></html>
......
...@@ -111,6 +111,7 @@ We have a link server that has a number of eggs: ...@@ -111,6 +111,7 @@ We have a link server that has a number of eggs:
<a href="index/">index/</a><br> <a href="index/">index/</a><br>
<a href="mixedcase-0.5.zip">mixedcase-0.5.zip</a><br> <a href="mixedcase-0.5.zip">mixedcase-0.5.zip</a><br>
<a href="other-1.0-pyN.N.egg">other-1.0-pyN.N.egg</a><br> <a href="other-1.0-pyN.N.egg">other-1.0-pyN.N.egg</a><br>
<a href="pep625_wkrd-1.0.zip">pep625_wkrd-1.0.zip</a><br>
<a href="withbuildsystemrequires-0.1.zip">withbuildsystemrequires-0.1.zip</a><br> <a href="withbuildsystemrequires-0.1.zip">withbuildsystemrequires-0.1.zip</a><br>
<a href="withsetuprequires-0.1.zip">withsetuprequires-0.1.zip</a><br> <a href="withsetuprequires-0.1.zip">withsetuprequires-0.1.zip</a><br>
</body></html> </body></html>
...@@ -275,6 +276,36 @@ And cleanup. ...@@ -275,6 +276,36 @@ And cleanup.
>>> _ = get(link_server + 'disable_server_logging') >>> _ = get(link_server + 'disable_server_logging')
>>> rmdir(dest) >>> rmdir(dest)
PEP 625 issues
--------------
Let's install an egg with PEP 625 naming issues.
Specifically, the sdist file is normalized to replace '.' with '_'
in the project name, while the name of the package contains '.'.
Let's enable server logging to check that the PEP 625 file is downloaded.
>>> _ = get(link_server + 'enable_server_logging')
GET 200 /enable_server_logging
>>> ws = zc.buildout.easy_install.install(
... ['pep625.wkrd'], dest,
... links=[link_server], index=link_server+'index/')
GET 404 /index/pep625.wkrd/
GET 200 /pep625_wkrd-1.0.zip
Let's check that the original project name dist is installed.
>>> for dist in ws:
... print_(dist)
pep625.wkrd 1.0
>>> ls(dest)
d pep625.wkrd-1.0-pyN.N.egg
And cleanup.
>>> _ = get(link_server + 'disable_server_logging')
>>> rmdir(dest)
Specifying version information independent of requirements Specifying version information independent of requirements
---------------------------------------------------------- ----------------------------------------------------------
...@@ -1251,6 +1282,7 @@ Let's update our link server with a new version of extdemo: ...@@ -1251,6 +1282,7 @@ Let's update our link server with a new version of extdemo:
<a href="index/">index/</a><br> <a href="index/">index/</a><br>
<a href="mixedcase-0.5.zip">mixedcase-0.5.zip</a><br> <a href="mixedcase-0.5.zip">mixedcase-0.5.zip</a><br>
<a href="other-1.0-pyN.N.egg">other-1.0-pyN.N.egg</a><br> <a href="other-1.0-pyN.N.egg">other-1.0-pyN.N.egg</a><br>
<a href="pep625_wkrd-1.0.zip">pep625_wkrd-1.0.zip</a><br>
<a href="withbuildsystemrequires-0.1.zip">withbuildsystemrequires-0.1.zip</a><br> <a href="withbuildsystemrequires-0.1.zip">withbuildsystemrequires-0.1.zip</a><br>
<a href="withsetuprequires-0.1.zip">withsetuprequires-0.1.zip</a><br> <a href="withsetuprequires-0.1.zip">withsetuprequires-0.1.zip</a><br>
</body></html> </body></html>
......
...@@ -54,6 +54,7 @@ We have a link server that has a number of distributions: ...@@ -54,6 +54,7 @@ We have a link server that has a number of distributions:
<a href="index/">index/</a><br> <a href="index/">index/</a><br>
<a href="mixedcase-0.5.zip">mixedcase-0.5.zip</a><br> <a href="mixedcase-0.5.zip">mixedcase-0.5.zip</a><br>
<a href="other-1.0-pyN.N.egg">other-1.0-pyN.N.egg</a><br> <a href="other-1.0-pyN.N.egg">other-1.0-pyN.N.egg</a><br>
<a href="pep625_wkrd-1.0.zip">pep625_wkrd-1.0.zip</a><br>
<a href="withbuildsystemrequires-0.1.zip">withbuildsystemrequires-0.1.zip</a><br> <a href="withbuildsystemrequires-0.1.zip">withbuildsystemrequires-0.1.zip</a><br>
<a href="withsetuprequires-0.1.zip">withsetuprequires-0.1.zip</a><br> <a href="withsetuprequires-0.1.zip">withsetuprequires-0.1.zip</a><br>
</body></html> </body></html>
......
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