diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..7ace5a8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,71 @@ +[build-system] +requires = ["setuptools >= 61.2.0", "wheel", "setuptools_scm[toml] >= 3.4.3"] +build-backend = "setuptools.build_meta" + +[project] +name = "parglare" +authors = [{name = "Igor R. Dejanovic", email = "igorREPLACEWITHDOTdejanovic@gmail.com"}] +license = {text = "MIT"} +description = "A pure Python Scannerless LR/GLR parser" +keywords = ["parglare"] +readme = "README.rst" +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Information Technology", + "Intended Audience :: Science/Research", + "Topic :: Software Development :: Interpreters", + "Topic :: Software Development :: Compilers", + "Topic :: Software Development :: Libraries :: Python Modules", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Operating System :: OS Independent", +] +dependencies = ["click >=7.0, <8.0"] +dynamic = ["version"] + +[project.urls] +Homepage = "https://github.com/igordejanovic/parglare" + +[project.optional-dependencies] +dev = [ + "wheel", + "mkdocs", + "mike", + "twine", +] +test = [ + "flake8", + "coverage", + "coveralls", + "pytest", +] + +[project.scripts] +pglr = "parglare.cli:pglr" + +[tool.setuptools] +packages = ["parglare", "parglare.tables"] +zip-safe = false +include-package-data = true +package-dir = {parglare = "parglare"} + +[tool.setuptools_scm] +write_to_template = "__version__ = \"{version}\"\n" +write_to = "parglare/version.py" + +[tool.distutils.bdist_wheel] +universal = 1 + +[tool.flake8] +max-line-length = "90" +exclude = """ +.git/*,.eggs/*, +parglare/six.py, +build/*,venv/*""" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index da3889b..0000000 --- a/setup.cfg +++ /dev/null @@ -1,61 +0,0 @@ -[metadata] -name = parglare -author = Igor R. Dejanovic -author_email = igorREPLACEWITHDOTdejanovic@gmail.com -license = MIT -description = A pure Python Scannerless LR/GLR parser -keywords = parglare -url = https://github.com/igordejanovic/parglare -long_description = file: README.rst -classifiers = - Development Status :: 4 - Beta - Intended Audience :: Developers - Intended Audience :: Information Technology - Intended Audience :: Science/Research - Topic :: Software Development :: Interpreters - Topic :: Software Development :: Compilers - Topic :: Software Development :: Libraries :: Python Modules - License :: OSI Approved :: MIT License - Natural Language :: English - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Operating System :: OS Independent - -[options] -packages = parglare, parglare.tables -zip_safe = False -install_requires = click >=7.0, <8.0 -include_package_data = True -package_dir = - parglare = parglare -test_suite = tests -setup_requires = setuptools_scm; - - -[options.extras_require] -dev = - wheel - mkdocs - mike - twine -test = - flake8 - coverage - coveralls - pytest - -[options.entry_points] -console_scripts = pglr = parglare.cli:pglr - -[bdist_wheel] -universal = 1 - -[flake8] -max-line-length = 90 -exclude = .git/*,.eggs/*, - parglare/six.py, - build/*,venv/* diff --git a/setup.py b/setup.py index 8a45e87..f1e4113 100644 --- a/setup.py +++ b/setup.py @@ -7,13 +7,13 @@ this_dir = Path(__file__).absolute().parent if sys.argv[-1].startswith('publish'): - if os.system("pip list | grep wheel"): + if os.system("pip3 list | grep wheel"): print("wheel not installed.\nUse `pip install wheel`.\nExiting.") sys.exit() - if os.system("pip list | grep twine"): + if os.system("pip3 list | grep twine"): print("twine not installed.\nUse `pip install twine`.\nExiting.") sys.exit() - os.system("python setup.py sdist bdist_wheel") + os.system("python3 -m pep517 -bs .") if sys.argv[-1] == 'publishtest': os.system("twine upload -r test dist/*") else: @@ -21,7 +21,4 @@ sys.exit() if __name__ == "__main__": - setup(use_scm_version={ - "write_to": str(this_dir / "parglare" / "version.py"), - "write_to_template": '__version__ = "{version}"\n', - }) + setup()