diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..3b8bc14 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,31 @@ +# References: +# https://packaging.python.org/en/latest/specifications/declaring-project-metadata/ +# https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#native-namespace-packages +# https://packaging.python.org/en/latest/guides/single-sourcing-package-version/ +# https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "freecad.workbench_starterkit" +dynamic = ["version"] +description = "template for a freecad extensions, installable with pip" +readme = "README.md" +license = {file = "LICENSE"} +maintainers = [ + {name = "looooo", email = "sppedflyer@gmail.com"}, +] +requires-python = ">=3.8" +dependencies = ["numpy"] + +[project.urls] +source = "https://github.com/FreeCAD/freecad.workbench_starterkit" + +[tool.setuptools] +packages = ["freecad", "freecad.workbench_starterkit"] +include-package-data = true + +[tool.setuptools.dynamic] +version = {attr = "freecad.workbench_starterkit.__version__"} diff --git a/setup.py b/setup.py index 11fffc0..2dde8b2 100644 --- a/setup.py +++ b/setup.py @@ -1,21 +1,12 @@ -from setuptools import setup -import os -# from freecad.workbench_starterkit.version import __version__ -# name: this is the name of the distribution. -# Packages using the same name here cannot be installed together +""" +We keep this file to support legacy builds and editable installs, +while keeping all configuration in pyproject.toml + +References: -version_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), - "freecad", "workbench_starterkit", "version.py") -with open(version_path) as fp: - exec(fp.read()) + https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html +""" + +from setuptools import setup -setup(name='freecad.workbench_starterkit', - version=str(__version__), - packages=['freecad', - 'freecad.workbench_starterkit'], - maintainer="looooo", - maintainer_email="sppedflyer@gmail.com", - url="https://github.com/FreeCAD/Workbench-Starterkit", - description="template for a freecad extensions, installable with pip", - install_requires=['numpy'], # should be satisfied by FreeCAD's system dependencies already - include_package_data=True) +setup()