summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Petrello <rpetrell@redhat.com>2019-08-09 04:26:39 +0200
committerRyan Petrello <rpetrell@redhat.com>2019-08-09 16:07:40 +0200
commitadaa4148c69592e504a232a54cd6b767d32628d7 (patch)
tree31bc465577b02061b04414c6fe73df2c70996556
parentimport awxkit (diff)
downloadawx-adaa4148c69592e504a232a54cd6b767d32628d7.tar.xz
awx-adaa4148c69592e504a232a54cd6b767d32628d7.zip
include awxkit CI in zuul runs
additionally, fix up some flake8 failures
-rw-r--r--Makefile1
-rw-r--r--awxkit/awxkit/api/mixins/has_create.py14
-rw-r--r--awxkit/awxkit/api/pages/unified_jobs.py6
-rw-r--r--awxkit/awxkit/api/pages/users.py5
-rw-r--r--awxkit/awxkit/cli/format.py7
-rw-r--r--awxkit/setup.py33
-rw-r--r--requirements/requirements_dev.txt1
-rwxr-xr-xsetup.cfg2
8 files changed, 38 insertions, 31 deletions
diff --git a/Makefile b/Makefile
index 67ecf96242..b3466589d9 100644
--- a/Makefile
+++ b/Makefile
@@ -376,6 +376,7 @@ test:
. $(VENV_BASE)/awx/bin/activate; \
fi; \
PYTHONDONTWRITEBYTECODE=1 py.test -p no:cacheprovider -n auto $(TEST_DIRS)
+ cd awxkit && $(VENV_BASE)/awx/bin/tox -re py3
awx-manage check_migrations --dry-run --check -n 'vNNN_missing_migration_file'
test_unit:
diff --git a/awxkit/awxkit/api/mixins/has_create.py b/awxkit/awxkit/api/mixins/has_create.py
index 9736e9514b..672a3efd5f 100644
--- a/awxkit/awxkit/api/mixins/has_create.py
+++ b/awxkit/awxkit/api/mixins/has_create.py
@@ -375,14 +375,14 @@ class HasCreate(object):
to_teardown = all_instantiated_dependencies(self)
to_teardown_types = set(map(get_class_if_instance, to_teardown))
order = [
- set(
- [
- potential for potential in (
- get_class_if_instance(x) for x in group) if potential in to_teardown_types
- ]
- )
- for group in page_creation_order(self, *to_teardown)
+ set(
+ [
+ potential for potential in (
+ get_class_if_instance(x) for x in group) if potential in to_teardown_types
]
+ )
+ for group in page_creation_order(self, *to_teardown)
+ ]
order.reverse()
for teardown_group in order:
for teardown_class in teardown_group:
diff --git a/awxkit/awxkit/api/pages/unified_jobs.py b/awxkit/awxkit/api/pages/unified_jobs.py
index bc369a0349..38457d1922 100644
--- a/awxkit/awxkit/api/pages/unified_jobs.py
+++ b/awxkit/awxkit/api/pages/unified_jobs.py
@@ -33,8 +33,8 @@ class UnifiedJob(HasStatus, base.Base):
def result_stdout(self):
if 'result_stdout' not in self.json and 'stdout' in self.related:
return self.connection.get(
- self.related.stdout, query_parameters=dict(format='txt_download')
- ).content.decode()
+ self.related.stdout, query_parameters=dict(format='txt_download')
+ ).content.decode()
if str(self.json.get('result_stdout')) == 'stdout capture is missing' and 'stdout' in self.related:
ping = self.walk(resources.ping)
if self.execution_node != ping.active_node:
@@ -60,7 +60,7 @@ class UnifiedJob(HasStatus, base.Base):
pretty_stdout = pformat(stdout)
raise AssertionError(
'Expected "{}", but it was not found in stdout. Full stdout:\n {}'.format(expected_text, pretty_stdout)
- )
+ )
@property
def is_successful(self):
diff --git a/awxkit/awxkit/api/pages/users.py b/awxkit/awxkit/api/pages/users.py
index 702a19c549..2c25950e4c 100644
--- a/awxkit/awxkit/api/pages/users.py
+++ b/awxkit/awxkit/api/pages/users.py
@@ -29,8 +29,9 @@ class User(HasCreate, base.Base):
random_title()),
email=kwargs.get(
'email',
- '{}@example.com'.format(random_title(5, non_ascii=False)))
- )
+ '{}@example.com'.format(random_title(5, non_ascii=False))
+ )
+ )
return payload
def create_payload(self, username='', password='', **kwargs):
diff --git a/awxkit/awxkit/cli/format.py b/awxkit/awxkit/cli/format.py
index adf84bd62a..1a99a6eaf7 100644
--- a/awxkit/awxkit/cli/format.py
+++ b/awxkit/awxkit/cli/format.py
@@ -148,13 +148,16 @@ def format_human(output, fmt):
else:
output = [output]
- return tabulate([
+ return tabulate(
+ [
dict(
(col, record.get(col, ''))
for col in column_names
)
for record in output
- ], headers='keys', tablefmt='rst'
+ ],
+ headers='keys',
+ tablefmt='rst'
)
diff --git a/awxkit/setup.py b/awxkit/setup.py
index 0a68546096..aa41ca14eb 100644
--- a/awxkit/setup.py
+++ b/awxkit/setup.py
@@ -51,20 +51,21 @@ class CleanCommand(Command):
version = '0.1.0'
-setup(name='awxkit',
- version=version,
- description='awx cli client',
- packages=find_packages(exclude=['test']),
- cmdclass={
- 'clean': CleanCommand,
- },
- include_package_data=True,
- install_requires=requirements,
- python_requires=">= 3.5",
- entry_points={
- 'console_scripts': [
- 'akit=awxkit.scripts.basic_session:load_interactive',
- 'awx=awxkit.cli:run'
- ]
- }
+setup(
+ name='awxkit',
+ version=version,
+ description='awx cli client',
+ packages=find_packages(exclude=['test']),
+ cmdclass={
+ 'clean': CleanCommand,
+ },
+ include_package_data=True,
+ install_requires=requirements,
+ python_requires=">= 3.5",
+ entry_points={
+ 'console_scripts': [
+ 'akit=awxkit.scripts.basic_session:load_interactive',
+ 'awx=awxkit.cli:run'
+ ]
+ }
)
diff --git a/requirements/requirements_dev.txt b/requirements/requirements_dev.txt
index ad6a8c890d..59a7c5837a 100644
--- a/requirements/requirements_dev.txt
+++ b/requirements/requirements_dev.txt
@@ -14,6 +14,7 @@ pytest-pythonpath
pytest-mock
pytest-timeout
pytest-xdist<1.28.0
+tox # for awxkit
logutils
jupyter
matplotlib
diff --git a/setup.cfg b/setup.cfg
index cb208fc8b8..e99856b7b1 100755
--- a/setup.cfg
+++ b/setup.cfg
@@ -18,4 +18,4 @@ exclude=.tox,venv,awx/lib/site-packages,awx/plugins/inventory/ec2.py,awx/plugins
[flake8]
max-line-length=160
ignore=E201,E203,E221,E225,E231,E241,E251,E261,E265,E303,W291,W391,W293,E731,W504
-exclude=.tox,venv,awx/lib/site-packages,awx/plugins/inventory,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data,node_modules/,awx/projects/,tools/docker,awx/settings/local_*.py,installer/openshift/settings.py,build/,installer/
+exclude=.tox,venv,awx/lib/site-packages,awx/plugins/inventory,awx/ui,awx/api/urls.py,awx/main/migrations,awx/main/tests/data,node_modules/,awx/projects/,tools/docker,awx/settings/local_*.py,installer/openshift/settings.py,build/,installer/,awxkit/test