Skip to content

Commit

Permalink
Deprecate Python version<3.6 (#52)
Browse files Browse the repository at this point in the history
Co-authored-by: Yaroslav Kudrin <Iaroslav_Kudrin@epam.com>
  • Loading branch information
kudrinyaroslav and Yaroslav Kudrin committed Aug 20, 2021
1 parent 65e4d1a commit 820f774
Show file tree
Hide file tree
Showing 20 changed files with 240 additions and 425 deletions.
1 change: 1 addition & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches:
- main
- master
- feature/2.0.0
paths-ignore:
- '**.md'
- '**.rst'
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
branches:
- master
- main
- feature/2.0.0

jobs:
testpypipublish:
Expand All @@ -28,7 +29,7 @@ jobs:
pip install setuptools wheel twine
- name: Build
run: |
python setup.py sdist bdist_wheel --universal
python setup.py sdist bdist_wheel
twine check dist/*
env:
DEVBUILD: 1
Expand All @@ -55,7 +56,7 @@ jobs:
pip install setuptools wheel twine
- name: Build
run: |
python setup.py sdist bdist_wheel --universal
python setup.py sdist bdist_wheel
twine check dist/*
- name: Publish distribution package to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches:
- master
- main
- feature/2.0.0

jobs:
lint:
Expand All @@ -34,7 +35,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
python-version: [3.6, 3.7, 3.8]
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/woke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:
branches:
- main
- master
- feature/2.0.0

jobs:
woke:
Expand Down
8 changes: 3 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Generate temporary AWS credentials via Okta.
.. image:: https://github.com/dowjones/tokendito/workflows/Lint%20and%20Test/badge.svg
:target: https://github.com/dowjones/tokendito/actions

.. image:: https://img.shields.io/badge/python-2.7%2C%203.5%2C%203.6%2C%203.7%2C%203.8-blueviolet
.. image:: https://img.shields.io/badge/python-3.6%2C%203.7%2C%203.8-blueviolet
:target: https://pypi.org/project/tokendito/

.. image:: https://github.com/dowjones/tokendito/workflows/Woke/badge.svg
Expand All @@ -27,8 +27,6 @@ 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 All @@ -38,10 +36,10 @@ Use tokendito to generate temporary AWS credentials via Okta for programmatic au
Requirements
------------

* Python 2.7.10+
* Python 3.6+
* Your AWS account is federated in Okta

tokendito is compatible with both python 2 and 3, and can be installed with either pip or pip3.
tokendito is compatible with python 3, and can be installed with either pip or pip3.

Getting started
---------------
Expand Down
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
-r ./requirements.txt
black==20.8b1; python_version >= '3.6'
black==20.8b1
coveragepy-lcov; python_version >= '3.8'
docutils<0.16,>=0.10
flake8
flake8-black; python_version >= '3.6'
flake8-black
flake8-colors
flake8-docstrings
flake8-import-order>=0.9
Expand Down
3 changes: 0 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
boto3>=1.9.0
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
pytz==2021.1
tzlocal==2.1
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,13 @@
"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"]),
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*",
python_requires=">=3.6",
license=about["__license__"],
zip_safe=False,
install_requires=[required],
Expand Down
5 changes: 0 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# 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 standard_library

standard_library.install_aliases()


def pytest_addoption(parser):
Expand Down
42 changes: 6 additions & 36 deletions tests/functional_test.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
# vim: set filetype=python ts=4 sw=4
# -*- coding: utf-8 -*-
"""Functional tests, and local fixtures."""
from __future__ import absolute_import, division, print_function, unicode_literals

from builtins import ( # noqa: F401
ascii,
bytes,
chr,
dict,
filter,
hex,
input,
int,
list,
map,
next,
object,
oct,
open,
pow,
range,
round,
str,
super,
zip,
)
import datetime
from os import environ, path
import re
import subprocess
import sys
import time

from future import standard_library
import pytest

sys.path.insert(0, path.dirname(path.dirname(path.abspath(__file__))))
standard_library.install_aliases()


def string_decode(bytestring):
Expand Down Expand Up @@ -155,10 +129,6 @@ def test_version(package_version, package_regex, runnable):
assert package_version == local_version


@pytest.mark.skipif(
sys.version_info[:2] < (3, 5),
reason="PyOTP Not supported in Python 2.x",
)
@pytest.mark.run("second-to-last")
def test_generate_credentials(custom_args):
"""Run the tool and generate credentials."""
Expand Down Expand Up @@ -202,17 +172,17 @@ def test_generate_credentials(custom_args):
# Rebuild argument list
args = [
"--role-arn",
"{}".format(settings.role_arn),
f"{settings.role_arn}",
"--okta-aws-app-url",
"{}".format(settings.okta_aws_app_url),
f"{settings.okta_aws_app_url}",
"--mfa-method",
"{}".format(settings.mfa_method),
f"{settings.mfa_method}",
"--mfa-response",
"{}".format(settings.mfa_response),
f"{settings.mfa_response}",
"--username",
"{}".format(settings.okta_username),
f"{settings.okta_username}",
"--password",
"{}".format(settings.okta_password),
f"{settings.okta_password}",
]
# run as a local module, as we can't guarantee that the binary is installed.
executable = [sys.executable, "-m", "tokendito"]
Expand Down
Loading

0 comments on commit 820f774

Please sign in to comment.