Commit cfab586 1 parent 61c8db8 commit cfab586 Copy full SHA for cfab586
File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
from setuptools import setup , find_packages
3
3
4
+
5
+ def package_files (directory ):
6
+ paths = []
7
+ for (path , directories , filenames ) in os .walk (directory ):
8
+ for filename in filenames :
9
+ # Generate the path relative to the package
10
+ rel_path = os .path .relpath (os .path .join (path , filename ), directory )
11
+ # Replace the directory base in the relative path with the correct package path
12
+ package_path = os .path .join ('libreforms_fastapi/app' , rel_path )
13
+ paths .append (package_path )
14
+ return paths
15
+
16
+ # Walk the static and template directories to ensure contents included recursively
17
+ static_files = package_files ('libreforms_fastapi/app/static' )
18
+ template_files = package_files ('libreforms_fastapi/app/templates' )
19
+
20
+
4
21
def read_version ():
5
22
with open ('libreforms_fastapi/__metadata__.py' , 'r' ) as f :
6
23
lines = f .readlines ()
@@ -61,7 +78,7 @@ def read_version():
61
78
#
62
79
include_package_data = True ,
63
80
package_data = {
64
- 'libreforms_fastapi.app' : [ 'static/*' , 'templates/*.jinja' ] ,
81
+ 'libreforms_fastapi.app' : static_files + template_files ,
65
82
},
66
83
extras_require = {
67
84
"data" : install_extras_data ,
You can’t perform that action at this time.
0 commit comments