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

Drop support for Python 2 & 3.5 #177

Merged
merged 11 commits into from Nov 6, 2021
4 changes: 1 addition & 3 deletions README.md
Expand Up @@ -37,11 +37,9 @@ See [the CI configuration](https://github.com/ansible-collections/community.hash

## Python Requirements

**Python 2.6 is not supported. [Support for Python 2.7 & Python 3.5 will be dropped in `v2.0.0` of the collection.](https://github.com/ansible-collections/community.hashi_vault/issues/81)**
**Python 2.6, 2.7, and 3.5 are not supported in version `2.0.0` or later of the collection.**

Currently we support and test against Python versions:
* 2.7
* 3.5
* 3.6
* 3.7
* 3.8
Expand Down
3 changes: 3 additions & 0 deletions changelogs/fragments/177-drop-py2-3.5.yml
@@ -0,0 +1,3 @@
---
removed_features:
- community.hashi_vault collection - drop support for Python 2 and Python 3.5 (https://github.com/ansible-collections/community.hashi_vault/issues/81).
briantist marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion tests/config.yml
Expand Up @@ -10,7 +10,7 @@ modules:
# Configuration for modules/module_utils.
# These settings do not apply to other content in the collection.

python_requires: '>=2.7'
python_requires: '>=3.6'
# Python versions supported by modules/module_utils.
# This setting is required.
#
Expand Down
5 changes: 5 additions & 0 deletions tests/integration/requirements.txt
@@ -1,3 +1,8 @@
# the collection supports python 3.6 and higher, however the constraints for
# earlier python versions are still needed for Ansible < 2.12 which doesn't
# support tests/config.yml, so that unit tests (which will be skipped) won't
# choke on installing requirements.

hvac >= 0.10.6, != 0.10.12, != 0.10.13, < 1.0.0 ; python_version == '2.7' # bugs in 0.10.12 and 0.10.13 prevent it from working in Python 2
hvac >= 0.10.6, < 1.0.0 ; python_version == '3.5' # py3.5 support will be dropped in 1.0.0
hvac >= 0.10.6 ; python_version >= '3.6'
Expand Down
4 changes: 0 additions & 4 deletions tests/requirements.yml

This file was deleted.

4 changes: 2 additions & 2 deletions tests/unit/conftest.py
Expand Up @@ -11,5 +11,5 @@

@pytest.fixture(autouse=True)
def skip_python():
if sys.version_info < (2, 7):
pytest.skip('Skipping on Python %s. community.hashi_vault supports Python 2.7 and higher.' % sys.version)
if sys.version_info < (3, 6):
pytest.skip('Skipping on Python %s. community.hashi_vault supports Python 3.6 and higher.' % sys.version)
1 change: 0 additions & 1 deletion tests/unit/plugins/module_utils/test_hashi_vault_helper.py
Expand Up @@ -29,7 +29,6 @@ def vault_token_via_env(vault_token):
yield


@pytest.mark.skipif(sys.version_info < (2, 7), reason="Python 2.7 or higher is required.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you somehow need the skip_python fixture here (and in other places)? Or how does that work?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@felixfontein yes indeed! It's in an autouse fixture in tests/unit/conftest.py (which existed before this, I just never went back to take out this one thing). That fixture is updated in this PR to change the version.

class TestHashiVaultHelper(object):

def test_get_vault_client_without_logout_explicit_token(self, hashi_vault_helper, vault_token):
Expand Down
5 changes: 5 additions & 0 deletions tests/unit/requirements.txt
@@ -1,3 +1,8 @@
# the collection supports python 3.6 and higher, however the constraints for
# earlier python versions are still needed for Ansible < 2.12 which doesn't
# support tests/config.yml, so that unit tests (which will be skipped) won't
# choke on installing requirements.

hvac >= 0.10.6, != 0.10.12, != 0.10.13, < 1.0.0 ; python_version == '2.7' # bugs in 0.10.12 and 0.10.13 prevent it from working in Python 2
hvac >= 0.10.6, < 1.0.0 ; python_version == '3.5' # py3.5 support will be dropped in 1.0.0
hvac >= 0.10.6 ; python_version >= '3.6'
Expand Down