From 428f6c0659b542cd4bc218132b50184eb5c2587a Mon Sep 17 00:00:00 2001 From: Hugo Date: Mon, 4 May 2020 23:03:06 +0300 Subject: [PATCH 1/2] Drop support for EOL Python 2 --- .travis.yml | 1 - setup.cfg | 9 --------- setup.py | 23 ++++++----------------- src/sample/__init__.py | 1 - tox.ini | 2 +- 5 files changed, 7 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index 451c9382..e583fcca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ language: python python: - - "2.7" - "3.5" - "3.6" - "3.7" diff --git a/setup.cfg b/setup.cfg index bb3303f8..dadae668 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,12 +2,3 @@ # This includes the license file(s) in the wheel. # https://wheel.readthedocs.io/en/stable/user_guide.html#including-license-files-in-the-generated-wheel-file license_files = LICENSE.txt - -[bdist_wheel] -# This flag says to generate wheels that support both Python 2 and Python -# 3. If your code will not run unchanged on both Python 2 and 3, you will -# need to generate separate wheels for each Python version that you -# support. Removing this line (or setting universal to 0) will prevent -# bdist_wheel from trying to make a universal wheel. For more see: -# https://packaging.python.org/guides/distributing-packages-using-setuptools/#wheels -universal=1 diff --git a/setup.py b/setup.py index a9960a82..ec01b5b1 100644 --- a/setup.py +++ b/setup.py @@ -8,11 +8,6 @@ # Always prefer setuptools over distutils from setuptools import setup, find_packages from os import path -# io.open is needed for projects that support Python 2.7 -# It ensures open() defaults to text mode with universal newlines, -# and accepts an argument to specify the text encoding -# Python 3 only projects can skip this import -from io import open here = path.abspath(path.dirname(__file__)) @@ -104,16 +99,14 @@ 'License :: OSI Approved :: MIT License', # Specify the Python versions you support here. In particular, ensure - # that you indicate whether you support Python 2, Python 3 or both. - # These classifiers are *not* checked by 'pip install'. See instead - # 'python_requires' below. - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', + # that you indicate you support Python 3. These classifiers are *not* + # checked by 'pip install'. See instead 'python_requires' below. '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 :: Only', ], # This field adds keywords for your project which will appear on the @@ -139,10 +132,9 @@ # Specify which Python versions you support. In contrast to the # 'Programming Language' classifiers above, 'pip install' will check this - # and refuse to install the project if the version does not match. If you - # do not support Python 2, you can simplify this to '>=3.5' or similar, see + # and refuse to install the project if the version does not match. See # https://packaging.python.org/guides/distributing-packages-using-setuptools/#python-requires - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4', + python_requires='>=3.5, <4', # This field lists other packages that your project depends on to run. # Any package you put here will be installed by pip when your project is @@ -167,16 +159,13 @@ # If there are data files included in your packages that need to be # installed, specify them here. - # - # If using Python 2.6 or earlier, then these have to be included in - # MANIFEST.in as well. package_data={ # Optional 'sample': ['package_data.dat'], }, # Although 'package_data' is the preferred approach, in some case you may # need to place data files outside of your packages. See: - # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files + # http://docs.python.org/distutils/setupscript.html#installing-additional-files # # In this case, 'data_file' will be installed into '/my_data' data_files=[('my_data', ['data/data_file'])], # Optional diff --git a/src/sample/__init__.py b/src/sample/__init__.py index db836cee..c8f10649 100644 --- a/src/sample/__init__.py +++ b/src/sample/__init__.py @@ -1,4 +1,3 @@ - def main(): """Entry point for the application script""" print("Call your main application code here") diff --git a/tox.ini b/tox.ini index 0c0368a9..d05589ac 100644 --- a/tox.ini +++ b/tox.ini @@ -13,7 +13,7 @@ # and also to help confirm pull requests to this project. [tox] -envlist = py{27,35,36,37,38} +envlist = py{35,36,37,38} # Define the minimal tox version required to run; # if the host tox is less than this the tool with create an environment and From a4117c85bee2ae52b05a8aa74247d5a9739748fd Mon Sep 17 00:00:00 2001 From: Hugo Date: Tue, 5 May 2020 10:44:36 +0300 Subject: [PATCH 2/2] Simplify check-manifest call with v0.42 --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index d05589ac..4e48a185 100644 --- a/tox.ini +++ b/tox.ini @@ -28,13 +28,13 @@ isolated_build = true [testenv] deps = - check-manifest + check-manifest >= 0.42 # If your project uses README.rst, uncomment the following: # readme_renderer flake8 pytest commands = - check-manifest --ignore 'tox.ini,tests,tests/**' + check-manifest --ignore 'tox.ini,tests/**' # This repository uses a Markdown long_description, so the -r flag to # `setup.py check` is not needed. If your project contains a README.rst, # use `python setup.py check -m -r -s` instead.