diff --git a/pyproject.toml b/pyproject.toml index 96fa357..da0cd32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,52 @@ +[build-system] +requires = [ + "setuptools >= 61.0", +] +build-backend = "setuptools.build_meta" + +[project] +name = "pyfdb" +dynamic = ["version"] + +description="Python interface to FDB" +keywords = [ + "python", + "fdb", + "tools", +] + +license = { file = "LICENSE" } +authors = [ + { name = "European Centre for Medium-Range Weather Forecasts (ECMWF)", email = "software.support@ecmwf.int" }, +] + +urls={ "pyfdb" =} + +urls.Documentation = "https://github.com/ecmwf/pyfdb" +urls.Homepage = "https://github.com/ecmwf/pyfdb" +urls.Issues = "https://github.com/ecmwf/pyfdb/issues" +urls.Repository = "https://github.com/ecmwf/pyfdb" + +requires-python = ">=3.9" + +dependencies = [ + "cffi", + "findlibs", + "pyeccodes" +] + +optional-dependencies.tests = [ + "pytest", + "pytest-cov", + "pytest-flakes", +] + +[tool.setuptools.packages.find] +where = ["src", "tests"] + +[tool.setuptools.package-data] +pyfdb = ["processed_fdb.h"] + [tool.black] line-length = 120 diff --git a/setup.py b/setup.py index 7f1ca84..70cefcd 100644 --- a/setup.py +++ b/setup.py @@ -1,27 +1,11 @@ import io import re -from setuptools import find_packages, setup +from setuptools import setup -__version__ = re.search( - r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', io.open("pyfdb/version.py", encoding="utf_8_sig").read() -).group(1) +def find_version(): + return re.search( + r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', io.open("src/pyfdb/version.py", encoding="utf_8_sig").read() + ).group(1) -setup( - name="pyfdb", - version=__version__, - description="Python interface to FDB", - url="https://github.com/ecmwf/pyfdb", - author="ECMWF", - author_email="software.support@ecmwf.int", - packages=find_packages(exclude=("docs", "tests")), - include_package_data=True, - tests_require=[ - "pytest", - "pytest-cov", - "pytest-flakes", - ], - test_suite="tests", - install_requires=["cffi", "findlibs", "pyeccodes", "packaging"], - zip_safe=False, -) +setup( version=find_version()) diff --git a/pyfdb/__init__.py b/src/pyfdb/__init__.py similarity index 100% rename from pyfdb/__init__.py rename to src/pyfdb/__init__.py diff --git a/pyfdb/processed_fdb.h b/src/pyfdb/processed_fdb.h similarity index 100% rename from pyfdb/processed_fdb.h rename to src/pyfdb/processed_fdb.h diff --git a/pyfdb/pyfdb.py b/src/pyfdb/pyfdb.py similarity index 100% rename from pyfdb/pyfdb.py rename to src/pyfdb/pyfdb.py diff --git a/pyfdb/version.py b/src/pyfdb/version.py similarity index 100% rename from pyfdb/version.py rename to src/pyfdb/version.py