From e7471e1a6abc6a8118f1c733f90b65bfb0bbfcbb Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Fri, 1 Nov 2024 17:21:35 +0200 Subject: [PATCH] fix: python compile and install --- .gitignore | 4 ++++ {sphereproj => ext_src}/_project.pyx | 0 {sphereproj => ext_src}/copy.pxd | 0 {sphereproj => ext_src}/openmp.hpp | 0 {sphereproj => ext_src}/project_tool.hpp | 0 setup.py | 12 ++++++++---- 6 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .gitignore rename {sphereproj => ext_src}/_project.pyx (100%) rename {sphereproj => ext_src}/copy.pxd (100%) rename {sphereproj => ext_src}/openmp.hpp (100%) rename {sphereproj => ext_src}/project_tool.hpp (100%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..39eade9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build/ +dist/ +*.egg-info/ +ext_src/_project.cpp diff --git a/sphereproj/_project.pyx b/ext_src/_project.pyx similarity index 100% rename from sphereproj/_project.pyx rename to ext_src/_project.pyx diff --git a/sphereproj/copy.pxd b/ext_src/copy.pxd similarity index 100% rename from sphereproj/copy.pxd rename to ext_src/copy.pxd diff --git a/sphereproj/openmp.hpp b/ext_src/openmp.hpp similarity index 100% rename from sphereproj/openmp.hpp rename to ext_src/openmp.hpp diff --git a/sphereproj/project_tool.hpp b/ext_src/project_tool.hpp similarity index 100% rename from sphereproj/project_tool.hpp rename to ext_src/project_tool.hpp diff --git a/setup.py b/setup.py index 9b22e69..c5736d1 100644 --- a/setup.py +++ b/setup.py @@ -2,10 +2,14 @@ from setuptools import setup, Extension from Cython.Build import cythonize extensions = [ - Extension("sphereproj._project", ["sphereproj/_project.pyx", "sphereproj/project_tool.hpp", "sphereproj/openmp.hpp"]) + Extension( + "sphereproj._project", + [ + "ext_src/_project.pyx", + ], + language="c++" + ) ] -setup( - ext_modules = cythonize(extensions) -) +setup(py_modules=["sphereproj"],ext_modules=cythonize(extensions))