|
34 | 34 | import setuptools.command.build_py
|
35 | 35 | import setuptools.command.sdist
|
36 | 36 |
|
| 37 | +# sys.path modified to find setupext.py during pyproject.toml builds. |
| 38 | +sys.path.append(str(Path(__file__).resolve().parent)) |
| 39 | + |
37 | 40 | import setupext
|
38 | 41 | from setupext import print_raw, print_status
|
39 | 42 |
|
@@ -68,6 +71,12 @@ def has_flag(self, flagname):
|
68 | 71 |
|
69 | 72 | class BuildExtraLibraries(setuptools.command.build_ext.build_ext):
|
70 | 73 | def finalize_options(self):
|
| 74 | + # If coverage is enabled then need to keep the .o and .gcno files in a |
| 75 | + # non-temporary directory otherwise coverage info not collected. |
| 76 | + cppflags = os.getenv('CPPFLAGS') |
| 77 | + if cppflags and '--coverage' in cppflags: |
| 78 | + self.build_temp = 'build' |
| 79 | + |
71 | 80 | self.distribution.ext_modules[:] = [
|
72 | 81 | ext
|
73 | 82 | for package in good_packages
|
@@ -208,8 +217,9 @@ def update_matplotlibrc(path):
|
208 | 217 | class BuildPy(setuptools.command.build_py.build_py):
|
209 | 218 | def run(self):
|
210 | 219 | super().run()
|
211 |
| - update_matplotlibrc( |
212 |
| - Path(self.build_lib, "matplotlib/mpl-data/matplotlibrc")) |
| 220 | + if not self.editable_mode: |
| 221 | + update_matplotlibrc( |
| 222 | + Path(self.build_lib, "matplotlib/mpl-data/matplotlibrc")) |
213 | 223 |
|
214 | 224 |
|
215 | 225 | class Sdist(setuptools.command.sdist.sdist):
|
@@ -300,11 +310,6 @@ def make_release_tree(self, base_dir, files):
|
300 | 310 | package_data=package_data,
|
301 | 311 |
|
302 | 312 | python_requires='>={}'.format('.'.join(str(n) for n in py_min_version)),
|
303 |
| - setup_requires=[ |
304 |
| - "certifi>=2020.06.20", |
305 |
| - "numpy>=1.19", |
306 |
| - "setuptools_scm>=7", |
307 |
| - ], |
308 | 313 | install_requires=[
|
309 | 314 | "contourpy>=1.0.1",
|
310 | 315 | "cycler>=0.10",
|
|
0 commit comments