Skip to content

Commit e1b4834

Browse files
committed
improve package scaffolding
1 parent 9afba6b commit e1b4834

File tree

4 files changed

+854
-28
lines changed

4 files changed

+854
-28
lines changed

.gitignore

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
6+
# C extensions
7+
*.so
8+
9+
# Distribution / packaging
10+
.Python
11+
build/
12+
develop-eggs/
13+
dist/
14+
downloads/
15+
eggs/
16+
.eggs/
17+
lib/
18+
lib64/
19+
parts/
20+
sdist/
21+
var/
22+
wheels/
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+
# Translations
55+
*.mo
56+
*.pot
57+
58+
# Django stuff:
59+
*.log
60+
local_settings.py
61+
db.sqlite3
62+
db.sqlite3-journal
63+
64+
# Flask stuff:
65+
instance/
66+
.webassets-cache
67+
68+
# Scrapy stuff:
69+
.scrapy
70+
71+
# Sphinx documentation
72+
docs/_build/
73+
74+
# PyBuilder
75+
.pybuilder/
76+
target/
77+
78+
# Jupyter Notebook
79+
.ipynb_checkpoints
80+
81+
# IPython
82+
profile_default/
83+
ipython_config.py
84+
85+
# pyenv
86+
# For a library or package, you might want to ignore these files since the code is
87+
# intended to run in multiple environments; otherwise, check them in:
88+
.python-version
89+
90+
# pipenv
91+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
93+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
94+
# install all needed dependencies.
95+
Pipfile.lock
96+
97+
# poetry
98+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
99+
# This is especially recommended for binary packages to ensure reproducibility, and is more
100+
# commonly ignored for libraries.
101+
poetry.lock
102+
103+
# pdm
104+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
105+
.pdm.toml
106+
.pdm-python
107+
.pdm-build/
108+
109+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
110+
__pypackages__/
111+
112+
# Celery stuff
113+
celerybeat-schedule
114+
celerybeat.pid
115+
116+
# SageMath parsed files
117+
*.sage.py
118+
119+
# Environments
120+
.env
121+
.venv
122+
env/
123+
venv/
124+
ENV/
125+
env.bak/
126+
venv.bak/
127+
128+
# Spyder project settings
129+
.spyderproject
130+
.spyproject
131+
132+
# Rope project settings
133+
.ropeproject
134+
135+
# mkdocs documentation
136+
/site
137+
138+
# mypy
139+
.mypy_cache/
140+
.dmypy.json
141+
dmypy.json
142+
143+
# Pyre type checker
144+
.pyre/
145+
146+
# pytype static type analyzer
147+
.pytype/
148+
149+
# Cython debug symbols
150+
cython_debug/
151+
152+
# PyCharm
153+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
154+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
155+
# and can be added to the global gitignore or merged into this file.
156+
.idea/
157+
*.iml
158+
*.iws
159+
*.ipr
160+
*.iws
161+
.idea_modules/
162+
163+
# VSCode
164+
.vscode/
165+
166+
# Ruff linter
167+
.ruff_cache/
168+
169+
# Mac/OSX
170+
.DS_Store
171+
172+
# Windows
173+
Thumbs.db
174+
ehthumbs.db
175+
Desktop.ini
176+
177+
# Repomix output
178+
repomix-output.txt

pyproject.toml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["hatchling"]
2+
requires = ["hatchling", "tomli"]
33
build-backend = "hatchling.build"
44

55
[project]
@@ -34,6 +34,7 @@ dependencies = [
3434
"uvicorn>=0.20.0",
3535
"requests>=2.25.0",
3636
"inspect-mate>=0.0.2",
37+
"tomli>=2.2.1",
3738
]
3839

3940
[project.urls]
@@ -45,25 +46,18 @@ Documentation = "https://github.com/tadata-org/fastapi_mcp#readme"
4546
"Changelog" = "https://github.com/tadata-org/fastapi_mcp/blob/main/CHANGELOG.md"
4647

4748
[project.optional-dependencies]
48-
dev = [
49-
"pytest>=7.0.0",
50-
"black>=23.0.0",
51-
"isort>=5.0.0",
52-
"mypy>=1.0.0",
53-
"ruff>=0.1.0",
54-
]
49+
dev = []
5550

5651
[project.scripts]
5752
fastapi-mcp = "fastapi_mcp.cli:app"
5853

59-
[tool.black]
60-
line-length = 100
61-
target-version = ["py310"]
62-
63-
[tool.isort]
64-
profile = "black"
65-
line_length = 100
66-
6754
[tool.ruff]
68-
line-length = 100
55+
line-length = 120
6956
target-version = "py310"
57+
58+
[dependency-groups]
59+
dev = [
60+
"mypy>=1.15.0",
61+
"ruff>=0.9.10",
62+
"types-setuptools>=75.8.2.20250305",
63+
]

setup.py

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
from setuptools import setup
2+
import tomli
3+
4+
# Read dependencies from pyproject.toml
5+
with open("pyproject.toml", "rb") as f:
6+
pyproject_data = tomli.load(f)
7+
8+
# Get dependencies from pyproject.toml
9+
dependencies = pyproject_data["project"]["dependencies"]
210

311
setup(
412
name="fastapi-mcp",
@@ -8,16 +16,7 @@
816
author_email="[email protected]",
917
packages=["fastapi_mcp"],
1018
python_requires=">=3.10",
11-
install_requires=[
12-
"fastapi>=0.100.0",
13-
"typer>=0.9.0",
14-
"rich>=13.0.0",
15-
"mcp>=1.3.0",
16-
"pydantic>=2.0.0",
17-
"uvicorn>=0.20.0",
18-
"requests>=2.25.0",
19-
"inspect-mate>=0.0.2",
20-
],
19+
install_requires=dependencies,
2120
entry_points={
2221
"console_scripts": [
2322
"fastapi-mcp=fastapi_mcp.cli:app",
@@ -44,4 +43,4 @@
4443
"Source Code": "https://github.com/tadata-org/fastapi_mcp",
4544
"Changelog": "https://github.com/tadata-org/fastapi_mcp/blob/main/CHANGELOG.md",
4645
},
47-
)
46+
)

0 commit comments

Comments
 (0)