diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..22606428 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +build-backend = "setuptools.build_meta" +requires = [ + "setuptools>=61.2", +] + +[project] +name = "lunatic-python" +version = "1.0" +description = "Two-way bridge between Python and Lua" +readme = "README.md" +license.text = "LGPL" +authors = [ + { name = "Gustavo Niemeyer", email = "gustavo@niemeyer.net" }, +] +requires-python = ">=3.10" +classifiers = [ + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +urls.Homepage = "http://labix.org/lunatic-python" + +[tool.setuptools] +include-package-data = false + +[tool.distutils] +bdist_rpm.doc-files = "python.lua LICENSE" +bdist_rpm.use-bzip2 = 2 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index bd5b5ed8..00000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[bdist_rpm] -doc_files = python.lua LICENSE -use_bzip2 = 1 diff --git a/setup.py b/setup.py index 93d6cf0f..8ab08e0e 100755 --- a/setup.py +++ b/setup.py @@ -12,9 +12,12 @@ import subprocess as commands else: import commands -from distutils.core import setup, Extension +from setuptools import setup, Extension from distutils.sysconfig import get_config_var, get_python_lib, get_python_version +if not os.environ.get("PKG_CONFIG_PATH"): # set this if needed on macOS + os.environ["PKG_CONFIG_PATH"] = get_config_var("LIBPC") + if os.path.isfile("MANIFEST"): os.unlink("MANIFEST") @@ -71,20 +74,7 @@ def pkgconfig(*packages): lua_pkgconfig = pkgconfig('lua' + LUAVERSION, 'python-' + PYTHONVERSION) lua_pkgconfig['extra_compile_args'] = ['-I/usr/include/lua'+LUAVERSION, '-DPYTHON_LIBRT="' + str(PYTHON_LIBRT) + '"'] -setup(name="lunatic-python", - version="1.0", - description="Two-way bridge between Python and Lua", - author="Gustavo Niemeyer", - author_email="gustavo@niemeyer.net", - url="http://labix.org/lunatic-python", - license="LGPL", - long_description="""\ -Lunatic Python is a two-way bridge between Python and Lua, allowing these -languages to intercommunicate. Being two-way means that it allows Lua inside -Python, Python inside Lua, Lua inside Python inside Lua, Python inside Lua -inside Python, and so on. -""", - ext_modules=[ +setup(ext_modules=[ Extension("lua-python", ["src/pythoninlua.c", "src/luainpython.c"], **lua_pkgconfig),