Skip to content

Commit

Permalink
[build] re-introduce support for Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
anjakefala committed Oct 9, 2023
1 parent 51beeb9 commit 2f7a50c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"]

runs-on: ubuntu-latest
timeout-minutes: 20
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
long_description=open('README.md').read(),
long_description_content_type='text/markdown',
author='Saul Pwanson',
python_requires='>=3.8',
python_requires='>=3.7',
author_email='visidata@saul.pw',
url='https://visidata.org',
download_url='https://github.com/saulpw/visidata/tarball/' + __version__,
Expand Down
6 changes: 5 additions & 1 deletion visidata/aggregators.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
import math
import functools
import collections
Expand Down Expand Up @@ -90,9 +91,12 @@ def mean(vals):
if vals:
return float(sum(vals))/len(vals)

def vsum(vals):
def _vsum(vals):
return sum(vals, start=type(vals[0] if len(vals) else 0)()) #1996

# start parameter in sum() added in Python 3.8
vsum = _vsum if sys.version_info[:2] >= (3, 8) else sum

# http://code.activestate.com/recipes/511478-finding-the-percentile-of-the-values/
def _percentile(N, percent, key=lambda x:x):
"""
Expand Down

0 comments on commit 2f7a50c

Please sign in to comment.