Update app Zuul Check Jobs.
Modify code to conform to flake8 and pylint. Jobs are now flake8, pylint, py39 and metadata. Test Plan PASS - All zuul jobs pass as expected. Story: 2010929 Task: 49284 Change-Id: I5e533c380e22a26bd0fc6f073a278c01e2a55614 Signed-off-by: Reed, Joshua <Joshua.Reed@windriver.com>
This commit is contained in:
parent
01dd5a0d25
commit
aa7b233198
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.tox
|
||||||
|
venv/
|
42
.zuul.yaml
42
.zuul.yaml
@ -8,6 +8,7 @@
|
|||||||
- k8sapp-rook-ceph-tox-py39
|
- k8sapp-rook-ceph-tox-py39
|
||||||
- k8sapp-rook-ceph-tox-flake8
|
- k8sapp-rook-ceph-tox-flake8
|
||||||
- k8sapp-rook-ceph-tox-pylint
|
- k8sapp-rook-ceph-tox-pylint
|
||||||
|
- k8sapp-rook-ceph-tox-metadata
|
||||||
- k8sapp-rook-ceph-tox-bandit
|
- k8sapp-rook-ceph-tox-bandit
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
@ -15,6 +16,7 @@
|
|||||||
- k8sapp-rook-ceph-tox-py39
|
- k8sapp-rook-ceph-tox-py39
|
||||||
- k8sapp-rook-ceph-tox-flake8
|
- k8sapp-rook-ceph-tox-flake8
|
||||||
- k8sapp-rook-ceph-tox-pylint
|
- k8sapp-rook-ceph-tox-pylint
|
||||||
|
- k8sapp-rook-ceph-tox-metadata
|
||||||
- k8sapp-rook-ceph-tox-bandit
|
- k8sapp-rook-ceph-tox-bandit
|
||||||
post:
|
post:
|
||||||
jobs:
|
jobs:
|
||||||
@ -22,7 +24,7 @@
|
|||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: k8sapp-rook-ceph-tox-py39
|
name: k8sapp-rook-ceph-tox-py39
|
||||||
parent: tox-py39
|
parent: openstack-tox-py39
|
||||||
description: |
|
description: |
|
||||||
Run py39 test for k8sapp_rook_ceph
|
Run py39 test for k8sapp_rook_ceph
|
||||||
nodeset: debian-bullseye
|
nodeset: debian-bullseye
|
||||||
@ -31,13 +33,14 @@
|
|||||||
- starlingx/fault
|
- starlingx/fault
|
||||||
- starlingx/update
|
- starlingx/update
|
||||||
- starlingx/utilities
|
- starlingx/utilities
|
||||||
|
- starlingx/root
|
||||||
files:
|
files:
|
||||||
- python3-k8sapp-rook/*
|
- python3-k8sapp-rook/*
|
||||||
vars:
|
vars:
|
||||||
python_version: 3.9
|
python_version: 3.9
|
||||||
tox_envlist: py39
|
tox_envlist: py39
|
||||||
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
||||||
|
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: k8sapp-rook-ceph-tox-flake8
|
name: k8sapp-rook-ceph-tox-flake8
|
||||||
@ -45,11 +48,18 @@
|
|||||||
description: |
|
description: |
|
||||||
Run flake8 test for k8sapp_rook_ceph
|
Run flake8 test for k8sapp_rook_ceph
|
||||||
nodeset: debian-bullseye
|
nodeset: debian-bullseye
|
||||||
|
required-projects:
|
||||||
|
- starlingx/config
|
||||||
|
- starlingx/fault
|
||||||
|
- starlingx/update
|
||||||
|
- starlingx/utilities
|
||||||
|
- starlingx/root
|
||||||
files:
|
files:
|
||||||
- python3-k8sapp-rook/*
|
- python3-k8sapp-rook/*
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: flake8
|
tox_envlist: flake8
|
||||||
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
||||||
|
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: k8sapp-rook-ceph-tox-pylint
|
name: k8sapp-rook-ceph-tox-pylint
|
||||||
@ -62,11 +72,32 @@
|
|||||||
- starlingx/fault
|
- starlingx/fault
|
||||||
- starlingx/update
|
- starlingx/update
|
||||||
- starlingx/utilities
|
- starlingx/utilities
|
||||||
|
- starlingx/root
|
||||||
files:
|
files:
|
||||||
- python3-k8sapp-rook/*
|
- python3-k8sapp-rook/*
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: pylint
|
tox_envlist: pylint
|
||||||
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
||||||
|
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
|
||||||
|
|
||||||
|
- job:
|
||||||
|
name: k8sapp-rook-ceph-tox-metadata
|
||||||
|
parent: tox
|
||||||
|
description: |
|
||||||
|
Run metadata test for k8sapp_rook_ceph
|
||||||
|
nodeset: debian-bullseye
|
||||||
|
required-projects:
|
||||||
|
- starlingx/config
|
||||||
|
- starlingx/fault
|
||||||
|
- starlingx/update
|
||||||
|
- starlingx/utilities
|
||||||
|
- starlingx/root
|
||||||
|
files:
|
||||||
|
- python3-k8sapp-rook/*
|
||||||
|
vars:
|
||||||
|
tox_envlist: metadata
|
||||||
|
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
||||||
|
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: k8sapp-rook-ceph-tox-bandit
|
name: k8sapp-rook-ceph-tox-bandit
|
||||||
@ -74,11 +105,18 @@
|
|||||||
description: |
|
description: |
|
||||||
Run bandit test for k8sapp_rook_ceph
|
Run bandit test for k8sapp_rook_ceph
|
||||||
nodeset: debian-bullseye
|
nodeset: debian-bullseye
|
||||||
|
required-projects:
|
||||||
|
- starlingx/config
|
||||||
|
- starlingx/fault
|
||||||
|
- starlingx/update
|
||||||
|
- starlingx/utilities
|
||||||
|
- starlingx/root
|
||||||
files:
|
files:
|
||||||
- python3-k8sapp-rook/*
|
- python3-k8sapp-rook/*
|
||||||
vars:
|
vars:
|
||||||
tox_envlist: bandit
|
tox_envlist: bandit
|
||||||
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
tox_extra_args: -c python3-k8sapp-rook/k8sapp_rook/tox.ini
|
||||||
|
tox_constraints_file: '{{ ansible_user_dir }}/src/opendev.org/starlingx/root/build-tools/requirements/debian/upper-constraints.txt'
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: stx-rook-ceph-apps-upload-git-mirror
|
name: stx-rook-ceph-apps-upload-git-mirror
|
||||||
|
@ -31,118 +31,135 @@ extension-pkg-whitelist=lxml.etree,greenlet
|
|||||||
|
|
||||||
|
|
||||||
[MESSAGES CONTROL]
|
[MESSAGES CONTROL]
|
||||||
# Enable the message, report, category or checker with the given id(s). You can
|
|
||||||
# either give multiple identifier separated by comma (,) or put this option
|
|
||||||
# multiple time.
|
|
||||||
#
|
|
||||||
# Python3 checker:
|
|
||||||
#
|
|
||||||
# E1601: print-statement
|
|
||||||
# E1602: parameter-unpacking
|
|
||||||
# E1603: unpacking-in-except
|
|
||||||
# E1604: old-raise-syntax
|
|
||||||
# E1605: backtick
|
|
||||||
# E1606: long-suffix
|
|
||||||
# E1607: old-ne-operator
|
|
||||||
# E1608: old-octal-literal
|
|
||||||
# E1609: import-star-module-level
|
|
||||||
# E1610: non-ascii-bytes-literal
|
|
||||||
# E1611: invalid-unicode-literal
|
|
||||||
# W1601: apply-builtin
|
|
||||||
# W1602: basestring-builtin
|
|
||||||
# W1603: buffer-builtin
|
|
||||||
# W1604: cmp-builtin
|
|
||||||
# W1605: coerce-builtin
|
|
||||||
# W1606: execfile-builtin
|
|
||||||
# W1607: file-builtin
|
|
||||||
# W1608: long-builtin
|
|
||||||
# W1609: raw_input-builtin
|
|
||||||
# W1610: reduce-builtin
|
|
||||||
# W1611: standarderror-builtin
|
|
||||||
# W1612: unicode-builtin
|
|
||||||
# W1613: xrange-builtin
|
|
||||||
# W1614: coerce-method
|
|
||||||
# W1615: delslice-method
|
|
||||||
# W1616: getslice-method
|
|
||||||
# W1617: setslice-method
|
|
||||||
# W1618: no-absolute-import
|
|
||||||
# W1619: old-division
|
|
||||||
# W1620: dict-iter-method
|
|
||||||
# W1621: dict-view-method
|
|
||||||
# W1622: next-method-called
|
|
||||||
# W1623: metaclass-assignment
|
|
||||||
# W1624: indexing-exception
|
|
||||||
# W1625: raising-string
|
|
||||||
# W1626: reload-builtin
|
|
||||||
# W1627: oct-method
|
|
||||||
# W1628: hex-method
|
|
||||||
# W1629: nonzero-method
|
|
||||||
# W1630: cmp-method
|
|
||||||
# W1632: input-builtin
|
|
||||||
# W1633: round-builtin
|
|
||||||
# W1634: intern-builtin
|
|
||||||
# W1635: unichr-builtin
|
|
||||||
# W1636: map-builtin-not-iterating
|
|
||||||
# W1637: zip-builtin-not-iterating
|
|
||||||
# W1638: range-builtin-not-iterating
|
|
||||||
# W1639: filter-builtin-not-iterating
|
|
||||||
# W1640: using-cmp-argument
|
|
||||||
# W1641: eq-without-hash
|
|
||||||
# W1642: div-method
|
|
||||||
# W1643: idiv-method
|
|
||||||
# W1644: rdiv-method
|
|
||||||
# W1645: exception-message-attribute
|
|
||||||
# W1646: invalid-str-codec
|
|
||||||
# W1647: sys-max-int
|
|
||||||
# W1648: bad-python3-import
|
|
||||||
# W1649: deprecated-string-function
|
|
||||||
# W1650: deprecated-str-translate-call
|
|
||||||
# W1651: deprecated-itertools-function
|
|
||||||
# W1652: deprecated-types-field
|
|
||||||
# W1653: next-method-defined
|
|
||||||
# W1654: dict-items-not-iterating
|
|
||||||
# W1655: dict-keys-not-iterating
|
|
||||||
# W1656: dict-values-not-iterating
|
|
||||||
# W1657: deprecated-operator-function
|
|
||||||
# W1658: deprecated-urllib-function
|
|
||||||
# W1659: xreadlines-attribute
|
|
||||||
# W1660: deprecated-sys-function
|
|
||||||
# W1661: exception-escape
|
|
||||||
# W1662: comprehension-escape
|
|
||||||
enable=E1603,E1609,E1610,E1602,E1606,E1608,E1607,E1605,E1604,E1601,E1611,W1652,
|
|
||||||
W1651,W1649,W1657,W1660,W1658,W1659,W1623,W1622,W1620,W1621,W1645,W1641,
|
|
||||||
W1624,W1648,W1625,W1611,W1662,W1661,W1650,W1640,W1630,W1614,W1615,W1642,
|
|
||||||
W1616,W1628,W1643,W1629,W1627,W1644,W1617,W1601,W1602,W1603,W1604,W1605,
|
|
||||||
W1654,W1655,W1656,W1619,W1606,W1607,W1639,W1618,W1632,W1634,W1608,W1636,
|
|
||||||
W1653,W1646,W1638,W1609,W1610,W1626,W1633,W1647,W1635,W1612,W1613,W1637
|
|
||||||
|
|
||||||
# Disable the message, report, category or checker with the given id(s). You
|
# Disable the message, report, category or checker with the given id(s). You
|
||||||
# can either give multiple identifier separated by comma (,) or put this option
|
# can either give multiple identifier separated by comma (,) or put this option
|
||||||
# multiple time (only on the command line, not in the configuration file where
|
# multiple time (only on the command line, not in the configuration file where
|
||||||
# it should appear only once).
|
# it should appear only once).
|
||||||
# See "Messages Control" section of
|
# See "Messages Control" section of
|
||||||
# https://pylint.readthedocs.io/en/latest/user_guide
|
# https://pylint.readthedocs.io/en/latest/user_guide
|
||||||
# We are disabling (C)onvention
|
disable=
|
||||||
# We are disabling (R)efactor
|
# C codes refer to Convention
|
||||||
# We are selectively disabling (W)arning
|
C0103, # invalid-name
|
||||||
# We are not disabling (F)atal, (E)rror
|
C0104, # disallowed-nameA
|
||||||
# W0212: protected-access
|
C0112, # empty-docstring
|
||||||
# W0613: unused-argument
|
C0114, # missing-module-docstring
|
||||||
# W1618: no-absolute-import
|
C0115, # missing-class-docstring
|
||||||
disable=C, R, W0613, W0212, W1618
|
C0116, # missing-function-docstring
|
||||||
|
C0123, # unidiomatic-typecheck !!!
|
||||||
|
C0201, # consider-iterating-dictionary
|
||||||
|
C0202, # bad-classmethod-argument
|
||||||
|
C0206, # consider-using-dict-items
|
||||||
|
C0207, # use-maxsplit-arg
|
||||||
|
C0209, # consider-using-f-string
|
||||||
|
C0301, # line-too-long
|
||||||
|
C0302, # too-many-lines
|
||||||
|
C0325, # superfluous-parens
|
||||||
|
C0411, # wrong-import-order
|
||||||
|
C0412, # ungrouped-imports
|
||||||
|
C0413, # wrong-import-position
|
||||||
|
C0414, # useless-import-alias !!!
|
||||||
|
C0415, # import-outside-toplevel
|
||||||
|
C1802, # use-implicit-booleaness-not-len !!!
|
||||||
|
C2801, # unnecessary-dunder-call !!!
|
||||||
|
C3002, # unnecessary-direct-lambda-call !!!
|
||||||
|
# R codes refer to refactoring
|
||||||
|
R0022, # useless-option-value !!!
|
||||||
|
R0205, # useless-object-inheritance
|
||||||
|
R0402, # consider-using-from-import
|
||||||
|
R0901, # too-many-ancestors
|
||||||
|
R0902, # too-many-instance-attributes
|
||||||
|
R0903, # too-few-public-methods
|
||||||
|
R0904, # too-many-public-methods
|
||||||
|
R0911, # too-many-return-statements
|
||||||
|
R0912, # too-many-branches
|
||||||
|
R0913, # too-many-arguments
|
||||||
|
R0914, # too-many-locals
|
||||||
|
R0915, # too-many-statements
|
||||||
|
R0916, # too-many-boolean-expressions
|
||||||
|
R1702, # too-many-nested-blocks
|
||||||
|
R1703, # simplifiable-if-statement
|
||||||
|
R1704, # redefined-argument-from-local !!!
|
||||||
|
R1705, # no-else-return
|
||||||
|
R1707, # trailing-comma-tuple !!!
|
||||||
|
R1708, # stop-iteration-return !!!
|
||||||
|
R1710, # inconsistent-return-statements
|
||||||
|
R1711, # useless-return
|
||||||
|
R1714, # consider-using-in
|
||||||
|
R1717, # consider-using-dict-comprehension !!!
|
||||||
|
R1718, # consider-using-set-comprehension
|
||||||
|
R1719, # simplifiable-if-expression
|
||||||
|
R1720, # no-else-raise
|
||||||
|
R1721, # unnecessary-comprehension
|
||||||
|
R1722, # consider-using-sys-exit !!!
|
||||||
|
R1723, # no-else-break
|
||||||
|
R1724, # no-else-continue
|
||||||
|
R1725, # super-with-arguments
|
||||||
|
R1726, # simplifiable-condition !!!
|
||||||
|
R1728, # consider-using-generator
|
||||||
|
R1729, # use-a-generator
|
||||||
|
R1730, # consider-using-min-builtin !!!
|
||||||
|
R1731, # consider-using-max-builtin !!!
|
||||||
|
R1732, # consider-using-with
|
||||||
|
R1733, # unnecessary-dict-index-lookup !!
|
||||||
|
R1734, # use-list-literal
|
||||||
|
R1735, # use-dict-literal
|
||||||
|
# W codes are warnings
|
||||||
|
W0101, # unreachable
|
||||||
|
W0105, # pointless-string-statement
|
||||||
|
W0106, # expression-not-assigned
|
||||||
|
W0107, # unnecessary-pass
|
||||||
|
W0108, # unnecessary-lambda
|
||||||
|
W0109, # duplicate-key !!!
|
||||||
|
W0123, # eval-used
|
||||||
|
W0125, # using-constant-test !!!
|
||||||
|
W0133, # pointless-exception-statement !!!
|
||||||
|
W0143, # comparison-with-callable !!!
|
||||||
|
W0150, # lost-exception
|
||||||
|
W0201, # attribute-defined-outside-init
|
||||||
|
W0211, # bad-staticmethod-argument
|
||||||
|
W0212, # protected-access
|
||||||
|
W0221, # arguments-differ
|
||||||
|
W0223, # abstract-method
|
||||||
|
W0231, # super-init-not-called
|
||||||
|
W0235, # useless-super-delegation
|
||||||
|
W0237, # arguments-renamed !!!
|
||||||
|
W0311, # bad-indentation
|
||||||
|
W0402, # deprecated-module
|
||||||
|
W0404, # reimported
|
||||||
|
W0511, # fixme
|
||||||
|
W0602, # global-variable-not-assigned !!!
|
||||||
|
W0603, # global-statement
|
||||||
|
W0612, # unused-variable
|
||||||
|
W0613, # unused-argument
|
||||||
|
W0621, # redefined-outer-name
|
||||||
|
W0622, # redefined-builtin
|
||||||
|
W0631, # undefined-loop-variable
|
||||||
|
W0703, # broad-except (pylint 2.16 renamed to broad-except-caught)
|
||||||
|
W0706, # try-except-raise
|
||||||
|
W0707, # raise-missing-from
|
||||||
|
W0719, # broad-exception-raised
|
||||||
|
W1113, # keyword-arg-before-vararg
|
||||||
|
W1310, # format-string-without-interpolation !!!
|
||||||
|
W1401, # anomalous-backslash-in-string
|
||||||
|
W1406, # redundant-u-string-prefix
|
||||||
|
W1505, # deprecated-method
|
||||||
|
W1514, # unspecified-encoding
|
||||||
|
W3101, # missing-timeout
|
||||||
|
E0601, # used-before-assignment !!!
|
||||||
|
E0605, # invalid-all-format !!!
|
||||||
|
E1101, # no-member
|
||||||
|
E1111, # assignment-from-no-return
|
||||||
|
E1121, # too-many-function-args !!!
|
||||||
|
E1123, # unexpected-keyword-arg !!!
|
||||||
|
E1136, # unsubscriptable-object !!!
|
||||||
|
|
||||||
[REPORTS]
|
[REPORTS]
|
||||||
# Set the output format. Available formats are text, parseable, colorized, msvs
|
# Set the output format. Available formats are text, parseable, colorized, msvs
|
||||||
# (visual studio) and html
|
# (visual studio) and html
|
||||||
output-format=text
|
output-format=text
|
||||||
|
|
||||||
# Put messages in a separate file for each module / package specified on the
|
|
||||||
# command line instead of printing them on stdout. Reports (if any) will be
|
|
||||||
# written in a file name "pylint_global.[txt|html]".
|
|
||||||
files-output=no
|
|
||||||
|
|
||||||
# Tells whether to display a full report or only the messages
|
# Tells whether to display a full report or only the messages
|
||||||
reports=yes
|
reports=no
|
||||||
|
|
||||||
# Python expression which should return a note less than 10 (10 is the highest
|
# Python expression which should return a note less than 10 (10 is the highest
|
||||||
# note). You have access to the variables errors warning, statement which
|
# note). You have access to the variables errors warning, statement which
|
||||||
@ -165,7 +182,7 @@ ignore-docstrings=yes
|
|||||||
|
|
||||||
[FORMAT]
|
[FORMAT]
|
||||||
# Maximum number of characters on a single line.
|
# Maximum number of characters on a single line.
|
||||||
max-line-length=80
|
max-line-length=85
|
||||||
|
|
||||||
# Maximum number of lines in a module
|
# Maximum number of lines in a module
|
||||||
max-module-lines=1000
|
max-module-lines=1000
|
||||||
@ -199,9 +216,6 @@ generated-members=REQUEST,acl_users,aq_parent
|
|||||||
|
|
||||||
|
|
||||||
[BASIC]
|
[BASIC]
|
||||||
# List of builtins function names that should not be used, separated by a comma
|
|
||||||
bad-functions=map,filter,apply,input
|
|
||||||
|
|
||||||
# Regular expression which should only match correct module names
|
# Regular expression which should only match correct module names
|
||||||
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
|
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
|
||||||
|
|
||||||
@ -291,7 +305,7 @@ max-locals=15
|
|||||||
max-returns=6
|
max-returns=6
|
||||||
|
|
||||||
# Maximum number of branch for function / method body
|
# Maximum number of branch for function / method body
|
||||||
max-branchs=12
|
max-branches=12
|
||||||
|
|
||||||
# Maximum number of statements in function / method body
|
# Maximum number of statements in function / method body
|
||||||
max-statements=50
|
max-statements=50
|
||||||
@ -318,6 +332,5 @@ valid-classmethod-first-arg=cls
|
|||||||
|
|
||||||
|
|
||||||
[EXCEPTIONS]
|
[EXCEPTIONS]
|
||||||
# Exceptions that will emit a warning when being caught. Defaults to
|
# Exceptions that will emit a warning when caught.
|
||||||
# "Exception"
|
overgeneral-exceptions=builtins.BaseException,builtins.Exception
|
||||||
overgeneral-exceptions=Exception
|
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
pbr>=0.5
|
pbr>=2.0.0
|
||||||
PyYAML>=3.10
|
PyYAML>=3.10.0
|
||||||
pycryptodome
|
pycryptodome
|
||||||
|
@ -2,13 +2,11 @@
|
|||||||
# of appearance. Changing the order has an impact on the overall integration
|
# of appearance. Changing the order has an impact on the overall integration
|
||||||
# process, which may cause wedges in the gate later.
|
# process, which may cause wedges in the gate later.
|
||||||
hacking>=1.1.0,<=2.0.0 # Apache-2.0
|
hacking>=1.1.0,<=2.0.0 # Apache-2.0
|
||||||
bandit;python_version>="3.0"
|
astroid
|
||||||
|
bandit<1.7.2;python_version>="3.0"
|
||||||
coverage>=3.6
|
coverage>=3.6
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
mock>=2.0.0 # BSD
|
mock>=2.0.0 # BSD
|
||||||
passlib>=1.7.0
|
|
||||||
psycopg2-binary
|
|
||||||
python-barbicanclient
|
|
||||||
python-subunit>=0.0.18
|
python-subunit>=0.0.18
|
||||||
requests-mock>=0.6.0 # Apache-2.0
|
requests-mock>=0.6.0 # Apache-2.0
|
||||||
sphinx
|
sphinx
|
||||||
@ -18,10 +16,5 @@ stestr>=1.0.0 # Apache-2.0
|
|||||||
testrepository>=0.0.18
|
testrepository>=0.0.18
|
||||||
testtools!=1.2.0,>=0.9.36
|
testtools!=1.2.0,>=0.9.36
|
||||||
isort<5;python_version>="3.0"
|
isort<5;python_version>="3.0"
|
||||||
pylint<2.1.0;python_version<"3.0" # GPLv2
|
pylint
|
||||||
pylint<2.4.0;python_version>="3.0" # GPLv2
|
pycryptodomex
|
||||||
pytest
|
|
||||||
pyudev
|
|
||||||
migrate
|
|
||||||
python-ldap>=3.1.0
|
|
||||||
markupsafe
|
|
||||||
|
@ -1,25 +1,24 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = flake8,py39,pylint,bandit
|
envlist = flake8,py39,pylint,metadata,bandit
|
||||||
minversion = 2.3
|
minversion = 1.6
|
||||||
# skipsdist = True
|
skipsdist = True
|
||||||
#,pip-missing-reqs
|
|
||||||
|
|
||||||
# tox does not work if the path to the workdir is too long, so move it to /tmp
|
# tox does not work if the path to the workdir is too long, so move it to /tmp
|
||||||
|
# tox 3.1.0 adds TOX_LIMITED_SHEBANG
|
||||||
toxworkdir = /tmp/{env:USER}_k8srooktox
|
toxworkdir = /tmp/{env:USER}_k8srooktox
|
||||||
stxdir = {toxinidir}/../../..
|
stxdir = {toxinidir}/../../..
|
||||||
distshare={toxworkdir}/.tox/distshare
|
distshare={toxworkdir}/.tox/distshare
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
basepython = python3.9
|
||||||
usedevelop = True
|
usedevelop = True
|
||||||
basepython = python3
|
|
||||||
sitepackages = False
|
|
||||||
|
|
||||||
# tox is silly... these need to be separated by a newline....
|
# tox is silly... these need to be separated by a newline....
|
||||||
allowlist_externals = bash
|
allowlist_externals = bash
|
||||||
find
|
find
|
||||||
|
echo
|
||||||
|
|
||||||
install_command = pip install \
|
install_command = pip install -v -v -v \
|
||||||
-v -v -v \
|
|
||||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
||||||
{opts} {packages}
|
{opts} {packages}
|
||||||
|
|
||||||
@ -27,11 +26,13 @@ install_command = pip install \
|
|||||||
# random hash seed successfully.
|
# random hash seed successfully.
|
||||||
setenv = VIRTUAL_ENV={envdir}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
PYTHONHASHSEED=0
|
PYTHONHASHSEED=0
|
||||||
|
PIP_RESOLVER_DEBUG=1
|
||||||
PYTHONDONTWRITEBYTECODE=1
|
PYTHONDONTWRITEBYTECODE=1
|
||||||
OS_TEST_PATH=./k8sapp_rook/tests
|
OS_TEST_PATH=./k8sapp_rook/tests
|
||||||
LANG=en_US.UTF-8
|
LANG=en_US.UTF-8
|
||||||
LANGUAGE=en_US:en
|
LANGUAGE=en_US:en
|
||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
|
EVENTS_YAML=./k8sapp_rook/tests/events_for_testing.yaml
|
||||||
SYSINV_TEST_ENV=True
|
SYSINV_TEST_ENV=True
|
||||||
TOX_WORK_DIR={toxworkdir}
|
TOX_WORK_DIR={toxworkdir}
|
||||||
PYLINTHOME={toxworkdir}
|
PYLINTHOME={toxworkdir}
|
||||||
@ -42,41 +43,104 @@ deps = -r{toxinidir}/requirements.txt
|
|||||||
-e{[tox]stxdir}/config/tsconfig/tsconfig
|
-e{[tox]stxdir}/config/tsconfig/tsconfig
|
||||||
-e{[tox]stxdir}/fault/fm-api/source
|
-e{[tox]stxdir}/fault/fm-api/source
|
||||||
-e{[tox]stxdir}/fault/python-fmclient/fmclient
|
-e{[tox]stxdir}/fault/python-fmclient/fmclient
|
||||||
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
|
|
||||||
-e{[tox]stxdir}/update/sw-patch/cgcs-patch
|
-e{[tox]stxdir}/update/sw-patch/cgcs-patch
|
||||||
|
-e{[tox]stxdir}/utilities/ceph/python-cephclient/python-cephclient
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
find . -type f -name "*.pyc" -delete
|
find . -type f -name "*.pyc" -delete
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
|
# H series are hacking
|
||||||
|
# H101 is TODO
|
||||||
|
# H102 is apache license
|
||||||
|
# H104 file contains only comments (ie: license)
|
||||||
|
# H105 author tags
|
||||||
|
# H306 imports not in alphabetical order
|
||||||
|
# H401 docstring should not start with a space
|
||||||
|
# H403 multi line docstrings should end on a new line
|
||||||
|
# H404 multi line docstring should start without a leading new line
|
||||||
|
# H405 multi line docstring summary not separated with an empty line
|
||||||
|
# H701 Empty localization string
|
||||||
|
# H702 Formatting operation should be outside of localization method call
|
||||||
|
# H703 Multiple positional placeholders
|
||||||
|
|
||||||
|
# B series are bugbear
|
||||||
|
# B006 Do not use mutable data structures for argument defaults. Needs to be FIXED.
|
||||||
|
# B007 Loop control variable not used within the loop body.
|
||||||
|
# B009 Do not call getattr with a constant attribute value
|
||||||
|
# B010 Do not call setattr with a constant attribute value
|
||||||
|
# B012 return/continue/break inside finally blocks cause exceptions to be silenced
|
||||||
|
# B014 Redundant exception types
|
||||||
|
# B301 Python 3 does not include `.iter*` methods on dictionaries. (this should be suppressed on a per line basis)
|
||||||
|
|
||||||
|
# W series are warnings
|
||||||
|
# W503 line break before binary operator
|
||||||
|
# W504 line break after binary operator
|
||||||
|
# W605 invalid escape sequence
|
||||||
|
|
||||||
|
# E series are pep8
|
||||||
|
# E117 over-indented
|
||||||
|
# E126 continuation line over-indented for hanging indent
|
||||||
|
# E127 continuation line over-indented for visual indent
|
||||||
|
# E128 continuation line under-indented for visual indent
|
||||||
|
# E402 module level import not at top of file
|
||||||
|
# E741 ambiguous variable name
|
||||||
|
|
||||||
|
ignore = H101,H102,H104,H105,H306,H401,H403,H404,H405,H701,H702,H703,
|
||||||
|
B006,B007,B009,B010,B012,B014,B301
|
||||||
|
W503,W504,W605,
|
||||||
|
E117,E126,E127,E128,E402,E741
|
||||||
exclude = build,dist,tools,.eggs
|
exclude = build,dist,tools,.eggs
|
||||||
max-line-length=120
|
max-line-length=120
|
||||||
|
|
||||||
# H series are hacking
|
|
||||||
# H104 file contains only comments (ie: license)
|
|
||||||
# H401 docstring should not start with a space
|
|
||||||
ignore = H104,H401
|
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
deps = -r{toxinidir}/test-requirements.txt
|
deps = -r{toxinidir}/test-requirements.txt
|
||||||
commands =
|
commands =
|
||||||
flake8 {posargs} .
|
flake8 {posargs} ./k8sapp_rook
|
||||||
|
|
||||||
[testenv:py39]
|
[testenv:py39]
|
||||||
basepython = python3.9
|
|
||||||
commands =
|
commands =
|
||||||
{[testenv]commands}
|
|
||||||
stestr run {posargs}
|
stestr run {posargs}
|
||||||
stestr slowest
|
stestr slowest
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
deps = {[testenv:flake8]deps}
|
# testenv:flake8 clone
|
||||||
|
deps = -r{toxinidir}/test-requirements.txt
|
||||||
commands = {[testenv:flake8]commands}
|
commands = {[testenv:flake8]commands}
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
||||||
[bandit]
|
[bandit]
|
||||||
|
# The following bandit tests are being skipped:
|
||||||
|
# B101: Test for use of assert
|
||||||
|
# B103: Test for setting permissive file permissions
|
||||||
|
# B104: Test for binding to all interfaces
|
||||||
|
# B105: Test for use of hard-coded password strings
|
||||||
|
# B108: Test for insecure usage of tmp file/directory
|
||||||
|
# B110: Try, Except, Pass detected.
|
||||||
|
# B303: Use of insecure MD2, MD4, MD5, or SHA1 hash function.
|
||||||
|
# B307: Blacklisted call to eval.
|
||||||
|
# B310: Audit url open for permitted schemes
|
||||||
|
# B311: Standard pseudo-random generators are not suitable for security/cryptographic purposes
|
||||||
|
# B314: Blacklisted calls to xml.etree.ElementTree
|
||||||
|
# B318: Blacklisted calls to xml.dom.minidom
|
||||||
|
# B320: Blacklisted calls to lxml.etree
|
||||||
|
# B404: Import of subprocess module
|
||||||
|
# B405: import xml.etree
|
||||||
|
# B408: import xml.minidom
|
||||||
|
# B410: import lxml
|
||||||
|
# B506: Test for use of yaml load
|
||||||
|
# B602: Test for use of popen with shell equals true
|
||||||
|
# B603: Test for use of subprocess without shell equals true
|
||||||
|
# B604: Test for any function with shell equals true
|
||||||
|
# B605: Test for starting a process with a shell
|
||||||
|
# B607: Test for starting a process with a partial path
|
||||||
|
# B608: Possible SQL injection vector through string-based query
|
||||||
|
#
|
||||||
|
# Note: 'skips' entry cannot be split across multiple lines
|
||||||
|
#
|
||||||
|
skips = B101,B103,B104,B105,B108,B110,B303,B307,B310,B311,B314,B318,B320,B404,B405,B408,B410,B506,B602,B603,B604,B605,B607,B608
|
||||||
exclude = tests
|
exclude = tests
|
||||||
|
|
||||||
[testenv:bandit]
|
[testenv:bandit]
|
||||||
@ -84,11 +148,16 @@ deps = -r{toxinidir}/test-requirements.txt
|
|||||||
commands = bandit --ini tox.ini -n 5 -r k8sapp_rook
|
commands = bandit --ini tox.ini -n 5 -r k8sapp_rook
|
||||||
|
|
||||||
[testenv:pylint]
|
[testenv:pylint]
|
||||||
|
install_command = pip install -v -v -v \
|
||||||
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
||||||
|
{opts} {packages}
|
||||||
commands =
|
commands =
|
||||||
pylint {posargs} k8sapp_rook --rcfile=./pylint.rc
|
pylint {posargs} k8sapp_rook --rcfile=./pylint.rc
|
||||||
|
|
||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
basepython = python3.9
|
# not sure is passenv is still needed
|
||||||
|
passenv = CURL_CA_BUNDLE
|
||||||
|
deps = {[testenv]deps}
|
||||||
setenv = {[testenv]setenv}
|
setenv = {[testenv]setenv}
|
||||||
PYTHON=coverage run --parallel-mode
|
PYTHON=coverage run --parallel-mode
|
||||||
|
|
||||||
@ -109,3 +178,11 @@ commands =
|
|||||||
deps = pip_missing_reqs
|
deps = pip_missing_reqs
|
||||||
-rrequirements.txt
|
-rrequirements.txt
|
||||||
commands=pip-missing-reqs -d --ignore-file=/k8sapp_rook/tests k8sapp_rook
|
commands=pip-missing-reqs -d --ignore-file=/k8sapp_rook/tests k8sapp_rook
|
||||||
|
|
||||||
|
[testenv:metadata]
|
||||||
|
install_command = pip install -v -v -v \
|
||||||
|
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt} \
|
||||||
|
{opts} {packages}
|
||||||
|
# Pass top level app folder to 'sysinv-app tox' command.
|
||||||
|
commands =
|
||||||
|
bash -c "echo $(dirname $(dirname $(pwd))) | xargs -n 1 sysinv-app tox"
|
@ -50,9 +50,9 @@ override_dh_auto_build:
|
|||||||
cp helm-charts/*.tgz $(STAGING_FLUXCD)/charts
|
cp helm-charts/*.tgz $(STAGING_FLUXCD)/charts
|
||||||
|
|
||||||
# Populate metadata
|
# Populate metadata
|
||||||
sed -i 's/@APP_NAME@/$(APP_NAME)/g' $(STAGING_FLUXCD)/metadata.yaml
|
sed -i 's/APP_REPLACE_NAME/$(APP_NAME)/g' $(STAGING_FLUXCD)/metadata.yaml
|
||||||
sed -i 's/@APP_VERSION@/$(APP_VERSION)/g' $(STAGING_FLUXCD)/metadata.yaml
|
sed -i 's/APP_REPLACE_VERSION/$(APP_VERSION)/g' $(STAGING_FLUXCD)/metadata.yaml
|
||||||
sed -i 's/@HELM_REPO@/$(HELM_REPO)/g' $(STAGING_FLUXCD)/metadata.yaml
|
sed -i 's/HELM_REPLACE_REPO/$(HELM_REPO)/g' $(STAGING_FLUXCD)/metadata.yaml
|
||||||
|
|
||||||
# Copy the plugins: installed in the buildroot
|
# Copy the plugins: installed in the buildroot
|
||||||
mkdir -p $(STAGING_FLUXCD)/plugins
|
mkdir -p $(STAGING_FLUXCD)/plugins
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
app_name: @APP_NAME@
|
app_name: APP_REPLACE_NAME
|
||||||
app_version: @APP_VERSION@
|
app_version: APP_REPLACE_VERSION
|
||||||
helm_repo: @HELM_REPO@
|
helm_repo: HELM_REPLACE_REPO
|
||||||
|
|
||||||
helm_toolkit_required: false
|
helm_toolkit_required: false
|
||||||
|
|
||||||
behavior:
|
behavior:
|
||||||
platform_managed_app: yes
|
platform_managed_app: yes
|
||||||
desired_state: uploaded
|
desired_state: uploaded
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
# hacking pulls in flake8
|
# hacking pulls in flake8
|
||||||
|
hacking>=1.1.0,<=2.0.0 # Apache-2.0
|
||||||
bashate >= 0.2
|
bashate >= 0.2
|
||||||
|
48
tox.ini
48
tox.ini
@ -1,13 +1,14 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = linters
|
envlist = linters
|
||||||
minversion = 2.3
|
minversion = 2.9
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
sitepackages=False
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
install_command = pip install \
|
basepython = python3
|
||||||
-v -v -v \
|
install_command = pip install -U \
|
||||||
-c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/stable/stein/upper-constraints.txt} \
|
{opts} {packages} \
|
||||||
{opts} {packages}
|
-c{env:TOX_CONSTRAINTS_FILE:https://opendev.org/starlingx/root/raw/branch/master/build-tools/requirements/debian/upper-constraints.txt}
|
||||||
setenv =
|
setenv =
|
||||||
VIRTUAL_ENV={envdir}
|
VIRTUAL_ENV={envdir}
|
||||||
OS_STDOUT_CAPTURE=1
|
OS_STDOUT_CAPTURE=1
|
||||||
@ -20,6 +21,22 @@ deps =
|
|||||||
allowlist_externals =
|
allowlist_externals =
|
||||||
bash
|
bash
|
||||||
|
|
||||||
|
[testenv:flake8]
|
||||||
|
basepython = python3
|
||||||
|
description = Dummy environment to allow flake8 to be run in subdir tox
|
||||||
|
|
||||||
|
[testenv:pylint]
|
||||||
|
basepython = python3
|
||||||
|
description = Dummy environment to allow pylint to be run in subdir tox
|
||||||
|
|
||||||
|
[testenv:metadata]
|
||||||
|
basepython = python3
|
||||||
|
description = Dummy environment to allow sysinv-app to be run in subdir tox
|
||||||
|
|
||||||
|
[testenv:bandit]
|
||||||
|
basepython = python3
|
||||||
|
description = Dummy environment to allow bandit to be run in subdir tox
|
||||||
|
|
||||||
[testenv:bashate]
|
[testenv:bashate]
|
||||||
# Treat all E* codes as Errors rather than warnings using: -e 'E*'
|
# Treat all E* codes as Errors rather than warnings using: -e 'E*'
|
||||||
commands =
|
commands =
|
||||||
@ -35,24 +52,3 @@ commands =
|
|||||||
[testenv:linters]
|
[testenv:linters]
|
||||||
commands =
|
commands =
|
||||||
{[testenv:bashate]commands}
|
{[testenv:bashate]commands}
|
||||||
|
|
||||||
[testenv:flake8]
|
|
||||||
basepython = python3
|
|
||||||
description = Dummy environment to allow flake8 to be run in subdir tox
|
|
||||||
|
|
||||||
[testenv:pylint]
|
|
||||||
basepython = python3
|
|
||||||
description = Dummy environment to allow pylint to be run in subdir tox
|
|
||||||
|
|
||||||
[testenv:bandit]
|
|
||||||
basepython = python3
|
|
||||||
description = Dummy environment to allow bandit to be run in subdir tox
|
|
||||||
|
|
||||||
[testenv:bindep]
|
|
||||||
# Do not install any requirements. We want this to be fast and work even if
|
|
||||||
# system dependencies are missing, since it's used to tell you what system
|
|
||||||
# dependencies are missing! This also means that bindep must be installed
|
|
||||||
# separately, outside of the requirements files.
|
|
||||||
skip_install = True
|
|
||||||
deps = bindep
|
|
||||||
commands = bindep test
|
|
||||||
|
Loading…
Reference in New Issue
Block a user