From dd71d70882791127d381cf85a952de362d74f5c5 Mon Sep 17 00:00:00 2001 From: David Beazley Date: Tue, 6 Sep 2022 20:15:16 -0500 Subject: [PATCH] Packaging reorganization --- CHANGES | 3 +++ LICENSE | 2 +- MANIFEST.in | 1 + pyproject.toml | 3 +++ setup.cfg | 38 ++++++++++++++++++++++++++++++++++++ setup.py | 28 -------------------------- {sly => src/sly}/__init__.py | 2 +- {sly => src/sly}/ast.py | 0 {sly => src/sly}/docparse.py | 0 {sly => src/sly}/lex.py | 0 {sly => src/sly}/yacc.py | 0 11 files changed, 47 insertions(+), 30 deletions(-) create mode 100644 pyproject.toml create mode 100644 setup.cfg delete mode 100755 setup.py rename {sly => src/sly}/__init__.py (80%) rename {sly => src/sly}/ast.py (100%) rename {sly => src/sly}/docparse.py (100%) rename {sly => src/sly}/lex.py (100%) rename {sly => src/sly}/yacc.py (100%) diff --git a/CHANGES b/CHANGES index 66522c8..ae8ad0d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ In Progress ----------- +09/06/2022 Modernization of the packaging infrastructure. Slight + project reorganization. + 03/25/2022 Added automatic location tracking to the parser. Use Parser.line_position(value) to return the line number and Parser.index_position(value) to return a (start, end) diff --git a/LICENSE b/LICENSE index 0a97db2..1db3028 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ SLY (Sly Lex-Yacc) -Copyright (C) 2016-2019 +Copyright (C) 2016-2022 David M. Beazley (Dabeaz LLC) All rights reserved. diff --git a/MANIFEST.in b/MANIFEST.in index f2a05e6..fa29454 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,2 +1,3 @@ recursive-include example * +recursive-include test * recursive-include docs * diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9787c3b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..2d65589 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,38 @@ +[metadata] +name = sly +version = 0.5 +url = https://github.com/dabeaz/sly +author = David Beazley +author_email = "David Beazley" +description = "SLY - Sly Lex Yacc" +long_description = "SLY is an implementation of lex and yacc" +license = MIT +license_files = LICENSE +classifiers = + License :: OSI Approved :: MIT License + +[options] +package_dir = + =src + +packages = find: + +[options.packages.find] +where = src + +[tool.pytest] +testpaths = test + +[coverage:run] +branch = True + +[tox:tox] +isolated_build = True +envlist = py311,py310,py39 + +[testenv] +deps = + pytest + pytest-cov + +commands = pytest {posargs} diff --git a/setup.py b/setup.py deleted file mode 100755 index dc9d05b..0000000 --- a/setup.py +++ /dev/null @@ -1,28 +0,0 @@ -try: - from setuptools import setup -except ImportError: - from distutils.core import setup - -tests_require = ['pytest', 'regex'] - -setup(name = "sly", - description="SLY - Sly Lex Yacc", - long_description = """ -SLY is an implementation of lex and yacc for Python 3. -""", - license="""BSD""", - version = "0.4", - author = "David Beazley", - author_email = "dave@dabeaz.com", - maintainer = "David Beazley", - maintainer_email = "dave@dabeaz.com", - url = "https://github.com/dabeaz/sly", - packages = ['sly'], - tests_require = tests_require, - extras_require = { - 'test': tests_require, - }, - classifiers = [ - 'Programming Language :: Python :: 3', - ] - ) diff --git a/sly/__init__.py b/src/sly/__init__.py similarity index 80% rename from sly/__init__.py rename to src/sly/__init__.py index 3c1e708..8a62454 100644 --- a/sly/__init__.py +++ b/src/sly/__init__.py @@ -2,5 +2,5 @@ from .lex import * from .yacc import * -__version__ = "0.4" +__version__ = "0.5" __all__ = [ *lex.__all__, *yacc.__all__ ] diff --git a/sly/ast.py b/src/sly/ast.py similarity index 100% rename from sly/ast.py rename to src/sly/ast.py diff --git a/sly/docparse.py b/src/sly/docparse.py similarity index 100% rename from sly/docparse.py rename to src/sly/docparse.py diff --git a/sly/lex.py b/src/sly/lex.py similarity index 100% rename from sly/lex.py rename to src/sly/lex.py diff --git a/sly/yacc.py b/src/sly/yacc.py similarity index 100% rename from sly/yacc.py rename to src/sly/yacc.py