Skip to content

Commit

Permalink
Drop support for Python 2 and flake8 2.x
Browse files Browse the repository at this point in the history
Enough time has passed for us to safely drop support for old versions of
Python 2 (and 3.6) and flake8.
  • Loading branch information
jparise committed Dec 30, 2021
1 parent ed5338e commit 9ba21ef
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 68 deletions.
31 changes: 16 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: CI

on:
Expand All @@ -13,20 +14,20 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [2.7, 3.6, 3.7, 3.8, 3.9, pypy2, pypy3]
python-version: [3.7, 3.8, 3.9, '3.10', 'pypy-3.7']

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Tests
run: |
python setup.py check --restructuredtext
flake8
python setup.py test
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Tests
run: |
python setup.py check --restructuredtext
flake8
python setup.py test
9 changes: 2 additions & 7 deletions flake8_author.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import re

__author__ = 'Jon Parise'
__version__ = '1.2.0'
__version__ = '2.0.0'


class Checker(object):
Expand All @@ -29,12 +29,7 @@ def __init__(self, tree, filename):

@classmethod
def add_options(cls, parser):
extra_kwargs = {}
if hasattr(parser, 'config_options'): # flake8 < 3.0
parser.config_options.append('author-attribute')
parser.config_options.append('author-pattern')
else: # flake8 >= 3.0
extra_kwargs['parse_from_config'] = True
extra_kwargs = {'parse_from_config': True}

parser.add_option(
'--author-attribute',
Expand Down
37 changes: 37 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
[metadata]
name = flake8-author
version = attr: flake8_author.__version__
author = Jon Parise
author_email = jon@indelible.org
description = Flake8 __author__ checker
long_description = file: README.rst, LICENSE, CHANGES.rst
license = MIT
url = https://github.com/jparise/flake8-author
project_urls =
Source Code = https://github.com/jparise/flake8-author
Issue Tracker = https://github.com/jparise/flake8-author/issues
keywords = flake8 __author__
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Console
Framework :: Flake8
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Topic :: Software Development :: Libraries :: Python Modules
Topic :: Software Development :: Quality Assurance

[options]
py_modules = flake8_author
python_requires = >= 3.7
zip_safe = True

[options.entry_points]
flake8.extension =
A40 = flake8_author:Checker

[flake8]
exclude=.eggs/,.git/,.venv/,build/,dist/
49 changes: 3 additions & 46 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,10 @@
#!/usr/bin/env python

import re

from setuptools import setup


def get_version(filename):
f = open(filename).read()
return re.search("__version__ = ['\"]([^'\"]+)['\"]", f).group(1)


version = get_version('flake8_author.py')
description = open('README.rst').read() + "\n\n" + open('CHANGES.rst').read()

setup(
name='flake8-author',
version=version,
description='Flake8 __author__ checker',
long_description=description,
author='Jon Parise',
author_email='jon@indelible.org',
keywords='flake8 __author__',
url='https://github.com/jparise/flake8-author',
download_url='https://github.com/jparise/flake8-author/tarball/' + version,
license='MIT',
py_modules=['flake8_author'],
entry_points={
'flake8.extension': ['A40 = flake8_author:Checker'],
},
install_requires=['flake8'],
name="flake8-author",
install_requires=["flake8>=3.0.0"],
tests_require=['flake8>=3.0.0'],
test_suite='tests',
zip_safe=True,
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Framework :: Flake8',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Software Development :: Quality Assurance'
],
test_suite="tests",
)

0 comments on commit 9ba21ef

Please sign in to comment.