diff --git a/ozi/scripts/meson_dist_setuptools_scm.py b/ozi/scripts/meson_dist_setuptools_scm.py index 53e8f75c..b82e0250 100644 --- a/ozi/scripts/meson_dist_setuptools_scm.py +++ b/ozi/scripts/meson_dist_setuptools_scm.py @@ -57,7 +57,11 @@ with (source / 'pyproject.toml').open('rb') as project_file: pyproject_toml = toml.load(project_file) setuptools_scm = pyproject_toml.get('tool', {}).get('setuptools_scm', {}) - path = Path(dist / setuptools_scm.get('version_file')).resolve() + try: + path = Path(source / setuptools_scm.get('version_file')).resolve() + except TypeError: + print('no METADATA path provided by setuptools_scm, assuming OZI.build 1.3+', file=sys.stderr) + exit(0) if path.exists(): path.unlink() if path.parent != Path(dist).resolve(): diff --git a/ozi/scripts/meson_setuptools_scm.py b/ozi/scripts/meson_setuptools_scm.py index f866c533..0c2b4c73 100644 --- a/ozi/scripts/meson_setuptools_scm.py +++ b/ozi/scripts/meson_setuptools_scm.py @@ -50,7 +50,11 @@ with (source / 'pyproject.toml').open('rb') as project_file: pyproject_toml = toml.load(project_file) setuptools_scm = pyproject_toml.get('tool', {}).get('setuptools_scm', {}) - path = Path(source / setuptools_scm.get('version_file')).resolve() + try: + path = Path(source / setuptools_scm.get('version_file')).resolve() + except TypeError: + print('no METADATA path provided by setuptools_scm, assuming OZI.build 1.3+', file=sys.stderr) + exit(0) if path.parent != Path(source).resolve(): raise RuntimeError('Invalid version_file path in pyproject.toml') else: