Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate kedro-airflow to static metadata #172

Merged
merged 5 commits into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion kedro-airflow/MANIFEST.in
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I presume there's no new [tool.setuptools] configuration that could replace this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess not given that you introduced a MANIFEST.in in #173...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MANIFEST.in controls what's in the source distribution https://packaging.python.org/en/latest/guides/using-manifest-in/, and then setuptools uses that by virtue of include-package-data = True https://setuptools.pypa.io/en/latest/userguide/datafiles.html

However, the packaging.python.org docs are a bit outdated and I'm not sure how applicable they are in a post-PEP 621 world... The official Python docs are not much better https://docs.python.org/3/distutils/sourcedist.html?highlight=manifest

To be honest I'm not 100 % sure whether MANIFEST.in can be ditched completely in favor of setuptools package_data, I'd need to investigate a bit and unfortunately I don't have much time for that at the moment (these simple PRs on the other hand took mere minutes to put together). It's an excellent question but I'd prefer to explore it in a separate PR.

Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
include README.md
include LICENSE.md
include requirements.txt
include kedro_airflow/airflow_dag_template.j2
1 change: 1 addition & 0 deletions kedro-airflow/RELEASE.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
48 changes: 48 additions & 0 deletions kedro-airflow/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
3 changes: 0 additions & 3 deletions kedro-airflow/requirements.txt

This file was deleted.

10 changes: 0 additions & 10 deletions kedro-airflow/setup.cfg

This file was deleted.

41 changes: 0 additions & 41 deletions kedro-airflow/setup.py

This file was deleted.

1 change: 0 additions & 1 deletion kedro-airflow/test_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
-r requirements.txt
apache-airflow<3.0
bandit>=1.6.2, <2.0
behave
Expand Down
4 changes: 4 additions & 0 deletions kedro-datasets/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "kedro-datasets"
authors = [
Expand Down