From e522fceb68d07ea55708b2e9dd4988d258e6e525 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Fri, 24 Nov 2023 15:03:40 +0100 Subject: [PATCH] Update setup.py for setuptools 69 --- parsing/glrparser.py | 4 ++-- pyproject.toml | 18 +++++++++++++++++- setup.py | 23 ----------------------- 3 files changed, 19 insertions(+), 26 deletions(-) diff --git a/parsing/glrparser.py b/parsing/glrparser.py index 3cda854..00da41a 100644 --- a/parsing/glrparser.py +++ b/parsing/glrparser.py @@ -127,7 +127,7 @@ def token(self, token: Token) -> None: tokenSpec = self._spec.sym_spec(token) self._act(token, tokenSpec) # type: ignore if len(self._gss) == 0: - raise UnexpectedToken("Unexpected token: %r" % token) + raise UnexpectedToken(f"Unexpected token: {token:r}") def eoi(self) -> None: """ @@ -141,7 +141,7 @@ def eoi(self) -> None: for path in top.paths(): assert len(path) == 5 if self.verbose: - print(" --> accept %r" % path) + print(f" --> accept {path:r}") edge = path[1] assert isinstance(edge, Gsse) assert isinstance(edge.value, Nonterm) diff --git a/pyproject.toml b/pyproject.toml index 1d5d465..f74994d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,24 @@ [project] name = "parsing" -description = "LR(1) parser generator for Python" +description = "LR(1) parser generator for Python and CFSM and GLR parser drivers" requires-python = ">=3.7.0" dynamic = ["version"] +license = { file = "" } +authors = [{ name = "Jason Evans", email = "jasone@canonware.com" }] +readme = { file = "README.rst", content-type = "text/x-rst" } +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3', + 'Topic :: Software Development :: Compilers', + 'Topic :: Text Processing :: General', +] +dependencies = ['mypy-extensions>=1.0.0'] + +[project.optional-dependencies] +test = ['flake8', 'mypy>=1.4.1'] [build-system] requires = ["setuptools>=42", "wheel"] diff --git a/setup.py b/setup.py index d22ed29..c2c0522 100644 --- a/setup.py +++ b/setup.py @@ -10,10 +10,6 @@ _ROOT = pathlib.Path(__file__).parent -with open(str(_ROOT / "README.rst")) as f: - readme = f.read() - - with open(str(_ROOT / "parsing" / "_version.py")) as f: for line in f: if line.startswith("__version__ ="): @@ -88,26 +84,8 @@ def finalize_options(self) -> None: setup( - name="parsing", version=VERSION, python_requires=">=3.7.0", - url="http://www.canonware.com/Parsing/", - license="MIT", - author="Jason Evans", - author_email="jasone@canonware.com", - description="A pure-Python module that implements an LR(1) " - "parser generator, as well as CFSM and GLR parser drivers.", - long_description=readme, - long_description_content_type="text/x-rst", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3", - "Topic :: Software Development :: Compilers", - "Topic :: Text Processing :: General", - ], packages=["parsing", "parsing.tests", "parsing.tests.specs"], package_data={"parsing": ["py.typed"]}, setup_requires=setup_requires, @@ -118,6 +96,5 @@ def finalize_options(self) -> None: MYPY_DEPENDENCY, ] }, - install_requires=["mypy-extensions>=1.0.0"], cmdclass={"build_ext": build_ext}, )