Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code readability #35

Merged
merged 1 commit into from
Apr 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
Expand All @@ -32,14 +32,14 @@ jobs:
test:
name: Tox Tests
needs: lint
runs-on: ${{ matrix.operating-system }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
steps:
- name: Checkout
uses: actions/checkout@master
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand All @@ -59,9 +59,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
Expand Down Expand Up @@ -89,9 +89,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ Generate temporary AWS credentials via Okta.

.. image:: https://raw.githubusercontent.com/dowjones/tokendito/master/docs/tokendito-scaled.gif


**WARNING: Python2.7 and Python3.5 support will be dropped in a near time, pin tokendito version to current if you want to keep it working in automation.**

NOTE: Advanced users may shorten the tokendito interaction to a `single command <https://github.com/dowjones/tokendito/tree/master/docs#single-command-usage>`_.

.. _STS: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html
Expand Down
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-r ./requirements.txt
black==20.8b1; python_version >= '3.6'
docutils<0.16,>=0.10
flake8
flake8-black; python_version >= '3.6'
flake8-colors
flake8-docstrings
flake8-import-order>=0.9
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ requests>=2.19.0
configparser>=3.5.0
future>=0.16.0
pyOpenSSL>=18.0.0
cryptography==3.3.2; python_version == '2.7'
beautifulsoup4>=4.6.0
lxml>=4.3.0
62 changes: 31 additions & 31 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,54 @@

here = path.abspath(path.dirname(__file__))

with open(path.join(here, 'README.rst'), encoding=sys.stdin.encoding) as f:
with open(path.join(here, "README.rst"), encoding=sys.stdin.encoding) as f:
long_description = f.read()

with open('requirements.txt') as f:
with open("requirements.txt") as f:
required = f.read().splitlines()

about = {}
with open(os.path.join(here, 'tokendito', '__version__.py'), 'r') as f:
with open(os.path.join(here, "tokendito", "__version__.py"), "r") as f:
exec(f.read(), about)

if 'DEVBUILD' in os.environ:
if "DEVBUILD" in os.environ:
now = datetime.datetime.now()
about['__version__'] = about['__version__'] + '.dev' + now.strftime('%Y%m%d%H%M%S')
about["__version__"] = about["__version__"] + ".dev" + now.strftime("%Y%m%d%H%M%S")

setup(
name='tokendito',
version=about['__version__'],
description=about['__description__'],
name="tokendito",
version=about["__version__"],
description=about["__description__"],
long_description=long_description,
long_description_content_type=about['__long_description_content_type__'],
url=about['__url__'],
author=about['__author__'],
author_email=about['__author_email__'],
long_description_content_type=about["__long_description_content_type__"],
url=about["__url__"],
author=about["__author__"],
author_email=about["__author_email__"],
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Development Status :: 5 - Production/Stable',
'Operating System :: OS Independent',
'Environment :: Console',
'Programming Language :: Python',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
"License :: OSI Approved :: Apache Software License",
"Development Status :: 5 - Production/Stable",
"Operating System :: OS Independent",
"Environment :: Console",
"Programming Language :: Python",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
keywords=['okta', 'aws', 'sts'],
packages=find_packages(exclude=['contrib', 'docs', 'tests', '.tox']),
keywords=["okta", "aws", "sts"],
packages=find_packages(exclude=["contrib", "docs", "tests", ".tox"]),
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
license=about['__license__'],
license=about["__license__"],
zip_safe=False,
install_requires=[required],
entry_points={
'console_scripts': ['tokendito=tokendito.__main__:main'],
"console_scripts": ["tokendito=tokendito.__main__:main"],
},
# $ pip install -e . [dev,test]
)
37 changes: 18 additions & 19 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# vim: set filetype=python ts=4 sw=4
# -*- coding: utf-8 -*-
"""pytest configuration, hooks, and global fixtures."""
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from __future__ import absolute_import, division, print_function, unicode_literals

from future import standard_library

Expand All @@ -11,20 +10,20 @@

def pytest_addoption(parser):
"""Add command-line option for running functional tests."""
parser.addoption("--run-functional", action="store_true",
default=False, help="run functional tests")
parser.addoption('--username',
help='username to login to Okta')
parser.addoption('--password',
help='password to login to Okta.')
parser.addoption('--okta-aws-app-url',
help='Okta App URL to use.')
parser.addoption('--mfa-method',
help='Sets the MFA method')
parser.addoption('--mfa-response',
help='Sets the MFA response to a challenge')
parser.addoption('--role-arn',
help='Sets the IAM role')
parser.addoption('--config-file',
default='/dev/null',
help='Sets an optional config file to read from')
parser.addoption(
"--run-functional",
action="store_true",
default=False,
help="run functional tests",
)
parser.addoption("--username", help="username to login to Okta")
parser.addoption("--password", help="password to login to Okta.")
parser.addoption("--okta-aws-app-url", help="Okta App URL to use.")
parser.addoption("--mfa-method", help="Sets the MFA method")
parser.addoption("--mfa-response", help="Sets the MFA response to a challenge")
parser.addoption("--role-arn", help="Sets the IAM role")
parser.addoption(
"--config-file",
default="/dev/null",
help="Sets an optional config file to read from",
)
Loading