Completed
Push — master ( e92800...6cb84f )
by Thomas
43:40 queued 28:30
created

setup.release_github()   B

Complexity

Conditions 8

Size

Total Lines 51
Code Lines 41

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 8
eloc 41
nop 0
dl 0
loc 51
rs 7.0293
c 0
b 0
f 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
#!/usr/bin/env python3
2
# encoding: utf-8
3
"""
4
setup.py
5
6
Created by Thomas Mangin on 2011-01-24.
7
Copyright (c) 2009-2017 Exa Networks. All rights reserved.
8
"""
9
10
import importlib
11
import platform
12
import os
13
import sys
14
import setuptools
15
from distutils.core import setup
16
17
# from setuptools.config import read_configuration
18
# conf_dict = read_configuration('./setup.cfg', find_others=True)
19
20
sys.path.append(os.path.join(os.getcwd(), os.path.dirname(sys.argv[0]), 'lib/exabgp'))
21
exabgp_version = importlib.import_module('version')
22
23
24
def filesOf(directory):
25
	files = []
26
	for l, d, fs in os.walk(directory):
27
		if not d:
28
			for f in fs:
29
				files.append(os.path.join(l, f))
30
	return files
31
32
33
data_files = [
34
	('etc/exabgp/examples', filesOf('etc/exabgp')),
35
]
36
37
if platform.system() != 'NetBSD':
38
	if sys.argv[-1] == 'systemd':
39
		data_files.append(('/usr/lib/systemd/system', filesOf('etc/systemd')))
40
41
if 'systemd' in sys.argv:
42
	if os.path.exists('/usr/lib/systemd/system'):
43
		data_files.append(('/usr/lib/systemd/system', filesOf('etc/systemd')))
44
	if os.path.exists('/lib/systemd/system'):
45
		data_files.append(('/lib/systemd/system', filesOf('etc/systemd')))
46
47
setuptools.setup(
48
	download_url='https://github.com/Exa-Networks/exabgp/archive/%s.tar.gz' % exabgp_version.version.split('-')[0],
49
	data_files=data_files,
50
)
51