Skip to content

Commit

Permalink
BLD: Move setuptools-scm version file to pyproject
Browse files Browse the repository at this point in the history
setuptools-scm > 8.0.0 seems to take issue with version file paths
supplied in setup.py. This is a step toward a more pyproject.toml
oriented package structure as well.
  • Loading branch information
mferrera committed Sep 21, 2023
1 parent 0e2ee18 commit 1a2732a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 14 deletions.
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ requires = [
'autoclasstoc',
'myst-parser',
]

[tool.setuptools_scm]
write_to = "src/xtgeo/_theversion.py"
14 changes: 0 additions & 14 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/env python3
"""Setup for XTGeo - subsurface reservoir tool for maps, 3D grids etc."""
import os
import sys

try:
Expand Down Expand Up @@ -37,18 +36,9 @@
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"),
},
long_description=README + "\n\n" + HISTORY,
long_description_content_type="text/markdown",
author="Equinor R&T",
Expand Down Expand Up @@ -106,10 +96,6 @@ def src(anypath):
print("Run in DEVELOP mode")
setuptools_setup( # use setuptools version of setup
name="xtgeo",
use_scm_version={
"root": src(""),
"write_to": src("src/xtgeo/_theversion.py"),
},
packages=setuptools.find_packages(where="src"),
package_dir={"": "src"},
zip_safe=False,
Expand Down

0 comments on commit 1a2732a

Please sign in to comment.