|
1 |
| -""" |
2 |
| -******************************************************************************** |
3 |
| -compas_skeleton |
4 |
| -******************************************************************************** |
5 |
| -
|
6 |
| -.. currentmodule:: compas_skeleton |
7 |
| -
|
8 |
| -
|
9 |
| -.. toctree:: |
10 |
| - :maxdepth: 1 |
11 |
| -
|
12 |
| - compas_skeleton.datastructure |
13 |
| - compas_skeleton.rhino |
14 |
| -
|
15 |
| -
|
16 |
| -""" |
17 |
| - |
18 |
| -from __future__ import print_function |
19 |
| - |
20 | 1 | import os
|
21 |
| -import compas |
22 | 2 |
|
23 | 3 |
|
24 | 4 | __author__ = ["Wenqian Yang"]
|
|
35 | 15 | DOCS = os.path.abspath(os.path.join(HOME, "docs"))
|
36 | 16 | TEMP = os.path.abspath(os.path.join(HOME, "temp"))
|
37 | 17 |
|
38 |
| -# Check if package is installed from git |
39 |
| -# If that's the case, try to append the current head's hash to __version__ |
40 |
| -try: |
41 |
| - git_head_file = compas._os.absjoin(HOME, '.git', 'HEAD') |
42 |
| - |
43 |
| - if os.path.exists(git_head_file): |
44 |
| - # git head file contains one line that looks like this: |
45 |
| - # ref: refs/heads/master |
46 |
| - with open(git_head_file, 'r') as git_head: |
47 |
| - _, ref_path = git_head.read().strip().split(' ') |
48 |
| - ref_path = ref_path.split('/') |
49 |
| - |
50 |
| - git_head_refs_file = compas._os.absjoin(HOME, '.git', *ref_path) |
51 |
| - |
52 |
| - if os.path.exists(git_head_refs_file): |
53 |
| - with open(git_head_refs_file, 'r') as git_head_ref: |
54 |
| - git_commit = git_head_ref.read().strip() |
55 |
| - __version__ += '-' + git_commit[:8] |
56 |
| -except Exception: |
57 |
| - pass |
58 | 18 |
|
59 | 19 | __all__ = ["HOME", "DATA", "DOCS", "TEMP"]
|
0 commit comments