import os import re import urllib.parse import urllib.request import pytest from setuptools import Distribution from setuptools.dist import check_package_data, check_specifier from .fixtures import make_trivial_sdist from .test_find_packages import ensure_files from .textwrap import DALS from distutils.errors import DistutilsSetupError def test_dist_fetch_build_egg(tmpdir): """ Check multiple calls to `Distribution.fetch_build_egg` work as expected. """ index = tmpdir.mkdir('index') index_url = urllib.parse.urljoin('file://', urllib.request.pathname2url(str(index))) def sdist_with_index(distname, version): dist_dir = index.mkdir(distname) dist_sdist = f'{distname}-{version}.tar.gz' make_trivial_sdist(str(dist_dir.join(dist_sdist)), distname, version) with dist_dir.join('index.html').open('w') as fp: fp.write( DALS( """
{dist_sdist}