Skip to content

Commit 209aab0

Browse files
authored
fix: support Python 3.11 (#316)
* fix: support Python 3.11 * chore: fix tests
1 parent 4fcd15c commit 209aab0

File tree

8 files changed

+267
-288
lines changed

8 files changed

+267
-288
lines changed

Diff for: kosmorro/locales/messages.pot

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Translations template for PROJECT.
2-
# Copyright (C) 2022 ORGANIZATION
2+
# Copyright (C) 2023 ORGANIZATION
33
# This file is distributed under the same license as the PROJECT project.
4-
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
55
#
66
#, fuzzy
77
msgid ""
88
msgstr ""
99
"Project-Id-Version: PROJECT VERSION\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2022-07-07 13:10+0200\n"
11+
"POT-Creation-Date: 2023-04-12 16:15+0200\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
1515
"MIME-Version: 1.0\n"
1616
"Content-Type: text/plain; charset=utf-8\n"
1717
"Content-Transfer-Encoding: 8bit\n"
18-
"Generated-By: Babel 2.10.3\n"
18+
"Generated-By: Babel 2.12.1\n"
1919

2020
#: kosmorro/__main__.py:61
2121
msgid ""

Diff for: poetry.lock

+240-259
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ include = [
1515
kosmorro = 'kosmorro.__main__:main'
1616

1717
[tool.poetry.dependencies]
18-
python = ">=3.8,<3.11"
18+
python = ">=3.8,<3.12"
1919
tabulate = ">=0.8,<0.10"
2020
termcolor = ">=1.1,<3.0"
2121
kosmorrolib = "^1.0"

Diff for: tests/dates.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def test_with_date():
1313
== """Monday, January 27, 2020
1414
1515
Moon phase: New Moon
16-
First Quarter on Sunday, February 2, 2020 at 1:41 AM
16+
First Quarter on Sunday, February 2, 2020 at 1:41AM
1717
1818
Expected events:
19-
8:00 PM Venus and Neptune are in conjunction
19+
8:00PM Venus and Neptune are in conjunction
2020
2121
Note: All the hours are given in UTC.
2222
"""

Diff for: tests/general.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22

3-
from sys import version_info
3+
from sys import version_info as python_version
44
from .utils import (
55
execute,
66
KOSMORRO,
@@ -19,7 +19,7 @@ def test_run_without_argument():
1919
print(stdout)
2020

2121
# It always starts with the current date, an empty line and the current and next Moon date:
22-
assert stdout[0] == format_date(date.today(), "full")
22+
assert stdout[0] == format_date(date.today(), "full", "EN")
2323
assert stdout[1] == ""
2424
assert CURRENT_MOON_PHASE_PATTERN.match(stdout[2])
2525
assert NEXT_MOON_PHASE_PATTERN.match(stdout[3])
@@ -31,15 +31,13 @@ def test_run_without_argument():
3131

3232

3333
def test_help_message():
34-
python_version = (version_info.major, version_info.minor)
35-
3634
for arg in ["--help", "-h"]:
3735
result = execute(KOSMORRO + [arg])
3836
assert result.is_successful()
3937

4038
# Options header has changed from "optional arguments" to "options" in Python 3.10.
4139
options_header = (
42-
"options" if python_version == (3, 10) else "optional arguments"
40+
"optional arguments" if python_version.minor < 10 else "options"
4341
)
4442

4543
assert (

Diff for: tests/position.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ def check_command_return(result):
1414
1515
Object Rise time Culmination time Set time
1616
-------- ----------- ------------------ ----------
17-
Sun 7:31 AM 12:01 PM 4:30 PM
18-
Moon 9:06 AM 2:09 PM 7:13 PM
19-
Mercury 8:10 AM 12:49 PM 5:28 PM
20-
Venus 9:01 AM 2:35 PM 8:10 PM
21-
Mars 4:19 AM 8:23 AM 12:28 PM
22-
Jupiter 6:15 AM 10:18 AM 2:21 PM
23-
Saturn 6:56 AM 11:09 AM 3:22 PM
24-
Uranus 10:21 AM 5:25 PM 12:33 AM
25-
Neptune 9:01 AM 2:36 PM 8:10 PM
26-
Pluto 6:57 AM 11:04 AM 3:11 PM
17+
Sun 7:31AM 12:01PM 4:30PM
18+
Moon 9:06AM 2:09PM 7:13PM
19+
Mercury 8:10AM 12:49PM 5:28PM
20+
Venus 9:01AM 2:35PM 8:10PM
21+
Mars 4:19AM 8:23AM 12:28PM
22+
Jupiter 6:15AM 10:18AM 2:21PM
23+
Saturn 6:56AM 11:09AM 3:22PM
24+
Uranus 10:21AM 5:25PM 12:33AM
25+
Neptune 9:01AM 2:36PM 8:10PM
26+
Pluto 6:57AM 11:04AM 3:11PM
2727
2828
Moon phase: New Moon
29-
First Quarter on Sunday, February 2, 2020 at 1:41 AM
29+
First Quarter on Sunday, February 2, 2020 at 1:41AM
3030
3131
Expected events:
32-
8:00 PM Venus and Neptune are in conjunction
32+
8:00PM Venus and Neptune are in conjunction
3333
3434
Note: All the hours are given in UTC.
3535
"""

Diff for: tests/timezone.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def check_command_return_t_plus_one(result):
1313
== """Monday, January 27, 2020
1414
1515
Moon phase: New Moon
16-
First Quarter on Sunday, February 2, 2020 at 2:41 AM
16+
First Quarter on Sunday, February 2, 2020 at 2:41AM
1717
1818
Expected events:
19-
9:00 PM Venus and Neptune are in conjunction
19+
9:00PM Venus and Neptune are in conjunction
2020
2121
Note: All the hours are given in the UTC+1 timezone.
2222
"""
@@ -30,10 +30,10 @@ def check_command_return_t_minus_one(result):
3030
== """Monday, January 27, 2020
3131
3232
Moon phase: New Moon
33-
First Quarter on Sunday, February 2, 2020 at 12:41 AM
33+
First Quarter on Sunday, February 2, 2020 at 12:41AM
3434
3535
Expected events:
36-
7:00 PM Venus and Neptune are in conjunction
36+
7:00PM Venus and Neptune are in conjunction
3737
3838
Note: All the hours are given in the UTC-1 timezone.
3939
"""

Diff for: tests/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
r"on ((Monday)|(Tuesday)|(Wednesday)|(Thursday)|(Friday)|(Saturday)|(Sunday)), "
2727
r"((January)|(February)|(March)|(April)|(May)|(June)|"
2828
r"(July)|(August)|(September)|(October)|(November)|(December)) "
29-
r"[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2} [AP]M$"
29+
r"[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2}[AP]M$"
3030
)
3131

3232

0 commit comments

Comments
 (0)