From 53b31586d2069415fd8eeb592465af7dad87ec2b Mon Sep 17 00:00:00 2001 From: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> Date: Sat, 30 Nov 2024 19:53:46 -0500 Subject: [PATCH] Use hatchling --- pyproject.toml | 10 +++++----- src/fastmcp/__init__.py | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 19f04b7..31974b8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,11 +18,8 @@ license = { text = "Apache-2.0" } fastmcp = "fastmcp.cli:app" [build-system] -requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] -build-backend = "setuptools.build_meta" - -[tool.setuptools_scm] -write_to = "src/fastmcp/_version.py" +requires = ["hatchling>=1.21.0", "hatch-vcs>=0.4.0"] +build-backend = "hatchling.build" [project.optional-dependencies] dev = [ @@ -39,3 +36,6 @@ dev = [ [tool.pytest.ini_options] asyncio_mode = "auto" asyncio_default_fixture_loop_scope = "session" + +[tool.hatch.version] +source = "vcs" diff --git a/src/fastmcp/__init__.py b/src/fastmcp/__init__.py index d72096d..fdbfb9d 100644 --- a/src/fastmcp/__init__.py +++ b/src/fastmcp/__init__.py @@ -1,6 +1,8 @@ """FastMCP - A more ergonomic interface for MCP servers.""" +from importlib.metadata import version from .server import FastMCP, Context from .utilities.types import Image +__version__ = version("fastmcp") __all__ = ["FastMCP", "Context", "Image"]