-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: configure mypy Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * fix: type errors Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * docs: sort imports of README.md Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * ci(gha): add ci Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * ci(gha): add release Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * build: install fastapi on dev Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * build: exclude py3.8 Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * fix: replace BaseModel with pydantic dataclass Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * build: specify minimum version of fastapi Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * Revert "build: exclude py3.8" This reverts commit a12f5ac. * ci(gha): build Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * Reapply "build: exclude py3.8" This reverts commit 55eb498. * Revert "fix: replace BaseModel with pydantic dataclass" This reverts commit 8142c80. * ci(gha): fix build Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * ci(gha): fix build Signed-off-by: Isac Byeonghoon Yoo <[email protected]> * ci(gha): skip existing versions on publish Signed-off-by: Isac Byeonghoon Yoo <[email protected]> --------- Signed-off-by: Isac Byeonghoon Yoo <[email protected]>
- Loading branch information
Showing
5 changed files
with
110 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
pyver: ["3.9", "3.10", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "${{ matrix.pyver }}" | ||
cache: pip | ||
- name: Install dependencies | ||
# language=Bash | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -e '.[dev]' | ||
- name: Test with pytest | ||
# language=Bash | ||
run: | | ||
pytest | ||
- name: Lint | ||
# language=Bash | ||
run: | | ||
ruff check --show-fixes --show-source | ||
mypy -p plugbear | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Build | ||
# language=Bash | ||
run: | | ||
python -m pip install --upgrade pip build | ||
python -m build . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
pypi-publish: | ||
runs-on: ubuntu-latest | ||
environment: release | ||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- name: Build | ||
# language=Bash | ||
run: | | ||
pip install -U build | ||
python -m build . | ||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
skip-existing: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,13 @@ name = "plugbear" | |
authors = [{name = "Runbear", email = "[email protected]"}] | ||
readme = "README.md" | ||
dynamic = ["version", "description"] | ||
requires-python = ">=3.8" | ||
requires-python = ">=3.9" | ||
classifiers = [ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
|
@@ -31,16 +30,17 @@ Home = "https://plugbear.io/" | |
Source = "https://github.com/runbear-io/plugbear-python-sdk" | ||
|
||
[project.optional-dependencies] | ||
fastapi = ["fastapi"] | ||
fastapi = ["fastapi>=0.51.0"] | ||
|
||
dev = ["plugbear[test]", "plugbear[lint]"] | ||
dev = ["plugbear[test]", "plugbear[lint]", "plugbear[fastapi]"] | ||
test = [ | ||
"pytest~=7.4", | ||
"pytest-asyncio~=0.23", | ||
"httpx", # for fastapi.testclient | ||
] | ||
lint = [ | ||
"ruff~=0.1", | ||
"mypy~=1.7", | ||
] | ||
|
||
|
||
|
@@ -50,7 +50,7 @@ asyncio_mode = "auto" | |
|
||
[tool.ruff] | ||
line-length = 120 | ||
target-version = "py38" | ||
target-version = "py39" | ||
|
||
[tool.ruff.format] | ||
# Like Black, use double quotes for strings. | ||
|
@@ -60,4 +60,31 @@ indent-style = "space" | |
# Like Black, respect magic trailing commas. | ||
skip-magic-trailing-comma = false | ||
# Like Black, automatically detect the appropriate line ending. | ||
line-ending = "auto" | ||
line-ending = "auto" | ||
|
||
|
||
[tool.mypy] | ||
python_version = "3.9" | ||
allow_redefinition = true | ||
disallow_incomplete_defs = true | ||
disallow_untyped_calls = true | ||
disallow_untyped_decorators = true | ||
disallow_untyped_defs = true | ||
no_implicit_optional = true | ||
no_implicit_reexport = true | ||
no_warn_no_return = true | ||
strict_equality = true | ||
warn_redundant_casts = true | ||
warn_return_any = true | ||
warn_unreachable = true | ||
warn_unused_ignores = true | ||
|
||
pretty = true | ||
show_column_numbers = true | ||
show_error_codes = true | ||
show_error_context = true | ||
|
||
# Plugins | ||
plugins = [ | ||
"pydantic.mypy", | ||
] |