-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
64 lines (54 loc) · 1.6 KB
/
setup.py
File metadata and controls
64 lines (54 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env python
"""
setup.py file for GWforge package
"""
from setuptools import setup, find_packages
import os
def find_files(
dirname,
relpath=None,
extensions=(".py", ".pyc"),
ignore_dirs=None,
ignore_files=None,
):
def find_paths(directory):
items = []
for root, dirs, files in os.walk(directory):
# Exclude specified directories if ignore_dirs is provided
if ignore_dirs is not None:
dirs[:] = [d for d in dirs if d not in ignore_dirs]
for fname in files:
path = os.path.join(root, fname)
# Exclude specified files and extensions if ignore_files is provided
if ignore_files is not None and (
fname in ignore_files
or any(path.endswith(ext) for ext in extensions)
):
continue
items.append(path)
return items
items = find_paths(dirname)
relpath = relpath or dirname
return [os.path.relpath(path, relpath) for path in items]
ignore_dirs = [
".git",
"__pycache__/",
"profile_default/",
".ipynb_checkpoints",
".vscode",
"venv/",
"env/",
"virtualenv/",
]
ignore_files = [".DS_Store", "*.pyc", "Thumbs.db", "*.sqlite", "*.swp", "*.env", ".env"]
setup(
scripts=find_files(
"bin/", relpath="./", ignore_dirs=ignore_dirs, ignore_files=ignore_files
),
packages=find_packages(),
include_package_data=True,
package_data={
"PyART.numerical": ["twopuncts.dummy"],
"PyART.catalogs": ["sacra.info"],
},
)