|
8 | 8 | from distutils.dir_util import mkpath |
9 | 9 | from distutils.file_util import copy_file |
10 | 10 | from distutils.util import get_platform |
11 | | -import pkg_resources |
| 11 | +from importlib.metadata import version as get_package_version |
| 12 | +from packaging.version import parse as parse_version |
12 | 13 | import struct |
13 | 14 | import subprocess |
14 | 15 | import sys |
@@ -55,11 +56,11 @@ def bool_from_environ(key: str, default: bool = False): |
55 | 56 | else: |
56 | 57 | sys.exit("error: could not parse cython version from pyproject.toml") |
57 | 58 | try: |
58 | | - pkg_resources.require("cython >= %s" % cython_min_version) |
59 | | -except pkg_resources.ResolutionError: |
| 59 | + cython_version = parse_version(get_package_version("cython")) |
| 60 | + cython_min = parse_version(cython_min_version) |
| 61 | + with_cython = cython_version >= cython_min |
| 62 | +except Exception: |
60 | 63 | with_cython = False |
61 | | -else: |
62 | | - with_cython = True |
63 | 64 |
|
64 | 65 | inside_sdist = os.path.exists("PKG-INFO") |
65 | 66 |
|
@@ -256,13 +257,13 @@ def _copy_windows_dlls(self): |
256 | 257 |
|
257 | 258 | ext_path = self.get_ext_fullpath(ext.name) |
258 | 259 | dest_dir = os.path.dirname(ext_path) |
259 | | - mkpath(dest_dir, verbose=self.verbose, dry_run=self.dry_run) |
260 | | - copy_file( |
261 | | - dll_fullpath, |
262 | | - os.path.join(dest_dir, dll_filename), |
263 | | - verbose=self.verbose, |
264 | | - dry_run=self.dry_run, |
265 | | - ) |
| 260 | + if not self.dry_run: |
| 261 | + mkpath(dest_dir, verbose=self.verbose) |
| 262 | + copy_file( |
| 263 | + dll_fullpath, |
| 264 | + os.path.join(dest_dir, dll_filename), |
| 265 | + verbose=self.verbose, |
| 266 | + ) |
266 | 267 |
|
267 | 268 |
|
268 | 269 | def build_skia(build_base): |
@@ -406,7 +407,7 @@ def get_skia_using_pkgconfig(): |
406 | 407 | "build_ext": custom_build_ext, |
407 | 408 | }, |
408 | 409 | options={"bdist_wheel": {"py_limited_api": "cp310"}} if use_py_limited_api else {}, |
409 | | - setup_requires=["setuptools_scm"] + setuptools_git_ls_files + wheel, |
| 410 | + setup_requires=["setuptools_scm", "packaging"] + setuptools_git_ls_files + wheel, |
410 | 411 | install_requires=[], |
411 | 412 | extras_require={ |
412 | 413 | "testing": [ |
|
0 commit comments