FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-openflow/setup.py at master · diraol/python-openflow · GitHub
diraol
/
python-openflow
Public
forked from
kytos/python-openflow
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-openflow
/
setup.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
148 lines (114 loc) · 4.21 KB
Breadcrumbs
python-openflow
/
setup.py
Copy path
File metadata and controls
148 lines (114 loc) · 4.21 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
"""Setup script.
Run "python3 setup --help-commands" to list all available commands and their
descriptions.
"""
from
abc
import
abstractmethod
# Disabling checks due to https://github.com/PyCQA/pylint/issues/73
# pylint: disable=import-error,no-name-in-module
from
distutils
.
command
.
clean
import
clean
# pylint: enable=import-error,no-name-in-module
from
subprocess
import
CalledProcessError
,
call
,
check_call
from
setuptools
import
Command
,
find_packages
,
setup
from
pyof
import
__version__
class
SimpleCommand
(
Command
):
"""Make Command implementation simpler."""
user_options
=
[]
def
__init__
(
self
,
*
args
,
**
kwargs
):
"""Store arguments so it's possible to call other commands later."""
super
().
__init__
(
*
args
,
**
kwargs
)
self
.
__args
=
args
self
.
__kwargs
=
kwargs
@
abstractmethod
def
run
(
self
):
"""Run when command is invoked.
Use *call* instead of *check_call* to ignore failures.
"""
pass
def
run_command
(
self
,
command_class
):
"""Run another command with same __init__ arguments."""
command_class
(
*
self
.
__args
,
**
self
.
__kwargs
).
run
()
def
initialize_options
(
self
):
"""Set defa ult values for options."""
pass
def
finalize_options
(
self
):
"""Post-process options."""
pass
class
Cleaner
(
clean
):
"""Custom clean command to tidy up the project root."""
description
=
'clean build, dist, pyc and egg from package and docs'
def
run
(
self
):
"""Clean build, dist, pyc and egg from package and docs."""
super
().
run
()
call
(
'rm -vrf ./build ./dist ./*.pyc ./*.egg-info'
,
shell
=
True
)
call
(
'find . -name __pycache__ -type d | xargs rm -rf'
,
shell
=
True
)
call
(
'test -d docs && make -C docs/ clean'
,
shell
=
True
)
class
TestCoverage
(
SimpleCommand
):
"""Display test coverage."""
description
=
'run unit tests and display code coverage'
def
run
(
self
):
"""Run unittest quietly and display coverage report."""
cmd
=
'coverage3 run setup.py test && coverage3 report'
check_call
(
cmd
,
shell
=
True
)
class
DocTest
(
SimpleCommand
):
"""Run documentation tests."""
description
=
'run documentation tests'
def
run
(
self
):
"""Run doctests using Sphinx Makefile."""
cmd
=
'make -C docs/ default doctest'
check_call
(
cmd
,
shell
=
True
)
class
CITest
(
SimpleCommand
):
"""Run all CI tests."""
description
=
'run all CI tests: unit and doc tests, linter'
def
run
(
self
):
"""Run unit tests with coverage, doc tests and linter."""
for
command
in
TestCoverage
,
DocTest
,
Linter
:
self
.
run_command
(
command
)
class
Linter
(
SimpleCommand
):
"""Lint Python source code."""
description
=
'lint Python source code'
def
run
(
self
):
"""Run yala."""
print
(
'Yala is running. It may take several seconds...'
)
try
:
check_call
(
'yala pyof setup.py'
,
shell
=
True
)
print
(
'No linter error found.'
)
except
CalledProcessError
:
print
(
'Linter check failed. Fix the error(s) above and try again.'
)
exit
(
-
1
)
setup
(
name
=
'python-openflow'
,
version
=
__version__
,
description
=
'Library to parse and generate OpenFlow messages'
,
url
=
'http://github.com/kytos/python-openflow'
,
author
=
'Kytos Team'
,
author_email
=
'devel@lists.kytos.io'
,
license
=
'MIT'
,
test_suite
=
'tests'
,
include_package_data
=
True
,
extras_require
=
{
'dev'
: [
'coverage'
,
'tox'
,
'pip-tools'
,
'Sphinx~=1.5.0'
,
'sphinx-autobuild'
,
'sphinx-rtd-theme'
,
'sphinx_bootstrap_theme~=0.4.0'
,
'yala'
,
],
},
packages
=
find_packages
(
exclude
=
[
'tests'
]),
cmdclass
=
{
'ci'
:
CITest
,
'clean'
:
Cleaner
,
'coverage'
:
TestCoverage
,
'doctest'
:
DocTest
,
'lint'
:
Linter
},
zip_safe
=
False
,
classifiers
=
[
'License :: OSI Approved :: MIT License'
,
'Operating System :: POSIX :: Linux'
,
'Programming Language :: Python :: 3.6'
,
'Topic :: System :: Networking'
,
'Topic :: Software Development :: Libraries'
])
Back
|
FazBrowse Home
|
New Git URL