-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from awtkns/126_py_typed
⚗️ Add py.typed file
- Loading branch information
Showing
3 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import pathlib | ||
|
||
file = pathlib.Path(__file__) | ||
root_dir = file.parent.parent.parent | ||
package_src = root_dir / "fastapi_crudrouter" | ||
|
||
|
||
def test_py_typed_file_exists(): | ||
assert (package_src / "py.typed").exists() | ||
assert (package_src / "py.typed").is_file() | ||
|
||
|
||
def test_virtualenv(virtualenv): | ||
assert (root_dir).exists() | ||
assert (root_dir / "setup.py").exists() | ||
|
||
virtualenv.run(f"pip install -e {root_dir}") | ||
virtualenv.run(f"pip install mypy") | ||
virtualenv.run(f"mypy {file}") | ||
|
||
|
||
if __name__ == "__main__": | ||
from pydantic import BaseModel | ||
from fastapi import FastAPI | ||
|
||
import fastapi_crudrouter | ||
|
||
class User(BaseModel): | ||
id: int | ||
name: str | ||
email: str | ||
|
||
router = fastapi_crudrouter.MemoryCRUDRouter(schema=User) | ||
app = FastAPI() | ||
app.include_router(router) |
920ab61
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: