Skip to content

Commit

Permalink
Start to simplify setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
paugier committed Jan 24, 2024
1 parent 2cbacad commit bf53047
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ authors = [
]
dependencies = [
"fluiddyn >= 0.2.3",
"mpi4py",
"transonic >= 0.4",
]
requires-python = ">= 3.9"
Expand Down
21 changes: 1 addition & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from runpy import run_path
from pathlib import Path
import sys

Expand All @@ -14,32 +13,14 @@
)
from setup_build import FluidFFTBuildExt

# Get the long description from the relevant file
with open("README.rst") as file:
lines = file.readlines()
for i, line in enumerate(lines):
if line.endswith(":alt: Code coverage\n"):
iline_coverage = i
break
long_description = "".join(lines[iline_coverage + 2 :])

# Get the version from the relevant file
d = run_path("src/fluidfft/_version.py")
__version__ = d["__version__"]

# Set setup_requires and install_requires depending on the configuration
install_requires = ["fluiddyn >= 0.2.3", "transonic >= 0.4"]
# Set setup_requires depending on the configuration
setup_requires = []
setup_requires.extend(build_dependencies_backends[TRANSONIC_BACKEND])
if build_needs_mpi4py:
setup_requires.append("mpi4py")
install_requires.append("mpi4py")

setup(
version=__version__,
long_description=long_description,
setup_requires=setup_requires,
install_requires=install_requires,
# To trick build into running build_ext (taken from h5py)
ext_modules=[Extension("trick.x", ["trick.c"])],
cmdclass={"build_ext": FluidFFTBuildExt},
Expand Down

0 comments on commit bf53047

Please sign in to comment.