summaryrefslogtreecommitdiff
path: root/setuptools/config/pyprojecttoml.py
diff options
context:
space:
mode:
authorAnderson Bravalheri <andersonbravalheri@gmail.com>2023-05-03 13:18:46 +0100
committerAnderson Bravalheri <andersonbravalheri@gmail.com>2023-05-03 14:09:17 +0100
commitae8ec5c3f4cfc7f14783b4dd58c436a7ba168138 (patch)
tree092c426f4747d1451d58dc94775813ad4dbf61bf /setuptools/config/pyprojecttoml.py
parent81498f146f9eb01e04eecc53dc1147c6d21470be (diff)
downloadpython-setuptools-git-dev/core_metadata.tar.gz
Improve atomicity when writing PKG-INFOdev/core_metadata
For the time being, when `setuptools.build_meta` is called, `egg_info.egg_base` is accidentally set to the project root between the several calls to the different build hooks. This means that if the hooks are called, they will try to overwrite `setuptools.egg-info/PKG-INFO`, and for a very short interval of time it will be an empty file. Another process may then try to simultaneously use `importlib.metadata` to list entry-points. However to sort entry-points, `importlib.metadata` will try to read the `Name` field in the `PKG-INFO/METADATA` files and will raise an error/warning if that file is empty. This commit tries to use `os.replace` to avoid having an empty PKG-INFO while `importlib.metadata` is used.
Diffstat (limited to 'setuptools/config/pyprojecttoml.py')
0 files changed, 0 insertions, 0 deletions