Skip to content

Commit 691f7d2

Browse files
Initial commit for fastapi new command
1 parent 92ceb2d commit 691f7d2

File tree

10 files changed

+1558
-8
lines changed

10 files changed

+1558
-8
lines changed

.gitignore

Lines changed: 107 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,114 @@
1-
# Python-generated files
1+
# Byte-compiled / optimized / DLL files
22
__pycache__/
3-
*.py[oc]
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
411
build/
12+
develop-eggs/
513
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
622
wheels/
7-
*.egg-info
23+
share/python-wheels/
24+
*.egg-info/
25+
.installed.cfg
26+
*.egg
27+
MANIFEST
28+
29+
# PyInstaller
30+
# Usually these files are written by a python script from a template
31+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
32+
*.manifest
33+
*.spec
34+
35+
# Installer logs
36+
pip-log.txt
37+
pip-delete-this-directory.txt
38+
39+
# Unit test / coverage reports
40+
htmlcov/
41+
.tox/
42+
.nox/
43+
.coverage
44+
.coverage.*
45+
.cache
46+
nosetests.xml
47+
coverage.xml
48+
*.cover
49+
*.py,cover
50+
.hypothesis/
51+
.pytest_cache/
52+
cover/
53+
54+
# pyenv
55+
# For a library or package, you might want to ignore these files since the code is
56+
# intended to run in multiple environments; otherwise, check them in:
57+
# .python-version
58+
59+
# pipenv
60+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
61+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
62+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
63+
# install all needed dependencies.
64+
#Pipfile.lock
865

9-
# Virtual environments
66+
# poetry
67+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
68+
# This is especially recommended for binary packages to ensure reproducibility, and is more
69+
# commonly ignored for libraries.
70+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
71+
#poetry.lock
72+
73+
# pdm
74+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
75+
#pdm.lock
76+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
77+
# in version control.
78+
# https://pdm-project.org/#use-with-ide
79+
.pdm.toml
80+
.pdm-python
81+
.pdm-build/
82+
83+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
84+
__pypackages__/
85+
86+
# Environments
87+
.env
1088
.venv
89+
env/
90+
venv/
91+
ENV/
92+
env.bak/
93+
venv.bak/
94+
95+
# mypy
96+
.mypy_cache/
97+
.dmypy.json
98+
dmypy.json
99+
100+
# Pyre type checker
101+
.pyre/
102+
103+
# pytype static type analyzer
104+
.pytype/
105+
106+
# Cython debug symbols
107+
cython_debug/
11108

12-
# Coverage
13-
htmlcov
14-
.coverage*
109+
# PyCharm
110+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
111+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
112+
# and can be added to the global gitignore or merged into this file. For a more nuclear
113+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
114+
#.idea/

pyproject.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,24 @@ classifiers = [
3030
"Programming Language :: Python :: 3.13",
3131
"Programming Language :: Python :: 3.14",
3232
]
33-
dependencies = []
33+
dependencies = [
34+
"typer>=0.12.0",
35+
"rich>=13.0.0",
36+
"typing-extensions>=4.8.0",
37+
"rich-toolkit>=0.15.1",
38+
]
39+
40+
[project.optional-dependencies]
41+
dev = [
42+
"pytest>=8.0.0",
43+
"coverage[toml]>=7.0.0",
44+
"mypy>=1.8.0",
45+
"ruff>=0.3.0",
46+
]
47+
48+
[project.scripts]
49+
fastapi-new = "fastapi_new.cli:main"
50+
3451
[project.urls]
3552
Homepage = "https://github.com/fastapi/fastapi-new"
3653
Documentation = "https://github.com/fastapi/fastapi-new"

src/fastapi_new/__main__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .cli import main
2+
3+
main()

src/fastapi_new/cli.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import typer
2+
3+
from fastapi_new.new import new as new_command
4+
5+
app = typer.Typer(rich_markup_mode="rich")
6+
7+
app.command(
8+
context_settings={"allow_extra_args": True, "ignore_unknown_options": True}
9+
)(new_command)
10+
11+
12+
def main() -> None:
13+
app()

src/fastapi_new/main.py

Whitespace-only changes.

0 commit comments

Comments
 (0)