From 04b7480c28bd09ba960a9d9232d3c7af95ec3228 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 19 May 2022 15:28:47 +0300 Subject: [PATCH] Add support for Python 3.10 and drop EOL 3.5 (#167) * Add support for Python 3.10 * Remove Trove classifiers for dropped versions * Remove redundant setup.cfg: no need for universal wheels for Python 3-only, setuptools and wheel auto-find LICENSE files * Added Required Python Version Added python_requires to specify the required python version for the library. * Updated required python version * Drop support for EOL Python 3.5 * Upgrade Python syntax with pyupgrade --py36-plus Co-authored-by: Nirjas Jakilim --- .github/workflows/ci.yml | 4 ++-- certifi/core.py | 4 +--- certifi/tests/test_certify.py | 2 -- setup.cfg | 2 -- setup.py | 8 +++----- 5 files changed, 6 insertions(+), 14 deletions(-) delete mode 100644 setup.cfg diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cadb14f2..a5e1acca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8, 3.9] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 @@ -33,7 +33,7 @@ jobs: - name: Install test dependencies run: | python -m pip install --upgrade pip - pip install pytest + python -m pip install pytest - name: Test with pytest run: | pytest diff --git a/certifi/core.py b/certifi/core.py index d768be79..497d938d 100644 --- a/certifi/core.py +++ b/certifi/core.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - """ certifi.py ~~~~~~~~~~ @@ -55,7 +53,7 @@ def read_text( encoding: str = 'utf-8', errors: str = 'strict' ) -> str: - with open(where(), "r", encoding=encoding) as data: + with open(where(), encoding=encoding) as data: return data.read() # If we don't have importlib.resources, then we will just do the old logic diff --git a/certifi/tests/test_certify.py b/certifi/tests/test_certify.py index 4b443f27..54670eae 100755 --- a/certifi/tests/test_certify.py +++ b/certifi/tests/test_certify.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - import os import unittest diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 0c9e0fc1..00000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[metadata] -license_file = LICENSE diff --git a/setup.py b/setup.py index 48dc8912..5bad7076 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,4 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- -from __future__ import with_statement import re import os import sys @@ -18,7 +16,7 @@ version_regex = r'__version__ = ["\']([^"\']*)["\']' -with open('certifi/__init__.py', 'r') as f: +with open('certifi/__init__.py') as f: text = f.read() match = re.search(version_regex, text) @@ -48,7 +46,7 @@ include_package_data=True, zip_safe=False, license='MPL-2.0', - python_requires=">=3.5", + python_requires=">=3.6", classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', @@ -56,11 +54,11 @@ 'Natural Language :: English', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', ], project_urls={ 'Source': 'https://github.com/certifi/python-certifi',