Skip to content

Commit

Permalink
Move Python stubs to subpackage roots (#657)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Dec 12, 2024
1 parent 82b4a77 commit 312b179
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ if(BUILD_PYTHON)
_jormungandr_autodiff_stub
INSTALL_TIME
MODULE _jormungandr.autodiff
OUTPUT jormungandr/autodiff.pyi
OUTPUT jormungandr/autodiff/__init__.pyi
PYTHON_PATH $<TARGET_FILE_DIR:_jormungandr>
DEPENDS _jormungandr
COMPONENT python_modules
Expand All @@ -344,7 +344,7 @@ if(BUILD_PYTHON)
_jormungandr_optimization_stub
INSTALL_TIME
MODULE _jormungandr.optimization
OUTPUT jormungandr/optimization.pyi
OUTPUT jormungandr/optimization/__init__.pyi
PYTHON_PATH $<TARGET_FILE_DIR:_jormungandr>
DEPENDS _jormungandr
COMPONENT python_modules
Expand Down
4 changes: 3 additions & 1 deletion tools/generate_website.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ def prep_python_api_docs():
for package in ["autodiff", "optimization"]:
# Read .pyi
with open(
os.path.join("build-stubs", "install", "jormungandr", package + ".pyi")
os.path.join(
"build-stubs", "install", "jormungandr", package, "__init__.pyi"
)
) as f:
package_content = f.read()

Expand Down

0 comments on commit 312b179

Please sign in to comment.