Skip to content

Commit

Permalink
fix: support Python 3.11 (#316)
Browse files Browse the repository at this point in the history
* fix: support Python 3.11

* chore: fix tests
  • Loading branch information
Deuchnord committed Apr 12, 2023
1 parent 4fcd15c commit 209aab0
Show file tree
Hide file tree
Showing 8 changed files with 267 additions and 288 deletions.
8 changes: 4 additions & 4 deletions kosmorro/locales/messages.pot
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Translations template for PROJECT.
# Copyright (C) 2022 ORGANIZATION
# Copyright (C) 2023 ORGANIZATION
# This file is distributed under the same license as the PROJECT project.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2022.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2023.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2022-07-07 13:10+0200\n"
"POT-Creation-Date: 2023-04-12 16:15+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.10.3\n"
"Generated-By: Babel 2.12.1\n"

#: kosmorro/__main__.py:61
msgid ""
Expand Down
499 changes: 240 additions & 259 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ include = [
kosmorro = 'kosmorro.__main__:main'

[tool.poetry.dependencies]
python = ">=3.8,<3.11"
python = ">=3.8,<3.12"
tabulate = ">=0.8,<0.10"
termcolor = ">=1.1,<3.0"
kosmorrolib = "^1.0"
Expand Down
4 changes: 2 additions & 2 deletions tests/dates.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ def test_with_date():
== """Monday, January 27, 2020
Moon phase: New Moon
First Quarter on Sunday, February 2, 2020 at 1:41 AM
First Quarter on Sunday, February 2, 2020 at 1:41AM
Expected events:
8:00 PM Venus and Neptune are in conjunction
8:00PM Venus and Neptune are in conjunction
Note: All the hours are given in UTC.
"""
Expand Down
8 changes: 3 additions & 5 deletions tests/general.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3

from sys import version_info
from sys import version_info as python_version
from .utils import (
execute,
KOSMORRO,
Expand All @@ -19,7 +19,7 @@ def test_run_without_argument():
print(stdout)

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


def test_help_message():
python_version = (version_info.major, version_info.minor)

for arg in ["--help", "-h"]:
result = execute(KOSMORRO + [arg])
assert result.is_successful()

# Options header has changed from "optional arguments" to "options" in Python 3.10.
options_header = (
"options" if python_version == (3, 10) else "optional arguments"
"optional arguments" if python_version.minor < 10 else "options"
)

assert (
Expand Down
24 changes: 12 additions & 12 deletions tests/position.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ def check_command_return(result):
Object Rise time Culmination time Set time
-------- ----------- ------------------ ----------
Sun 7:31 AM 12:01 PM 4:30 PM
Moon 9:06 AM 2:09 PM 7:13 PM
Mercury 8:10 AM 12:49 PM 5:28 PM
Venus 9:01 AM 2:35 PM 8:10 PM
Mars 4:19 AM 8:23 AM 12:28 PM
Jupiter 6:15 AM 10:18 AM 2:21 PM
Saturn 6:56 AM 11:09 AM 3:22 PM
Uranus 10:21 AM 5:25 PM 12:33 AM
Neptune 9:01 AM 2:36 PM 8:10 PM
Pluto 6:57 AM 11:04 AM 3:11 PM
Sun 7:31AM 12:01PM 4:30PM
Moon 9:06AM 2:09PM 7:13PM
Mercury 8:10AM 12:49PM 5:28PM
Venus 9:01AM 2:35PM 8:10PM
Mars 4:19AM 8:23AM 12:28PM
Jupiter 6:15AM 10:18AM 2:21PM
Saturn 6:56AM 11:09AM 3:22PM
Uranus 10:21AM 5:25PM 12:33AM
Neptune 9:01AM 2:36PM 8:10PM
Pluto 6:57AM 11:04AM 3:11PM
Moon phase: New Moon
First Quarter on Sunday, February 2, 2020 at 1:41 AM
First Quarter on Sunday, February 2, 2020 at 1:41AM
Expected events:
8:00 PM Venus and Neptune are in conjunction
8:00PM Venus and Neptune are in conjunction
Note: All the hours are given in UTC.
"""
Expand Down
8 changes: 4 additions & 4 deletions tests/timezone.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ def check_command_return_t_plus_one(result):
== """Monday, January 27, 2020
Moon phase: New Moon
First Quarter on Sunday, February 2, 2020 at 2:41 AM
First Quarter on Sunday, February 2, 2020 at 2:41AM
Expected events:
9:00 PM Venus and Neptune are in conjunction
9:00PM Venus and Neptune are in conjunction
Note: All the hours are given in the UTC+1 timezone.
"""
Expand All @@ -30,10 +30,10 @@ def check_command_return_t_minus_one(result):
== """Monday, January 27, 2020
Moon phase: New Moon
First Quarter on Sunday, February 2, 2020 at 12:41 AM
First Quarter on Sunday, February 2, 2020 at 12:41AM
Expected events:
7:00 PM Venus and Neptune are in conjunction
7:00PM Venus and Neptune are in conjunction
Note: All the hours are given in the UTC-1 timezone.
"""
Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
r"on ((Monday)|(Tuesday)|(Wednesday)|(Thursday)|(Friday)|(Saturday)|(Sunday)), "
r"((January)|(February)|(March)|(April)|(May)|(June)|"
r"(July)|(August)|(September)|(October)|(November)|(December)) "
r"[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2} [AP]M$"
r"[0-9]{1,2}, [0-9]{4} at [0-9]{1,2}:[0-9]{2}[AP]M$"
)


Expand Down

0 comments on commit 209aab0

Please sign in to comment.