Skip to content

Commit

Permalink
🔨 unlink extant PKG-INFO during dist.
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed May 2, 2024
1 parent 1f09610 commit 7b99c62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ configure_file(
command: [python, '-c', meson_setuptools_scm],
output: 'PKG-INFO',
)
meson.add_dist_script(pip, 'install', 'tomli>=2.0.0')
meson.add_dist_script(python, '-c', meson_dist_setuptools_scm)
vcs_tag(input: 'pyproject.toml', output: 'pyproject.orig.toml')
message('backed up pyproject.toml as pyproject.orig.toml')
foreach source : root_files
Expand Down
2 changes: 2 additions & 0 deletions ozi/scripts/meson_dist_setuptools_scm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@
pyproject_toml = toml.load(project_file)
setuptools_scm = pyproject_toml.get('tool', {}).get('setuptools_scm', {})
path = Path(dist / setuptools_scm.get('version_file')).resolve()
if path.exists():
path.unlink()
if path.parent != Path(dist).resolve():
raise RuntimeError('Invalid version_file path in pyproject.toml')
else:
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ console_scripts = [

[tool.ozi-build.metadata]
summary = 'Packager for Python projects using Meson.'
pkg-info-file = 'build/PKG-INFO'

[tool.cibuildwheel]
build-frontend = "build"
Expand Down

0 comments on commit 7b99c62

Please sign in to comment.