This repository was archived by the owner on Jul 2, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 3
3
import sys
4
4
import fnmatch
5
5
import shutil
6
+ from datetime import datetime
6
7
7
8
from setuptools import setup , find_packages
8
9
from distutils .command .clean import clean
12
13
from setuptools .command .test import test as TestCommand
13
14
14
15
from git import Repo
16
+ from git .exc import InvalidGitRepositoryError
15
17
16
18
here = os .path .abspath (os .path .dirname (__file__ ))
17
19
README = open (os .path .join (here , 'README.md' )).read ()
18
20
pkg_name = 'oil_library'
19
- pkg_version = '1.1.0 '
21
+ pkg_version = '1.1.1 '
20
22
21
- repo = Repo ('.' )
22
23
24
+ # try to get update date from repo
23
25
try :
24
- branch_name = repo .active_branch .name
25
- except TypeError :
26
+ repo = Repo ('.' )
27
+ try :
28
+ branch_name = repo .active_branch .name
29
+ except TypeError :
30
+ branch_name = 'no-branch'
31
+ last_update = repo .iter_commits ().next ().committed_datetime .isoformat ()
32
+ except InvalidGitRepositoryError :
33
+ # not builiding in a valid git repo
34
+ # use today's date.
35
+ print "not in a valid git repo -- using today's date as build date"
26
36
branch_name = 'no-branch'
27
-
28
- last_update = repo .iter_commits ().next ().committed_datetime .isoformat (),
37
+ last_update = datetime .now ().isoformat ()
29
38
30
39
31
40
def clean_files (del_db = False ):
You can’t perform that action at this time.
0 commit comments