From 2eb53ac7caa5adf52aa7bae9e205d93d1a11c534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Tue, 18 Apr 2023 13:25:21 +0200 Subject: [PATCH] Migrate `kedro-airflow` to static metadata (#172) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Migrate kedro-airflow to static metadata See https://github.com/kedro-org/kedro/issues/2334. Signed-off-by: Juan Luis Cano Rodríguez * Add explicit PEP 518 build requirements for kedro-datasets Signed-off-by: Juan Luis Cano Rodríguez * Typos Co-authored-by: Merel Theisen <49397448+merelcht@users.noreply.github.com> Signed-off-by: Juan Luis Cano Rodríguez * Remove dangling reference to requirements.txt Signed-off-by: Juan Luis Cano Rodríguez * Add release notes Signed-off-by: Juan Luis Cano Rodríguez --------- Signed-off-by: Juan Luis Cano Rodríguez Signed-off-by: Danny Farah --- kedro-airflow/MANIFEST.in | 1 - kedro-airflow/RELEASE.md | 1 + kedro-airflow/pyproject.toml | 48 +++++++++++++++++++++++++++++ kedro-airflow/requirements.txt | 3 -- kedro-airflow/setup.cfg | 10 ------ kedro-airflow/setup.py | 41 ------------------------ kedro-airflow/test_requirements.txt | 1 - kedro-datasets/pyproject.toml | 4 +++ 8 files changed, 53 insertions(+), 56 deletions(-) delete mode 100644 kedro-airflow/requirements.txt delete mode 100644 kedro-airflow/setup.cfg delete mode 100644 kedro-airflow/setup.py diff --git a/kedro-airflow/MANIFEST.in b/kedro-airflow/MANIFEST.in index 523166e84..ed984822f 100644 --- a/kedro-airflow/MANIFEST.in +++ b/kedro-airflow/MANIFEST.in @@ -1,4 +1,3 @@ include README.md include LICENSE.md -include requirements.txt include kedro_airflow/airflow_dag_template.j2 diff --git a/kedro-airflow/RELEASE.md b/kedro-airflow/RELEASE.md index 75e4654e6..c2e0615b4 100755 --- a/kedro-airflow/RELEASE.md +++ b/kedro-airflow/RELEASE.md @@ -1,5 +1,6 @@ # Upcoming release 0.5.2 * Change reference to `kedro.pipeline.Pipeline` object throughout test suite with `kedro.modular_pipeline.pipeline` factory. +* Migrate all project metadata to static `pyproject.toml`. # Release 0.5.1 * Added additional CLI argument `--jinja-file` to provide a path to a custom Jinja2 template. diff --git a/kedro-airflow/pyproject.toml b/kedro-airflow/pyproject.toml index 4f3292f55..42fe8974b 100644 --- a/kedro-airflow/pyproject.toml +++ b/kedro-airflow/pyproject.toml @@ -1,3 +1,51 @@ +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + +[project] +name = "kedro-airflow" +authors = [ + {name = "Kedro"} +] +description = "Kedro-Airflow makes it easy to deploy Kedro projects to Airflow" +requires-python = ">=3.7, <3.11" +license = {text = "Apache Software License (Apache 2.0)"} +dependencies = [ + "kedro>=0.17.5", + "python-slugify>=4.0", + "semver~=2.10", # Needs to be at least 2.10.0 to get VersionInfo.match +] +dynamic = ["readme", "version"] + +[project.urls] +Source = "https://github.com/kedro-org/kedro-plugins/tree/main/kedro-airflow" +Documentation = "https://github.com/kedro-org/kedro-plugins/blob/main/kedro-airflow/README.md" +Tracker = "https://github.com/kedro-org/kedro-plugins/issues" + +[project.entry-points."kedro.project_commands"] +airflow = "kedro_airflow.plugin:commands" + +[tool.setuptools] +include-package-data = true +packages = ["kedro_airflow"] +zip-safe = false + +[tool.setuptools.package-data] +kedro_airflow = ["kedro_airflow/airflow_dag_template.j2"] + +[tool.setuptools.dynamic] +readme = {file = "README.md", content-type = "text/markdown"} +version = {attr = "kedro_airflow.__version__"} + +[tool.pytest.ini_options] +addopts = """ + --cov-report xml:coverage.xml + --cov-report term-missing + --cov kedro_airflow + --cov tests + --no-cov-on-fail + -ra""" + [tool.black] exclude=".*template.py" diff --git a/kedro-airflow/requirements.txt b/kedro-airflow/requirements.txt deleted file mode 100644 index d1731ba85..000000000 --- a/kedro-airflow/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -kedro>=0.17.5 -python-slugify>=4.0 -semver~=2.10 # Needs to be at least 2.10.0 to get VersionInfo.match diff --git a/kedro-airflow/setup.cfg b/kedro-airflow/setup.cfg deleted file mode 100644 index 7fa30d2d0..000000000 --- a/kedro-airflow/setup.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[metadata] -description-file=README.md - -[tool:pytest] -addopts=--cov-report xml:coverage.xml - --cov-report term-missing - --cov kedro_airflow - --cov tests - --no-cov-on-fail - -ra diff --git a/kedro-airflow/setup.py b/kedro-airflow/setup.py deleted file mode 100644 index 85bb25b8a..000000000 --- a/kedro-airflow/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -import re -from codecs import open -from os import path - -from setuptools import setup - -name = "kedro-airflow" -here = path.abspath(path.dirname(__file__)) - -# get package version -package_name = name.replace("-", "_") -with open(path.join(here, package_name, "__init__.py"), encoding="utf-8") as f: - version = re.search(r'__version__ = ["\']([^"\']+)', f.read()).group(1) - -# get the dependencies and installs -with open("requirements.txt", "r", encoding="utf-8") as f: - requires = [x.strip() for x in f if x.strip()] - -# get the long description from the README file -with open(path.join(here, "README.md"), encoding="utf-8") as f: - readme = f.read() - -setup( - name=name, - version=version, - description="Kedro-Airflow makes it easy to deploy Kedro projects to Airflow", - long_description=readme, - long_description_content_type="text/markdown", - url="https://github.com/kedro-org/kedro-plugins/tree/main/kedro-airflow", - author="Kedro", - python_requires=">=3.7, <3.11", - install_requires=requires, - license="Apache Software License (Apache 2.0)", - packages=["kedro_airflow"], - package_data={"kedro_airflow": ["kedro_airflow/airflow_dag_template.j2"]}, - include_package_data=True, - zip_safe=False, - entry_points={ - "kedro.project_commands": ["airflow = kedro_airflow.plugin:commands"] - }, -) diff --git a/kedro-airflow/test_requirements.txt b/kedro-airflow/test_requirements.txt index 4ced2ca4c..cdea520c7 100644 --- a/kedro-airflow/test_requirements.txt +++ b/kedro-airflow/test_requirements.txt @@ -1,4 +1,3 @@ --r requirements.txt apache-airflow<3.0 bandit>=1.6.2, <2.0 behave diff --git a/kedro-datasets/pyproject.toml b/kedro-datasets/pyproject.toml index 0f0ad2fc3..a5f494106 100644 --- a/kedro-datasets/pyproject.toml +++ b/kedro-datasets/pyproject.toml @@ -1,3 +1,7 @@ +[build-system] +requires = ["setuptools>=61.2"] +build-backend = "setuptools.build_meta" + [project] name = "kedro-datasets" authors = [