Skip to content

Commit

Permalink
try to change package data path
Browse files Browse the repository at this point in the history
  • Loading branch information
ygeunkim committed Sep 12, 2024
1 parent d683fd7 commit f2f796f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
3 changes: 2 additions & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ include = ["bvhar", "bvhar.*"]
bvhar = [
"**/*.cpp",
"datasets/data/*.csv",
"include/*.h"
"../inst/include/*.h"
]

[tool.setuptools_scm]
Expand All @@ -71,6 +71,7 @@ dev = [
[build-system]
requires = [
"setuptools>=42",
"wheel",
"pybind11"
]
build-backend = "setuptools.build_meta"
Expand Down
29 changes: 16 additions & 13 deletions python/setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages
from setuptools.command.build_ext import build_ext as _build_ext
import shutil
from distutils.command.sdist import sdist
# import shutil
# from distutils.command.sdist import sdist
import sys
import os
from pybind11.setup_helpers import Pybind11Extension
Expand Down Expand Up @@ -113,12 +113,12 @@ def find_module(base_dir):
)
return extensions

class SdistInclude(sdist):
def run(self):
if os.path.exists(include_path):
print(f"Copy headers from {include_path} to include")
shutil.copytree(include_path, 'include', dirs_exist_ok=True)
super().run()
# class SdistInclude(sdist):
# def run(self):
# if os.path.exists(include_path):
# print(f"Copy headers from {include_path} to include")
# shutil.copytree(include_path, 'include', dirs_exist_ok=True)
# super().run()

setup(
name='bvhar',
Expand All @@ -127,11 +127,13 @@ def run(self):
packages=find_packages(where='src'),
package_dir={'': 'src'},
package_data={
'bvhar': ['include/*.h']
# 'bvhar': ['include/*.h']
'bvhar': [os.path.join(include_path, '*.h')]
},
description='Bayesian multivariate time series modeling',
url='https://github.com/ygeunkim/bvhar/tree/feature/python',
long_description=long_description,
long_description_content_type='text/markdown',
author='Young Geun Kim',
author_email='[email protected]',
keywords=[
Expand Down Expand Up @@ -159,8 +161,9 @@ def run(self):
],
# ext_modules=find_module('bvhar'),
ext_modules=find_module('src'),
cmdclass={
'build_ext': BuildExt,
'sdist': SdistInclude
}
# cmdclass={
# 'build_ext': BuildExt,
# 'sdist': SdistInclude
# }
cmdclass={'build_ext': BuildExt}
)

0 comments on commit f2f796f

Please sign in to comment.