diff --git a/pyproject.toml b/pyproject.toml index c1b06db6c..719684bcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,62 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools >= 77.0", +] + +[project] +name = "dateparser" +description = "Date parsing library designed to parse dates from HTML pages" +authors = [ + { name = "Scrapinghub", email = "opensource@zyte.com" }, +] +license = "BSD-3-Clause" +keywords = ["dateparser"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: Implementation :: CPython", +] +requires-python = ">=3.10" +dynamic = ["readme", "version"] + +dependencies = [ + "python-dateutil>=2.7.0", + "pytz>=2024.2", + "regex>=2024.9.11", + "tzlocal>=0.2", +] + +[project.optional-dependencies] +calendars = ["convertdate>=2.2.1", "hijridate"] +fasttext = ["fasttext>=0.9.1", "numpy>=1.22.0,<2"] +langdetect = ["langdetect>=1.0.0"] + +[project.urls] +Source = "https://github.com/scrapinghub/dateparser" +History = "https://dateparser.readthedocs.io/en/latest/history.html" + +[project.scripts] +dateparser-download = "dateparser_cli.cli:entrance" + +[tool.setuptools] +include-package-data = true +zip-safe = false + +[tool.setuptools.packages.find] +namespaces = false +exclude = ["tests", "tests.*"] + +[tool.setuptools.dynamic] +version = { attr = "dateparser.__version__" } + [tool.bumpversion] current_version = "1.3.0" commit = true diff --git a/setup.py b/setup.py index 6be5d3346..127e4b533 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,6 @@ import re -from setuptools import find_packages, setup - -__version__ = re.search( - r"__version__.*\s*=\s*[\"]([^\"]+)[\"]", open("dateparser/__init__.py").read() -).group(1) +from setuptools import setup introduction = re.sub( r":members:.+|..\sautomodule::.+|:class:|:func:|:ref:", @@ -16,47 +12,5 @@ ) setup( - name="dateparser", - version=__version__, - description="Date parsing library designed to parse dates from HTML pages", long_description=introduction + "\n\n" + history, - author="Scrapinghub", - author_email="opensource@zyte.com", - url="https://github.com/scrapinghub/dateparser", - project_urls={ - "History": "https://dateparser.readthedocs.io/en/latest/history.html", - }, - packages=find_packages(exclude=("tests", "tests.*")), - include_package_data=True, - install_requires=[ - "python-dateutil>=2.7.0", - "pytz>=2024.2", - "regex>=2024.9.11", - "tzlocal>=0.2", - ], - entry_points={ - "console_scripts": ["dateparser-download = dateparser_cli.cli:entrance"], - }, - extras_require={ - "calendars": ["convertdate>=2.2.1", "hijridate"], - "fasttext": ["fasttext>=0.9.1", "numpy>=1.22.0,<2"], - "langdetect": ["langdetect>=1.0.0"], - }, - license="BSD", - zip_safe=False, - keywords="dateparser", - python_requires=">=3.10", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", - "Programming Language :: Python :: 3.14", - "Programming Language :: Python :: Implementation :: CPython", - ], )