Skip to content

Commit 54118ba

Browse files
committed
Drop Python 3.7 support
1 parent 44ca508 commit 54118ba

12 files changed

Lines changed: 25 additions & 44 deletions

.github/workflows/ci-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.8", "3.9", "3.11", "3.13"]
1616

1717
steps:
1818
- uses: actions/checkout@v4

.github/workflows/ci-mac.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.8", "3.10", "3.12", "3.13"]
1616

1717
steps:
1818
- uses: actions/checkout@v4

.github/workflows/ci-windows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
15+
python-version: ["3.8", "3.9", "3.11", "3.13"]
1616

1717
steps:
1818
- uses: actions/checkout@v4

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dynamic = ["version"]
2323
description = "Python library for ReqIF format. ReqIF parsing and unparsing."
2424
readme = "README.md"
2525
license = "Apache-2.0"
26-
requires-python = ">=3.7"
26+
requires-python = ">=3.8"
2727
authors = [
2828
{ name = "Stanislav Pankevich", email = "s.pankevich@gmail.com" },
2929
]

reqif/cli/cli_arg_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def formatter(prog):
5858
# Command – Format
5959
command_parser_format = command_subparsers.add_parser(
6060
"format",
61-
help=("Read a ReqIF file and pretty-print its contents to " "an output file."),
61+
help=("Read a ReqIF file and pretty-print its contents to an output file."),
6262
formatter_class=formatter,
6363
)
6464
command_parser_format.add_argument(

reqif/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def _parse_reqif(xml_reqif) -> ReqIFBundle:
127127
raise NotImplementedError(xml_reqif_nons_root) from None
128128
if xml_reqif_nons_root.tag != "REQ-IF":
129129
raise ReqIFXMLParsingError(
130-
"Expected root tag to be REQ-IF, got: " f"{xml_reqif_nons_root.tag}."
130+
f"Expected root tag to be REQ-IF, got: {xml_reqif_nons_root.tag}."
131131
) from None
132132

133133
# The best workaround I could find for getting the exact content of

reqif/parsers/header_parser.py

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -82,41 +82,26 @@ def unparse(header: ReqIFReqIFHeader) -> str:
8282
output += f" <COMMENT>{header.comment}</COMMENT>\n"
8383
if header.creation_time:
8484
output += (
85-
" "
86-
"<CREATION-TIME>"
87-
f"{header.creation_time}"
88-
"</CREATION-TIME>\n"
85+
f" <CREATION-TIME>{header.creation_time}</CREATION-TIME>\n"
8986
)
9087
if header.repository_id is not None:
9188
if isinstance(header.repository_id, str):
9289
output += (
93-
" "
94-
"<REPOSITORY-ID>"
95-
f"{header.repository_id}"
96-
"</REPOSITORY-ID>\n"
90+
f" <REPOSITORY-ID>{header.repository_id}</REPOSITORY-ID>\n"
9791
)
9892
else:
9993
output += " <REPOSITORY-ID/>\n"
10094
if header.req_if_tool_id:
10195
output += (
102-
" "
103-
"<REQ-IF-TOOL-ID>"
104-
f"{header.req_if_tool_id}"
105-
"</REQ-IF-TOOL-ID>\n"
96+
f" <REQ-IF-TOOL-ID>{header.req_if_tool_id}</REQ-IF-TOOL-ID>\n"
10697
)
10798
if header.req_if_version:
10899
output += (
109-
" "
110-
"<REQ-IF-VERSION>"
111-
f"{header.req_if_version}"
112-
"</REQ-IF-VERSION>\n"
100+
f" <REQ-IF-VERSION>{header.req_if_version}</REQ-IF-VERSION>\n"
113101
)
114102
if header.source_tool_id:
115103
output += (
116-
" "
117-
"<SOURCE-TOOL-ID>"
118-
f"{header.source_tool_id}"
119-
"</SOURCE-TOOL-ID>\n"
104+
f" <SOURCE-TOOL-ID>{header.source_tool_id}</SOURCE-TOOL-ID>\n"
120105
)
121106
if header.title:
122107
output += f" <TITLE>{lxml_escape_title(header.title)}</TITLE>\n"

reqif/parsers/spec_hierarchy_parser.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,7 @@ def parse(spec_hierarchy_xml, level=1) -> ReqIFSpecHierarchy:
6969
def unparse(hierarchy: ReqIFSpecHierarchy) -> str:
7070
base_level = hierarchy.calculate_base_level()
7171
base_level_str = " " * base_level
72-
output = (
73-
base_level_str + f"<SPEC-HIERARCHY" f' IDENTIFIER="{hierarchy.identifier}"'
74-
)
72+
output = base_level_str + f'<SPEC-HIERARCHY IDENTIFIER="{hierarchy.identifier}"'
7573
if hierarchy.editable is not None:
7674
editable_value = "true" if hierarchy.editable else "false"
7775
output += f' IS-EDITABLE="{editable_value}"'

reqif/parsers/spec_types/relation_group_type_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
class RelationGroupTypeParser:
99
@staticmethod
1010
def parse(xml_spec_relation_type_xml) -> ReqIFRelationGroupType:
11-
assert (
12-
xml_spec_relation_type_xml.tag == "RELATION-GROUP-TYPE"
13-
), f"{xml_spec_relation_type_xml}"
11+
assert xml_spec_relation_type_xml.tag == "RELATION-GROUP-TYPE", (
12+
f"{xml_spec_relation_type_xml}"
13+
)
1414
is_self_closed = lxml_is_self_closed_tag(xml_spec_relation_type_xml)
1515

1616
xml_attributes = xml_spec_relation_type_xml.attrib

reqif/parsers/spec_types/spec_relation_type_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
class SpecRelationTypeParser:
1010
@staticmethod
1111
def parse(xml_spec_relation_type_xml) -> ReqIFSpecRelationType:
12-
assert (
13-
xml_spec_relation_type_xml.tag == "SPEC-RELATION-TYPE"
14-
), f"{xml_spec_relation_type_xml}"
12+
assert xml_spec_relation_type_xml.tag == "SPEC-RELATION-TYPE", (
13+
f"{xml_spec_relation_type_xml}"
14+
)
1515
is_self_closed = lxml_is_self_closed_tag(xml_spec_relation_type_xml)
1616

1717
xml_attributes = xml_spec_relation_type_xml.attrib

0 commit comments

Comments
 (0)