Move version to __init__.py

Setup.py does not need to be edited when building the package.
This commit is contained in:
Matt Joyce 2024-05-28 20:08:41 +10:00
parent 51b0b88cd4
commit dec225d368
2 changed files with 16 additions and 3 deletions

View File

@ -1 +1,3 @@
from .firecrawl import FirecrawlApp
__version__ = "0.0.11"

View File

@ -1,3 +1,4 @@
import re
from pathlib import Path
from setuptools import find_packages, setup
@ -5,9 +6,19 @@ from setuptools import find_packages, setup
this_directory = Path(__file__).parent
long_description_content = (this_directory / "README.md").read_text()
def get_version():
"""Dynamically set version"""
version_file = (this_directory / "firecrawl" / "__init__.py").read_text()
version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
setup(
name="firecrawl-py",
version="0.0.11",
version=get_version(),
url="https://github.com/mendableai/firecrawl",
author="Mendable.ai",
author_email="nick@mendable.ai",
@ -20,7 +31,7 @@ setup(
'pytest',
'python-dotenv',
],
python_requires='>=3.8',
python_requires=">=3.8",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
@ -41,7 +52,7 @@ setup(
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Text Processing",
"Topic :: Text Processing :: Indexing",
],
],
keywords="SDK API firecrawl",
project_urls={
"Documentation": "https://docs.firecrawl.dev",