Skip to content

Commit de15d18

Browse files
authored
Merge pull request #58 from jwodder/pyup
Support Python 3.14; drop support for Python 3.8 & 3.9
2 parents 5f9df22 + a589fc1 commit de15d18

File tree

17 files changed

+59
-82
lines changed

17 files changed

+59
-82
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,18 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
python-version:
22-
- '3.8'
23-
- '3.9'
2422
- '3.10'
2523
- '3.11'
2624
- '3.12'
2725
- '3.13'
28-
- 'pypy-3.8'
29-
- 'pypy-3.9'
26+
- '3.14'
3027
- 'pypy-3.10'
3128
- 'pypy-3.11'
3229
toxenv: [py]
3330
include:
34-
- python-version: '3.8'
31+
- python-version: '3.10'
3532
toxenv: lint
36-
- python-version: '3.8'
33+
- python-version: '3.10'
3734
toxenv: typing
3835
steps:
3936
- name: Check out repository

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v0.9.0 (in development)
2+
-----------------------
3+
- Support Python 3.14
4+
- Drop support for Python 3.8 and 3.9
5+
16
v0.8.2 (2024-12-01)
27
-------------------
38
- Drop support for Python 3.6 and 3.7

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ programs have been split off into a separate package, |clipkg|_.
3838

3939
Installation
4040
============
41-
``javaproperties`` requires Python 3.8 or higher. Just use `pip
41+
``javaproperties`` requires Python 3.10 or higher. Just use `pip
4242
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install it::
4343

4444
python3 -m pip install javaproperties

docs/changelog.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
Changelog
44
=========
55

6+
v0.9.0 (in development)
7+
-----------------------
8+
- Support Python 3.14
9+
- Drop support for Python 3.8 and 3.9
10+
11+
612
v0.8.2 (2024-12-01)
713
-------------------
814
- Drop support for Python 3.6 and 3.7

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ programs have been split off into a separate package, |clipkg|_.
3333

3434
Installation
3535
============
36-
``javaproperties`` requires Python 3.8 or higher. Just use `pip
36+
``javaproperties`` requires Python 3.10 or higher. Just use `pip
3737
<https://pip.pypa.io>`_ for Python 3 (You have pip, right?) to install it::
3838

