(self)
| 1865 | |
| 1866 | class cmd_build_ext(_build_ext): |
| 1867 | def run(self): |
| 1868 | root = get_root() |
| 1869 | cfg = get_config_from_root(root) |
| 1870 | versions = get_versions() |
| 1871 | _build_ext.run(self) |
| 1872 | if self.inplace: |
| 1873 | # build_ext --inplace will only build extensions in |
| 1874 | # build/lib<..> dir with no _version.py to write to. |
| 1875 | # As in place builds will already have a _version.py |
| 1876 | # in the module dir, we do not need to write one. |
| 1877 | return |
| 1878 | # now locate _version.py in the new build/ directory and replace |
| 1879 | # it with an updated value |
| 1880 | target_versionfile = os.path.join(self.build_lib, cfg.versionfile_build) |
| 1881 | if not os.path.exists(target_versionfile): |
| 1882 | print( |
| 1883 | f"Warning: {target_versionfile} does not exist, skipping " |
| 1884 | "version update. This can happen if you are running build_ext " |
| 1885 | "without first running build_py." |
| 1886 | ) |
| 1887 | return |
| 1888 | print("UPDATING %s" % target_versionfile) |
| 1889 | write_to_version_file(target_versionfile, versions) |
| 1890 | |
| 1891 | cmds["build_ext"] = cmd_build_ext |
| 1892 |
nothing calls this directly
no test coverage detected