Skip to content

Commit

Permalink
Drop python3.7 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jelmer committed Jun 17, 2024
1 parent b87ca89 commit e2d72e9
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 94 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", '3.12']
python-version: [3.8, 3.9, "3.10", "3.11", '3.12']
experimental: [false]
include:
- os: macos-latest
experimental: true
python-version: 3.7
python-version: "3.12"
- os: windows-latest
python-version: 3.7
python-version: "3.12"
experimental: true
# See https://github.com/actions/toolkit/issues/399
# include:
Expand Down
11 changes: 0 additions & 11 deletions breezy/builtins.py
Original file line number Diff line number Diff line change
Expand Up @@ -4755,17 +4755,6 @@ def run(
lsprof_tests=False,
sync=False,
):
# During selftest, disallow proxying, as it can cause severe
# performance penalties and is only needed for thread
# safety. The selftest command is assumed to not use threads
# too heavily. The call should be as early as possible, as
# error reporting for past duplicate imports won't have useful
# backtraces.
if sys.version_info[0] < 3:
# TODO(pad.lv/1696545): Allow proxying on Python 3, since
# disallowing it currently leads to failures in many places.
lazy_import.disallow_proxying()

try:
from . import tests
except ImportError as exc:
Expand Down
4 changes: 1 addition & 3 deletions breezy/export_pot.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ def _parse_source(source_text, filename="<unknown>"):
# string terminates on. It's more useful to have the line the
# string begins on. Unfortunately, counting back newlines is
# only an approximation as the AST is ignorant of escaping.
str_to_lineno[node.s] = node.lineno - (
0 if sys.version_info >= (3, 8) else node.s.count("\n")
)
str_to_lineno[node.s] = node.lineno
return cls_to_lineno, str_to_lineno


Expand Down
64 changes: 0 additions & 64 deletions breezy/tests/blackbox/test_locale.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,70 +86,6 @@ def test_log_coerced_utf8(self):
out,
)

@unittest.skipIf(
sys.version_info[:2] >= (3, 8),
"python > 3.8 doesn't allow changing filesystem default encoding",
)
def test_log_C(self):
self.disable_missing_extensions_warning()
out, err = self.run_log_quiet_long(
["tree"],
# C is not necessarily the default locale, so set both LANG and
# LC_ALL explicitly because LC_ALL is preferred on (some?) Linux
# systems but only LANG is respected on Windows.
env_changes={
"LANG": "C",
"LC_ALL": "C",
"LC_CTYPE": None,
"LANGUAGE": None,
"PYTHONCOERCECLOCALE": "0",
"PYTHONUTF8": "0",
},
)
self.assertEqual(b"", err)
self.assertEqualDiff(
b"""\
------------------------------------------------------------
revno: 1
committer: ???? Meinel <juju@info.com>
branch nick: tree
timestamp: Thu 2006-08-24 20:28:17 +0000
message:
Unicode ? commit
""",
out,
)

@unittest.skipIf(
sys.version_info[:2] >= (3, 8),
"python > 3.8 doesn't allow changing filesystem default encoding",
)
def test_log_BOGUS(self):
out, err = self.run_log_quiet_long(
["tree"],
env_changes={
"LANG": "BOGUS",
"LC_ALL": None,
"LC_CTYPE": None,
"LANGUAGE": None,
"PYTHONCOERCECLOCALE": "0",
"PYTHONUTF8": "0",
},
)
self.assertStartsWith(err, b"brz: WARNING: Error: unsupported locale setting")
self.assertEqualDiff(
b"""\
------------------------------------------------------------
revno: 1
committer: ???? Meinel <juju@info.com>
branch nick: tree
timestamp: Thu 2006-08-24 20:28:17 +0000
message:
Unicode ? commit
""",
out,
)


class TestMultibyteCodecs(tests.TestCaseWithTransport):
"""Tests for quirks of multibyte encodings and their python codecs."""
Expand Down
14 changes: 3 additions & 11 deletions breezy/tests/test_export_pot.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,9 @@ def test_strings_multiline_escapes(self):
)
"""
_, str_lines = export_pot._parse_source(src)
if sys.version_info < (3, 8):
self.expectFailure(
"Escaped newlines confuses the multiline handling",
self.assertNotEqual,
str_lines,
{"Escaped\n": 0, "Raw\\n": 2, "A\n\nB\n\nC\n\n": -2},
)
else:
self.assertEqual(
str_lines, {"Escaped\n": 1, "Raw\\n": 2, "A\n\nB\n\nC\n\n": 4}
)
self.assertEqual(
str_lines, {"Escaped\n": 1, "Raw\\n": 2, "A\n\nB\n\nC\n\n": 4}
)


class TestModuleContext(tests.TestCase):
Expand Down
8 changes: 7 additions & 1 deletion crates/bazaar/src/hashcache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,13 @@ impl HashCache {
} else {
self.miss_count += 1;

match SFlag::from_bits_truncate(((file_fp.mode) >> 16) as u16) {
#[cfg(not(target_os = "macos"))]
let mode = file_fp.mode;

#[cfg(target_os = "macos")]
let mode = file_fp.mode as u16;

match SFlag::from_bits_truncate(mode) {
SFlag::S_IFREG => {
let filters: Box<dyn ContentFilter> =
if let Some(filter_provider) = self.filter_provider.as_ref() {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
"Programming Language :: C",
"Topic :: Software Development :: Version Control",
]
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"configobj",
"fastbencode",
Expand Down

0 comments on commit e2d72e9

Please sign in to comment.