3939
python3 -m pip install javaproperties

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "javaproperties"
77
dynamic = ["version"]
88
description = "Read & write Java .properties files"
99
readme = "README.rst"
10-
requires-python = ">=3.8"
10+
requires-python = ">=3.10"
1111
license = "MIT"
1212
license-files = ["LICENSE"]
1313
authors = [
@@ -26,12 +26,11 @@ keywords = [
2626
classifiers = [
2727
"Programming Language :: Python :: 3 :: Only",
2828
"Programming Language :: Python :: 3",
29-
"Programming Language :: Python :: 3.8",
30-
"Programming Language :: Python :: 3.9",
3129
"Programming Language :: Python :: 3.10",
3230
"Programming Language :: Python :: 3.11",
3331
"Programming Language :: Python :: 3.12",
3432
"Programming Language :: Python :: 3.13",
33+
"Programming Language :: Python :: 3.14",
3534
"Programming Language :: Python :: Implementation :: CPython",
3635
"Programming Language :: Python :: Implementation :: PyPy",
3736
"Intended Audience :: Developers",

src/javaproperties/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
)
3737
from .xmlprops import dump_xml, dumps_xml, load_xml, loads_xml
3838

39-
__version__ = "0.8.2"
39+
__version__ = "0.9.0.dev1"
4040
__author__ = "John Thorvald Wodder II"
4141
__author_email__ = "javaproperties@varonathe.org"
4242
__license__ = "MIT"

src/javaproperties/propclass.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import annotations
2-
from collections.abc import Iterable, Iterator, Mapping
3-
from typing import Any, BinaryIO, IO, MutableMapping, Optional, TextIO, TypeVar
2+
from collections.abc import Iterable, Iterator, Mapping, MutableMapping
3+
from typing import Any, BinaryIO, IO, TextIO, TypeVar
44
from .reading import load
55
from .writing import dump
66
from .xmlprops import dump_xml, load_xml
@@ -39,7 +39,7 @@ class Properties(MutableMapping[str, str]):
3939
def __init__(
4040
self,
4141
data: None | Mapping[str, str] | Iterable[tuple[str, str]] = None,
42-
defaults: Optional["Properties"] = None,
42+
defaults: Properties | None = None,
4343
) -> None:
4444
self.data: dict[str, str] = {}
4545
#: A `Properties` subobject used as fallback for `getProperty`. Only
@@ -80,7 +80,7 @@ def __eq__(self, other: Any) -> bool:
8080
else:
8181
return NotImplemented
8282

83-
def getProperty(self, key: str, defaultValue: Optional[T] = None) -> str | T | None:
83+
def getProperty(self, key: str, defaultValue: T | None = None) -> str | T | None:
8484
"""
8585
Fetch the value associated with the key ``key`` in the `Properties`
8686
instance. If the key is not present, `defaults` is checked, and then
@@ -141,7 +141,7 @@ def setProperty(self, key: str, value: str) -> None:
141141
"""Equivalent to ``self[key] = value``"""
142142
self[key] = value
143143

144-
def store(self, out: TextIO, comments: Optional[str] = None) -> None:
144+
def store(self, out: TextIO, comments: str | None = None) -> None:
145145
"""
146146
Write the `Properties` instance's entries (in unspecified order) in
147147
``.properties`` format to ``out``, including the current timestamp.
@@ -188,7 +188,7 @@ def loadFromXML(self, inStream: IO) -> None:
188188
def storeToXML(
189189
self,
190190
out: BinaryIO,
191-
comment: Optional[str] = None,
191+
comment: str | None = None,
192192
encoding: str = "UTF-8",
193193
) -> None:
194194
"""

src/javaproperties/propfile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import annotations
22
from collections import OrderedDict
3-
from collections.abc import Iterable, Iterator, Mapping
3+
from collections.abc import Iterable, Iterator, Mapping, MutableMapping, Reversible
44
from datetime import datetime
55
from io import BytesIO, StringIO
6-
from typing import Any, AnyStr, IO, MutableMapping, Optional, Reversible, TextIO, cast
6+
from typing import Any, AnyStr, IO, TextIO, cast
77
from .reading import Comment, KeyValue, PropertiesElement, Whitespace, loads, parse
88
from .util import CONTINUED_RGX, LinkedList, LinkedListNode, ascii_splitlines
99
from .writing import java_timestamp, join_key_value, to_comment
@@ -144,7 +144,7 @@ def __reversed__(self) -> Iterator[str]:
144144
def __len__(self) -> int:
145145
return len(self._key2nodes)
146146

147-
def _comparable(self) -> list[tuple[Optional[str], str]]:
147+
def _comparable(self) -> list[tuple[str | None, str]]:
148148
return [
149149
(p.key, p.value) if isinstance(p, KeyValue) else (None, p.source)
150150
for n in self._lines.iternodes()
@@ -312,7 +312,7 @@ def copy(self) -> PropertiesFile:
312312
return dup
313313

314314
@property
315-
def timestamp(self) -> Optional[str]:
315+
def timestamp(self) -> str | None:
316316
"""
317317
.. versionadded:: 0.7.0
318318
@@ -397,7 +397,7 @@ def timestamp(self) -> None:
397397
return
398398

399399
@property
400-
def header_comment(self) -> Optional[str]:
400+
def header_comment(self) -> str | None:
401401
"""
402402
.. versionadded:: 0.7.0
403403
@@ -455,7 +455,7 @@ def header_comment(self) -> Optional[str]:
455455
return None
456456

457457
@header_comment.setter
458-
def header_comment(self, value: Optional[str]) -> None:
458+
def header_comment(self, value: str | None) -> None:
459459
if value is None:
460460
comments = []
461461
else:

src/javaproperties/reading.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
from __future__ import annotations
2-
from collections.abc import Callable, Iterator
2+
from collections.abc import Callable, Iterable, Iterator
33
from io import BytesIO, StringIO
44
import re
5-
from typing import Any, IO, Iterable, TypeVar, overload
5+
from typing import Any, IO, TypeVar, overload
66
from .util import CONTINUED_RGX, ascii_splitlines
77

88
T = TypeVar("T")
@@ -274,8 +274,7 @@ def lineiter() -> Iterator[str]:
274274
ll = line
275275
if ll == "":
276276
return
277-
for ln in ascii_splitlines(ll):
278-
yield ln
277+
yield from ascii_splitlines(ll)
279278

280279
liter = lineiter()
281280
for source in liter:

0 commit comments

Comments
 (0)