Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit acde188

Browse files
committed
Remove now unused {has,check}_include_file, _check_for_pkg_config.
1 parent aeb03c6 commit acde188

File tree

1 file changed

+0
-63
lines changed

1 file changed

+0
-63
lines changed

setupext.py

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -89,28 +89,6 @@ def _get_xdg_cache_dir():
8989
options['local_freetype'] = lft or options.get('local_freetype', False)
9090

9191

92-
def has_include_file(include_dirs, filename):
93-
"""
94-
Returns `True` if *filename* can be found in one of the
95-
directories in *include_dirs*.
96-
"""
97-
if sys.platform == 'win32':
98-
include_dirs = [*include_dirs, # Don't modify it in-place.
99-
*os.environ.get('INCLUDE', '.').split(os.pathsep)]
100-
return any(pathlib.Path(dir, filename).exists() for dir in include_dirs)
101-
102-
103-
def check_include_file(include_dirs, filename, package):
104-
"""
105-
Raises an exception if the given include file can not be found.
106-
"""
107-
if not has_include_file(include_dirs, filename):
108-
raise CheckFailed(
109-
"The C/C++ header for %s (%s) could not be found. You "
110-
"may need to install the development package." %
111-
(package, filename))
112-
113-
11492
def get_base_dirs():
11593
"""
11694
Returns a list of standard base directories on this platform.
@@ -411,47 +389,6 @@ def get_setup_requires(self):
411389
"""
412390
return []
413391

414-
def _check_for_pkg_config(self, package, include_file, min_version=None,
415-
version=None):
416-
"""
417-
A convenience function for writing checks for a
418-
pkg_config-defined dependency.
419-
420-
`package` is the pkg_config package name.
421-
422-
`include_file` is a top-level include file we expect to find.
423-
424-
`min_version` is the minimum version required.
425-
426-
`version` will override the found version if this package
427-
requires an alternate method for that. Set version='unknown'
428-
if the version is not known but you still want to disabled
429-
pkg_config version check.
430-
"""
431-
if version is None:
432-
version = pkg_config.get_version(package)
433-
434-
if version is None:
435-
raise CheckFailed(
436-
"pkg-config information for '%s' could not be found." %
437-
package)
438-
439-
if min_version and version != 'unknown':
440-
if not is_min_version(version, min_version):
441-
raise CheckFailed(
442-
"Requires %s %s or later. Found %s." %
443-
(package, min_version, version))
444-
445-
ext = self.get_extension()
446-
if ext is None:
447-
ext = make_extension('test', [])
448-
pkg_config.setup_extension(ext, package)
449-
450-
check_include_file(
451-
ext.include_dirs + get_include_dirs(), include_file, package)
452-
453-
return 'version %s' % version
454-
455392
def do_custom_build(self):
456393
"""
457394
If a package needs to do extra custom things, such as building a

0 commit comments

Comments
 (0)