| | """Tests for distutils.command.build.""" |
| |
|
| | import os |
| | import sys |
| | from distutils.command.build import build |
| | from distutils.tests import support |
| | from sysconfig import get_config_var, get_platform |
| |
|
| |
|
| | class TestBuild(support.TempdirManager): |
| | def test_finalize_options(self): |
| | pkg_dir, dist = self.create_dist() |
| | cmd = build(dist) |
| | cmd.finalize_options() |
| |
|
| | |
| | assert cmd.plat_name == get_platform() |
| |
|
| | |
| | wanted = os.path.join(cmd.build_base, 'lib') |
| | assert cmd.build_purelib == wanted |
| |
|
| | |
| | |
| | |
| | plat_spec = f'.{cmd.plat_name}-{sys.implementation.cache_tag}' |
| | if get_config_var('Py_GIL_DISABLED'): |
| | plat_spec += 't' |
| | if hasattr(sys, 'gettotalrefcount'): |
| | assert cmd.build_platlib.endswith('-pydebug') |
| | plat_spec += '-pydebug' |
| | wanted = os.path.join(cmd.build_base, 'lib' + plat_spec) |
| | assert cmd.build_platlib == wanted |
| |
|
| | |
| | assert cmd.build_lib == cmd.build_purelib |
| |
|
| | |
| | wanted = os.path.join(cmd.build_base, 'temp' + plat_spec) |
| | assert cmd.build_temp == wanted |
| |
|
| | |
| | wanted = os.path.join( |
| | cmd.build_base, f'scripts-{sys.version_info.major}.{sys.version_info.minor}' |
| | ) |
| | assert cmd.build_scripts == wanted |
| |
|
| | |
| | assert cmd.executable == os.path.normpath(sys.executable) |
| |
|