Skip to content

Commit

Permalink
Drop python 3.7 (#359)
Browse files Browse the repository at this point in the history
* Drop python 3.7

Its no longer supported and breaking the build

* Run pyupgrade over the code

* Isort
  • Loading branch information
Bachmann1234 authored Aug 23, 2023
1 parent a83c391 commit 408339c
Show file tree
Hide file tree
Showing 7 changed files with 311 additions and 391 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
Expand Down
2 changes: 1 addition & 1 deletion diff_cover/diff_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def _parse_hunk_line(self, line):
return int(groups[0])

except ValueError:
msg = "Could not parse '{}' as a line number".format(groups[0])
msg = f"Could not parse '{groups[0]}' as a line number"
raise GitDiffError(msg)

else:
Expand Down
2 changes: 1 addition & 1 deletion diff_cover/violationsreporters/java_violations_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

try:
# Needed for Python < 3.3, works up to 3.8
import xml.etree.cElementTree as etree
import xml.etree.ElementTree as etree
except ImportError:
# Python 3.9 onwards
import xml.etree.ElementTree as etree
Expand Down
2 changes: 1 addition & 1 deletion diff_cover/violationsreporters/violations_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def parse(lcov_file):
File format: https://ltp.sourceforge.net/coverage/lcov/geninfo.1.php
"""
lcov_report = defaultdict(dict)
lcov = open(lcov_file, "r")
lcov = open(lcov_file)
while True:
line = lcov.readline()
if not line:
Expand Down
670 changes: 302 additions & 368 deletions poetry.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ classifiers=[
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -40,7 +39,7 @@ diff-cover = 'diff_cover.diff_cover_tool:main'
diff-quality = 'diff_cover.diff_quality_tool:main'

[tool.poetry.dependencies]
python = "^3.7.2"
python = "^3.8.10"
Pygments = "^2.9.0"
Jinja2 = ">=2.7.1"
pluggy = ">=0.13.1,<2"
Expand Down
21 changes: 4 additions & 17 deletions tests/test_violations_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,8 @@

import os
import subprocess
import xml.etree.ElementTree as etree
from io import BytesIO, StringIO

try:
# Needed for Python < 3.3, works up to 3.8
import xml.etree.cElementTree as etree
except ImportError:
# Python 3.9 onwards
import xml.etree.ElementTree as etree

from subprocess import Popen
from textwrap import dedent

Expand Down Expand Up @@ -128,12 +121,8 @@ def test_non_python_violations(self):
)
coverage = XmlCoverageReporter([xml])

assert violations == coverage.violations(
"{}/{}".format(fancy_path, file_paths[0])
)
assert measured == coverage.measured_lines(
"{}/{}".format(fancy_path, file_paths[0])
)
assert violations == coverage.violations(f"{fancy_path}/{file_paths[0]}")
assert measured == coverage.measured_lines(f"{fancy_path}/{file_paths[0]}")

def test_non_python_violations_empty_path(self):
"""
Expand Down Expand Up @@ -1699,9 +1688,7 @@ def _get_out(self):

def test_report_root_path(self):
reports = [
BytesIO(
"foo/bar/path/to/file.js: line 3, col 9, Found issue".encode("utf-8")
),
BytesIO(b"foo/bar/path/to/file.js: line 3, col 9, Found issue"),
]

driver = self._get_out()
Expand Down

0 comments on commit 408339c

Please sign in to comment.