-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·74 lines (49 loc) · 1.74 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·74 lines (49 loc) · 1.74 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
65
66
67
68
69
70
71
72
73
74
import os
import shutil
from pathlib import Path
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
def _copy_etc_to_seiscomp_root():
seiscomp_root = os.environ.get("SEISCOMP_ROOT")
if not seiscomp_root:
print("SEISCOMP_ROOT is not set; skipping etc file installation")
return
source = Path(__file__).resolve().parent / "etc"
target = Path(seiscomp_root) / "etc"
if not source.is_dir():
print(f"No etc directory found at {source}; skipping")
return
target.mkdir(parents=True, exist_ok=True)
for root, _, files in os.walk(source):
relative_root = Path(root).relative_to(source)
destination_root = target / relative_root
destination_root.mkdir(parents=True, exist_ok=True)
for filename in files:
shutil.copy2(Path(root) / filename, destination_root / filename)
print(f"Installed etc files from {source} to {target}")
class InstallCommand(install):
def run(self):
super().run()
_copy_etc_to_seiscomp_root()
class DevelopCommand(develop):
def run(self):
super().run()
_copy_etc_to_seiscomp_root()
setup(
name="scoctoloc",
description="Real-time event association/location for SeisComP using PyOcto",
version="0.0.7",
url='https://github.com/jsaul/scoctoloc',
author='Joachim Saul',
author_email='saul@gfz.de',
license='AGPLv3',
keywords='SeisComP, PyOcto, real-time seismology, earthquake location, phase association',
provides=["scocto"],
install_requires=['pyocto', 'pyrocko'],
python_requires='>=3',
cmdclass={
'install': InstallCommand,
'develop': DevelopCommand,
},
)