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 11, 2024
1 parent f0686ad commit 6a09263
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 29 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in

This file was deleted.

54 changes: 54 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,60 @@
[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.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",
"isort",
"black",
"flake8",
"tox>=4.19"
]

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

[tool.isort]
profile = "black"
line_length = 120
skip_glob=".*"
skip = ["setup.py"]
src_paths = ["src", "tests"]
30 changes: 8 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,13 @@
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)

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,
)
def find_version():
return re.search(
r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', io.open("src/pyfdb/version.py", encoding="utf_8_sig").read()
).group(1)


setup(version=find_version())
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 3 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# Those are only in here because they aren't support pyproject.toml file...
[flake8]
max-line-length = 120
show-source = true
exclude = .*
extend-ignore = E203
per-file-ignores =
*/__init__.py: F401,F403
[isort]
profile=black
skip_glob=.*

[tox]
env_list =
Expand All @@ -20,8 +18,7 @@ package = wheel
wheel_build_env = .pkg
deps =
pytest>=6
setenv =
; NB: You may need to copy build/fdb5/etc/fdb to build/etc/fdb
FDB5_HOME=../build/
pass_env =
FDB_HOME
commands =
pytest {tty:--color=yes} {posargs}

0 comments on commit 6a09263

Please sign in to comment.