Skip to content

Commit

Permalink
mailmap documents python2
Browse files Browse the repository at this point in the history
I believe this to be useful for at least two reasons.

Current documentation either state to use `python bin/mailmap_check.py` or just
`bin/mailmap_check.py` which itself calles `python`. In both case, on ubuntu
this will run python2.

Worse, instead of printing "This script requires Python 3.8 or newer" it prints
an error message that python don't know what to do with the f-string. If the
f-string is removed, that it does not know pathlib. So, I ensure that the script
still work as before on 3.8 and prints a more useful message on python2.  I
admit I'm not fan of removing a f-string, however, since there was a single
f-string, I assume it was relatively acceptable.

I suppose most sympy contributor are at ease with those subtilities of
python2/3. However, this will at least be useful for people, like me, who only
wanted to contribute to improving documentation and not have to deal with
complexity of system administration.
  • Loading branch information
Arthur-Milchior committed Aug 9, 2022
1 parent a8ab2a0 commit e8bf22b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .mailmap
Expand Up @@ -34,6 +34,9 @@
#
# ...
#
# If it fails, you may need to replace `python` by `python3`, here and below, if
# you're on a system that still uses python2 by default.
#
# 3. Add a line to this file with that same name and email address like:
#
# Joe Bloggs <joe@bloggs.com>
Expand Down
8 changes: 4 additions & 4 deletions bin/mailmap_check.py
Expand Up @@ -15,14 +15,14 @@

import sys
import os
if sys.version_info < (3, 8):
sys.exit("This script requires Python 3.8 or newer")

from pathlib import Path
from subprocess import run, PIPE
from collections import OrderedDict, defaultdict
from argparse import ArgumentParser

if sys.version_info < (3, 8):
sys.exit("This script requires Python 3.8 or newer")

def sympy_dir():
return Path(__file__).resolve().parent.parent

Expand Down Expand Up @@ -304,7 +304,7 @@ def make_authors_file_lines(git_people):
to their names are not found in the metadata of the git history. This
file is generated automatically by running `./bin/authors_update.py`.
""").lstrip()
header_extra = f"There are a total of {len(git_people)} authors."""
header_extra = "There are a total of %d authors." % len(git_people)
lines = header.splitlines()
lines.append('')
lines.append(header_extra)
Expand Down

0 comments on commit e8bf22b

Please sign in to comment.