From 6ae75869151dacdfd09f15b4d39b43c0d539441d Mon Sep 17 00:00:00 2001 From: mferrera Date: Thu, 21 Sep 2023 08:19:28 +0200 Subject: [PATCH] BLD: Use setuptools_scm `version_file` setuptools_scm 8.0.0 introduced `version_file` as a replacement for `write_to` in setup.py schemes to specify the location of the version file. --- setup.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 0a94e84d4..22d35c008 100644 --- a/setup.py +++ b/setup.py @@ -37,17 +37,11 @@ CMDCLASS = {"clean": setuputils.CleanUp} -def src(anypath): - root = os.path.dirname(__file__) - return os.path.abspath(os.path.join(root, anypath)) - - skbuild.setup( name="xtgeo", description="XTGeo is a Python library for 3D grids, surfaces, wells, etc", use_scm_version={ - "root": src(""), - "write_to": src("src/xtgeo/_theversion.py"), + "version_file": "src/xtgeo/_theversion.py", }, long_description=README + "\n\n" + HISTORY, long_description_content_type="text/markdown", @@ -107,8 +101,7 @@ def src(anypath): setuptools_setup( # use setuptools version of setup name="xtgeo", use_scm_version={ - "root": src(""), - "write_to": src("src/xtgeo/_theversion.py"), + "version_file": "src/xtgeo/_theversion.py", }, packages=setuptools.find_packages(where="src"), package_dir={"": "src"},