Skip to content

Commit

Permalink
Support python 3.7 (#1)
Browse files Browse the repository at this point in the history
* add 3.7

* add python version to ci

* fix stuff
  • Loading branch information
zunda-arrow authored Sep 25, 2022
1 parent 5b41536 commit 74a366c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.8', '3.9', '3.10' ]
python-version: [ '3.7', '3.8', '3.9', '3.10' ]

name: ${{ matrix.os }}
name: ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v2
- name: Setup Python
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# sigparse

Backports python3.10 typing features into python3.8 and 3.9.
Backports python3.10 typing features into python 3.7, 3.8, and 3.9.

## Example

Expand All @@ -10,7 +10,7 @@ import sigparse
def func(param_a: list[str], param_b: str | int, param_c: tuple[int | None]):
...

# This returns the same result in python 3.8, 3.9, and 3.10!
# This returns the same result in python 3.7, 3.8, 3.9, and 3.10!
sigparse.sigparse(func)
```

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tool.poetry]
name = "sigparse"
version = "1.0.0"
description = "Backports python3.10 typing features into python3.8 and python3.9."
description = "Backports python3.10 typing features into python 3.7 and newer."
authors = ["Lunarmagpie <bambolambo0@gmail.com>"]
license = "MIT"
readme = "README.md"
Expand All @@ -11,7 +11,7 @@ homepage = "https://github.com/Lunarmagpie/sigparse"
"Bug Tracker" = "https://github.com/python-poetry/poetry/issues"

[tool.poetry.dependencies]
python = ">=3.8"
python = ">=3.7"
forbiddenfruit = "^0.1.4"

[tool.poetry.dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions sigparse/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ def has_default(self) -> bool:
"""
Return `True` if this argument has a default value.
"""
return not self.default is inspect._empty
return self.default is not inspect._empty

@property
def has_annotation(self) -> bool:
"""
Return `True` if this argument has an annotation.
"""
return not self.annotation is inspect._empty
return self.annotation is not inspect._empty


def _convert_signiture(
Expand Down

0 comments on commit 74a366c

Please sign in to comment.