Skip to content

Commit

Permalink
Update setup.py for setuptools 69
Browse files Browse the repository at this point in the history
  • Loading branch information
aljazerzen committed Nov 24, 2023
1 parent 8e24eec commit e522fce
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 26 deletions.
4 changes: 2 additions & 2 deletions parsing/glrparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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)
Expand Down
18 changes: 17 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"]
Expand Down
23 changes: 0 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__ ="):
Expand Down Expand Up @@ -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,
Expand All @@ -118,6 +96,5 @@ def finalize_options(self) -> None:
MYPY_DEPENDENCY,
]
},
install_requires=["mypy-extensions>=1.0.0"],
cmdclass={"build_ext": build_ext},
)

0 comments on commit e522fce

Please sign in to comment.