<s> """<STR_LIT>""" <EOL> import sys <EOL> import shutil <EOL> import pytest <EOL> import py . path <EOL> import tempfile <EOL> import subprocess <EOL> SETUP_PY = """<STR_LIT>""" <EOL> @ pytest . fixture <EOL> def temp_pkg ( request ) : <EOL> tempdir = tempfile . mkdtemp ( ) <EOL> def fin ( ) : <EOL> shutil . rmtree ( tempdir ) <EOL> request . addfinalizer ( fin ) <EOL> temppath = py . path . local ( tempdir ) <EOL> temppath . join ( '<STR_LIT>' ) . write ( '<STR_LIT>' ) <EOL> temppath . join ( '<STR_LIT>' ) . write ( SETUP_PY ) <EOL> return temppath <EOL> def test_default_tag ( temp_pkg ) : <EOL> subprocess . check_call ( [ sys . executable , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cwd = str ( temp_pkg ) ) <EOL> dist_dir = temp_pkg . join ( '<STR_LIT>' ) <EOL> assert dist_dir . check ( dir = <NUM_LIT:1> ) <EOL> wheels = dist_dir . listdir ( ) <EOL> assert len ( wheels ) == <NUM_LIT:1> <EOL> assert wheels [ <NUM_LIT:0> ] . basename . startswith ( '<STR_LIT>' % ( sys . version [ <NUM_LIT:0> ] , ) ) <EOL> assert wheels [ <NUM_LIT:0> ] . ext == '<STR_LIT>' <EOL> def test_explicit_tag ( temp_pkg ) : <EOL> subprocess . check_call ( <EOL> [ sys . executable , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cwd = str ( temp_pkg ) ) <EOL> dist_dir = temp_pkg . join ( '<STR_LIT>' ) <EOL> assert dist_dir . check ( dir = <NUM_LIT:1> ) <EOL> wheels = dist_dir . listdir ( ) <EOL> assert len ( wheels ) == <NUM_LIT:1> <EOL> assert wheels [ <NUM_LIT:0> ] . basename . startswith ( '<STR_LIT>' ) <EOL> assert wheels [ <NUM_LIT:0> ] . ext == '<STR_LIT>' <EOL> def test_universal_tag ( temp_pkg ) : <EOL> subprocess . check_call ( <EOL> [ sys . executable , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cwd = str ( temp_pkg ) ) <EOL> dist_dir = temp_pkg . join ( '<STR_LIT>' ) <EOL> assert dist_dir . check ( dir = <NUM_LIT:1> ) <EOL> wheels = dist_dir . listdir ( ) <EOL> assert len ( wheels ) == <NUM_LIT:1> <EOL> assert wheels [ <NUM_LIT:0> ] . basename . startswith ( '<STR_LIT>' ) <EOL> assert wheels [ <NUM_LIT:0> ] . ext == '<STR_LIT>' <EOL> def test_universal_beats_explicit_tag ( temp_pkg ) : <EOL> subprocess . check_call ( <EOL> [ sys . executable , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cwd = str ( temp_pkg ) ) <EOL> dist_dir = temp_pkg . join ( '<STR_LIT>' ) <EOL> assert dist_dir . check ( dir = <NUM_LIT:1> ) <EOL> wheels = dist_dir . listdir ( ) <EOL> assert len ( wheels ) == <NUM_LIT:1> <EOL> assert wheels [ <NUM_LIT:0> ] . basename . startswith ( '<STR_LIT>' ) <EOL> assert wheels [ <NUM_LIT:0> ] . ext == '<STR_LIT>' <EOL> def test_universal_in_setup_cfg ( temp_pkg ) : <EOL> temp_pkg . join ( '<STR_LIT>' ) . write ( '<STR_LIT>' ) <EOL> subprocess . check_call ( <EOL> [ sys . executable , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cwd = str ( temp_pkg ) ) <EOL> dist_dir = temp_pkg . join ( '<STR_LIT>' ) <EOL> assert dist_dir . check ( dir = <NUM_LIT:1> ) <EOL> wheels = dist_dir . listdir ( ) <EOL> assert len ( wheels ) == <NUM_LIT:1> <EOL> assert wheels [ <NUM_LIT:0> ] . basename . startswith ( '<STR_LIT>' ) <EOL> assert wheels [ <NUM_LIT:0> ] . ext == '<STR_LIT>' <EOL> def test_pythontag_in_setup_cfg ( temp_pkg ) : <EOL> temp_pkg . join ( '<STR_LIT>' ) . write ( '<STR_LIT>' ) <EOL> subprocess . check_call ( <EOL> [ sys . executable , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cwd = str ( temp_pkg ) ) <EOL> dist_dir = temp_pkg . join ( '<STR_LIT>' ) <EOL> assert dist_dir . check ( dir = <NUM_LIT:1> ) <EOL> wheels = dist_dir . listdir ( ) <EOL> assert len ( wheels ) == <NUM_LIT:1> <EOL> assert wheels [ <NUM_LIT:0> ] . basename . startswith ( '<STR_LIT>' ) <EOL> assert wheels [ <NUM_LIT:0> ] . ext == '<STR_LIT>' <EOL> def test_legacy_wheel_section_in_setup_cfg ( temp_pkg ) : <EOL> temp_pkg . join ( '<STR_LIT>' ) . write ( '<STR_LIT>' ) <EOL> subprocess . check_call ( <EOL> [ sys . executable , '<STR_LIT>' , '<STR_LIT>' ] , <EOL> cwd = str ( temp_pkg ) ) <EOL> dist_dir = temp_pkg . join ( '<STR_LIT>' ) <EOL> assert dist_dir . check ( dir = <NUM_LIT:1> ) <EOL> wheels = dist_dir . listdir ( ) <EOL> assert len ( wheels ) == <NUM_LIT:1> <EOL> assert wheels [ <NUM_LIT:0> ] . basename . startswith ( '<STR_LIT>' ) <EOL> assert wheels [ <NUM_LIT:0> ] . ext == '<STR_LIT>' </s>
