Skip to content

Commit

Permalink
Moving towards pyproject.toml
Browse files Browse the repository at this point in the history
Changes regarding setting up the build configuration in pyproject.toml
file.

- Getting rid of egg build
- Updating related dependencies and stuff needed
  • Loading branch information
tbkr committed Oct 10, 2024
1 parent 834609b commit 6d34160
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 22 deletions.
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -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

Expand Down
28 changes: 6 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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())
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6d34160

Please sign in to comment.