From baf62e5ccbdeb218c34426f447b5ca22a56aaca8 Mon Sep 17 00:00:00 2001 From: Gregor Middell Date: Mon, 30 Sep 2024 14:36:35 +0200 Subject: [PATCH] Adds type information, moves metadata to pyproject.toml --- py.typed | 0 pyproject.toml | 48 +++++++++++++++++++++++++++++++++++++++++++++- setup.cfg | 42 ---------------------------------------- sfst_transduce.pyi | 19 ++++++++++++++++++ 4 files changed, 66 insertions(+), 43 deletions(-) create mode 100644 py.typed delete mode 100644 setup.cfg create mode 100644 sfst_transduce.pyi diff --git a/py.typed b/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/pyproject.toml b/pyproject.toml index 0c00742..b3911b6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,59 @@ [build-system] requires = [ - "setuptools>=42,<72.2.0", + "setuptools>=60,<72.2.0", "pybind11>=2.10.0" ] build-backend = "setuptools.build_meta" +[project] +name = "sfst-transduce" +description = "Python bindings for SFST focusing on transducer usage" +authors = [{name = "Gregor Middell", email = "gregor.middell@bbaw.de"}] +keywords = [ + "Finite-state Transducer", + "Morphological Analysis", + "Natural Language Processing", + "NLP", + "SFST", +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX :: Linux", + "Programming Language :: C++", + "Programming Language :: Python", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation", + "Programming Language :: Python :: Implementation :: CPython", + "Programming Language :: Python :: Implementation :: PyPy", + "Topic :: Education", + "Topic :: Scientific/Engineering", + "Topic :: Text Processing :: Linguistic", +] +requires-python = ">=3.8" +dynamic = ["dependencies", "version", "readme"] + +[project.urls] +Homepage = "https://github.com/zentrum-lexikographie/sfst-transduce" +Repository = "https://github.com/zentrum-lexikographie/sfst-transduce.git" + [tool.cibuildwheel] test-requires = "pytest" test-command = "pytest {project}/tests" [tool.isort] profile = "black" + +[tool.setuptools.dynamic] +version = {file = ["VERSION"]} +readme = {file = ["README.md"], content-type = "text/markdown"} + +[tool.setuptools.package-data] +sfst_transduce = ["py.typed", "sfst_transduce.pyi"] diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 7625fbe..0000000 --- a/setup.cfg +++ /dev/null @@ -1,42 +0,0 @@ -[metadata] -name = sfst-transduce -version = file: VERSION -author = Gregor Middell -author_email = gregor.middell@bbaw.de -project_urls = - Homepage = https://github.com/zentrum-lexikographie/sfst-transduce - Repository = https://github.com/zentrum-lexikographie/sfst-transduce.git -description = Python bindings for SFST focusing on transducer usage -long_description = file: README.md -long_description_content_type = text/markdown -license = GNU GPL2 -license_files = LICENSE -keywords = - Finite-state Transducer - Morphological Analysis - Natural Language Processing - NLP - SFST -classifiers = - Development Status :: 5 - Production/Stable - Intended Audience :: Developers - Intended Audience :: Science/Research - License :: OSI Approved :: GNU General Public License v2 (GPLv2) - Operating System :: MacOS - Operating System :: Microsoft :: Windows - Operating System :: POSIX :: Linux - Programming Language :: C++ - Programming Language :: Python - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: Implementation - Programming Language :: Python :: Implementation :: CPython - Programming Language :: Python :: Implementation :: PyPy - Topic :: Education - Topic :: Scientific/Engineering - Topic :: Text Processing :: Linguistic - -[options] -python_requires = >=3.8 diff --git a/sfst_transduce.pyi b/sfst_transduce.pyi new file mode 100644 index 0000000..9420dd8 --- /dev/null +++ b/sfst_transduce.pyi @@ -0,0 +1,19 @@ +from typing import List + +class Transducer: + @staticmethod + def create(filename: str) -> CompactTransducer: + pass + def analyse(self, s: str) -> List[str]: + pass + def generate(self, s: str) -> List[str]: + pass + +class CompactTransducer: + @staticmethod + def create(filename: str) -> CompactTransducer: + pass + def analyse(self, s: str) -> List[str]: + pass + def generate(self, s: str) -> List[str]: + pass