mgedmin / check-python-versions

Check that supported Python versions in a setup.py match tox.ini, .travis.yml and a bunch of other files
https://pypi.org/project/check-python-versions/
GNU General Public License v3.0
21 stars 12 forks source link

Prettier python_requires #10

Closed mgedmin closed 4 years ago

mgedmin commented 4 years ago

Some people (cough jamadden cough) format python_requires like this:

    python_requires=', '.join([
        '>= 2.7',
        '!= 3.0',
        '!= 3.1',
        '!= 3.2',
        '!= 3.3',
        '!= 3.4',
    ])

check-python-versions is able to parse this, but when modifying it overwrites it with a one-line expression

    python_requires='>= 2.7, != 3.0, != 3.1, != 3.2, != 3.3, != 3.4',

(actually it's buggy and replaces the first line, then leaves the rest in place, introducing a syntax error!)

It would be nice if it could preserve the multiline formatting.

jamadden commented 4 years ago

I copied that from someone, I think icemac.