Skip to content

Commit

Permalink
Merge pull request #7 from m-aciek/3.7-support
Browse files Browse the repository at this point in the history
Add support for Python 3.7+
  • Loading branch information
glyph authored Feb 8, 2024
2 parents 0ff0749 + 6e43328 commit b993060
Show file tree
Hide file tree
Showing 5 changed files with 201 additions and 229 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ on:
branches:
- trunk

workflow_dispatch:

jobs:
build:
name: ${{ matrix.TOX_ENV }}
name: ${{ matrix.TOX_ENV }} ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.10"]
TOX_ENV: ["lint", "py310", "mypy"]
python: ["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"]
TOX_ENV: ["lint", "py", "mypy"]
exclude:
- TOX_ENV: "lint"
include:
- TOX_ENV: "lint"
python: "3.12"

steps:
- uses: actions/checkout@v3
Expand Down
32 changes: 32 additions & 0 deletions expected_mypy_37.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
tryit.py:21: error: Unsupported operand types for < ("NaiveDateTime" and "AwareDateTime") [operator]
tryit.py:21: note: Following member(s) of "AwareDateTime" have conflicts:
tryit.py:21: note: Expected:
tryit.py:21: note: def timetz(self) -> Time[None]
tryit.py:21: note: Got:
tryit.py:21: note: def timetz(self) -> Time[tzinfo]
tryit.py:21: note: tzinfo: expected "None", got "tzinfo"
tryit.py:23: error: Incompatible types in assignment (expression has type "AwareDateTime", variable has type "NaiveDateTime") [assignment]
tryit.py:23: note: Following member(s) of "AwareDateTime" have conflicts:
tryit.py:23: note: Expected:
tryit.py:23: note: def timetz(self) -> Time[None]
tryit.py:23: note: Got:
tryit.py:23: note: def timetz(self) -> Time[tzinfo]
tryit.py:23: note: tzinfo: expected "None", got "tzinfo"
tryit.py:26: error: Incompatible types in assignment (expression has type "NaiveDateTime", variable has type "AwareDateTime") [assignment]
tryit.py:26: note: Following member(s) of "NaiveDateTime" have conflicts:
tryit.py:26: note: Expected:
tryit.py:26: note: def timetz(self) -> Time[tzinfo]
tryit.py:26: note: Got:
tryit.py:26: note: def timetz(self) -> Time[None]
tryit.py:26: note: tzinfo: expected "tzinfo", got "None"
tryit.py:34: error: Incompatible types in assignment (expression has type "NaiveDateTime", variable has type "Date") [assignment]
tryit.py:35: error: Incompatible types in assignment (expression has type "AwareDateTime", variable has type "Date") [assignment]
tryit.py:48: error: "tzinfo" has no attribute "key" [attr-defined]
tryit.py:53: error: Incompatible types in assignment (expression has type "DateTime[timezone]", variable has type "NaiveDateTime") [assignment]
tryit.py:53: note: Following member(s) of "DateTime[timezone]" have conflicts:
tryit.py:53: note: Expected:
tryit.py:53: note: def timetz(self) -> Time[None]
tryit.py:53: note: Got:
tryit.py:53: note: def timetz(self) -> Time[timezone]
tryit.py:53: note: tzinfo: expected "None", got "timezone"
Found 7 errors in 1 file (checked 1 source file)
7 changes: 6 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "A type wrapper for the standard library `datetime` that supplies
readme = "README.md"
# Maybe we can support earlier versions, but I haven't tested yet so let's
# start off cautious.
requires-python = ">=3.10"
requires-python = ">=3.7"
# This file is derived directly from typeshed's `datetime.pyi`, so it's the
# typeshed license.
license = {file = "LICENSE.txt"}
Expand All @@ -16,7 +16,12 @@ classifiers = [
"Development Status :: 3 - Alpha",
# Indicate who your project is intended for
"Intended Audience :: Developers",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.7",
]

[build-system]
Expand Down
Loading

0 comments on commit b993060

Please sign in to comment.