|
13 | 13 | import sys
|
14 | 14 | import versioneer
|
15 | 15 |
|
16 |
| -# The path to install the task configuration files into, if any |
17 |
| -task_dst = None |
18 |
| - |
19 |
| -# Strip out a --task-conf option if given to the install command |
20 |
| -found_install = False |
21 |
| -for arg in sys.argv: |
22 |
| - if arg == "install": |
23 |
| - found_install = True |
24 |
| - elif found_install and arg.startswith("--task-conf="): |
25 |
| - task_dst = os.path.join(arg[arg.find("=") + 1 :], "tasks") |
26 |
| - sys.argv.remove(arg) |
27 |
| - break |
28 |
| - |
29 |
| -# Installing task configuration, if requested |
30 |
| -if task_dst: |
31 |
| - # Check for the source directory |
32 |
| - task_src = os.path.join(os.path.dirname(sys.argv[0]), "conf", "tasks") |
33 |
| - if not os.path.isdir(task_src): |
34 |
| - raise FileExistsError( |
35 |
| - "Task configruation directory {0} not found".format(task_src) |
36 |
| - ) |
37 |
| - |
38 |
| - # We don't allow installing the task config directory over |
39 |
| - # top of an existing directory, because that would likely |
40 |
| - # result in a mix of old and new configuration |
41 |
| - try: |
42 |
| - os.mkdir(task_dst, 0o755) |
43 |
| - except FileExistsError: |
44 |
| - # Re-raise with an explanation |
45 |
| - raise FileExistsError( |
46 |
| - "Cannot install task configraution: " "{0} already exists.".format(task_dst) |
47 |
| - ) |
48 |
| - |
49 |
| - # Now copy all the task configuration files |
50 |
| - print("Installing task configuration files to {0}".format(task_dst)) |
51 |
| - for name in os.listdir(task_src): |
52 |
| - path = os.path.join(task_src, name) |
53 |
| - if name.endswith(".conf") and os.path.isfile(path): |
54 |
| - shutil.copy(path, task_dst) |
55 |
| - |
56 |
| -# Now for the regular setuptools-y stuff |
57 | 16 | setuptools.setup(
|
58 | 17 | name="dias",
|
59 | 18 | version=versioneer.get_version(),
|
|
0 commit comments