From 00916ff4a2e3c18b6e2b8355dede4fd1d1752073 Mon Sep 17 00:00:00 2001 From: Luke Zoltan Kelley Date: Wed, 7 Feb 2024 12:03:23 -0800 Subject: [PATCH] BUG: readthedocs build error, 3 --- docs/source/conf.py | 8 ++++---- docs/source/index.rst | 1 - holodeck/extensions.py | 2 +- .../{_librarian.py => old_librarian_py} | 0 setup.py | 19 ++++++++++++++----- 5 files changed, 19 insertions(+), 11 deletions(-) rename holodeck/librarian/{_librarian.py => old_librarian_py} (100%) diff --git a/docs/source/conf.py b/docs/source/conf.py index fea993c9..3bd248d5 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -26,7 +26,7 @@ 'sphinx.ext.mathjax', ] -templates_path = ['_templates'] +templates_path = [] exclude_patterns = [] @@ -41,7 +41,6 @@ # Define the configuration for sphinx-apidoc apidoc_module_dir = 'source/apidoc_modules' -apidoc_output_dir = 'source' apidoc_excluded_paths = ['../holodeck/detstats.py', '../holodeck/anisotropy.py', '../holodeck/librarian/_librarian.py'] apidoc_command_options = ' '.join([ '-e', # Create separate files for each module @@ -54,11 +53,12 @@ def run_apidoc(_): from sphinx.ext.apidoc import main argv = [ - '-o', apidoc_module_dir, '-M', '-T', '-f', - '../holodeck' + '-o', apidoc_module_dir, + '../holodeck', + *apidoc_excluded_paths, ] main(argv) diff --git a/docs/source/index.rst b/docs/source/index.rst index cbc40140..8f475702 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -2,7 +2,6 @@ holodeck ======== - |version| |build| |docs| .. |version| diff --git a/holodeck/extensions.py b/holodeck/extensions.py index 5ca15212..7e480972 100644 --- a/holodeck/extensions.py +++ b/holodeck/extensions.py @@ -7,7 +7,7 @@ import holodeck.librarian import numpy as np import kalepy as kale -from holodeck.sams import cyutils as sam_cyutils +from holodeck.sams import sam_cyutils PSPACE = holo.librarian.param_spaces_classic.PS_Classic_Phenom_Uniform diff --git a/holodeck/librarian/_librarian.py b/holodeck/librarian/old_librarian_py similarity index 100% rename from holodeck/librarian/_librarian.py rename to holodeck/librarian/old_librarian_py diff --git a/setup.py b/setup.py index d66fd3ec..a43e1f4c 100644 --- a/setup.py +++ b/setup.py @@ -6,32 +6,40 @@ """ +from pathlib import Path from os.path import abspath, join from setuptools import setup, find_packages from setuptools.extension import Extension from Cython.Build import cythonize import numpy as np +SETUP_PATH = Path(__file__).absolute().resolve().parent +print(f"{SETUP_PATH=}") + # ---- Prepare Meta-Data ---- # NOTE: `short_description` gets first line of `__doc__` only (linebreaks not allowed by setuptools) short_description = __doc__.strip().split('\n')[0] -with open("README.md", "r") as handle: +fname_desc = SETUP_PATH.joinpath("README.md") +with open(fname_desc, "r") as handle: long_description = handle.read() -with open("requirements.txt", "r") as handle: +fname_reqs = SETUP_PATH.joinpath("requirements.txt") +with open(fname_reqs, "r") as handle: requirements = handle.read() -with open('holodeck/version.txt') as handle: +fname_vers = SETUP_PATH.joinpath('./holodeck/version.txt') +with open(fname_vers) as handle: version = handle.read().strip() # ---- Handle cython submodules ---- +fname_cyutils = SETUP_PATH.joinpath("holodeck", "cyutils.pyx") ext_cyutils = Extension( "holodeck.cyutils", # specify the resulting name/location of compiled extension - sources=[join('.', 'holodeck', 'cyutils.pyx')], # location of source code + sources=[str(fname_cyutils)], # location of source code # define parameters external libraries include_dirs=[ np.get_include() @@ -47,9 +55,10 @@ extra_compile_args=['-Wno-unreachable-code-fallthrough', '-Wno-unused-function'], ) +fname_sam_cyutils = SETUP_PATH.joinpath("holodeck", "sams", "sam_cyutils.pyx") ext_sam_cyutils = Extension( "holodeck.sams.sam_cyutils", # specify the resulting name/location of compiled extension - sources=[join('.', 'holodeck', 'sams', 'sam_cyutils.pyx')], # location of source code + sources=[str(fname_sam_cyutils)], # location of source code # define parameters external libraries include_dirs=[ np.get_include()