Skip to content

Commit

Permalink
Migrate most project metadata to static pyproject.toml
Browse files Browse the repository at this point in the history
See gh-2152.

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
  • Loading branch information
astrojuanlu committed Mar 28, 2023
1 parent f17e37d commit 8f3706f
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 37 deletions.
44 changes: 44 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,50 @@
# Minimum requirements for the build system to execute.
requires = ["setuptools>=65.5.1", "wheel"] # PEP 518 specifications.

[project]
name = "kedro"
authors = [
{name = "Kedro"}
]
description = "Kedro helps you build production-ready data and analytics pipelines"
requires-python = ">=3.7, <3.11"
keywords = [
"pipelines",
"machine learning",
"data pipelines",
"data science",
"data engineering",
]
license = {text = "Apache Software License (Apache 2.0)"}
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
dynamic = ["readme", "version", "dependencies", "optional-dependencies"]

[project.urls]
Homepage = "https://kedro.org"
Source = "https://github.com/kedro-org/kedro"
Documentation = "https://docs.kedro.org"
Tracker = "https://github.com/kedro-org/kedro/issues"

[project.scripts]
kedro = "kedro.framework.cli:main"

[tool.setuptools]
zip-safe = false

[tool.setuptools.packages.find]
include = ["kedro*"]

[tool.setuptools.dynamic]
readme = {file = "README.md", content-type = "text/markdown"}
version = {attr = "kedro.__version__"}
dependencies = {file = "dependency/requirements.txt"}

[tool.black]
exclude = "/templates/|^features/steps/test_starter"

Expand Down
38 changes: 1 addition & 37 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import re
from codecs import open
from glob import glob
from itertools import chain
from os import path

from setuptools import find_packages, setup
from setuptools import setup

name = "kedro"
here = path.abspath(path.dirname(__file__))
Expand All @@ -15,23 +14,10 @@
HDFS = "hdfs>=2.5.8, <3.0"
S3FS = "s3fs>=0.3.0, <0.5"

# get package version
with open(path.join(here, name, "__init__.py"), encoding="utf-8") as f:
result = re.search(r'__version__ = ["\']([^"\']+)', f.read())

if not result:
raise ValueError("Can't find the version in kedro/__init__.py")

version = result.group(1)

# get the dependencies and installs
with open("dependency/requirements.txt", 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()

template_files = []
for pattern in ["**/*", "**/.*", "**/.*/**", "**/.*/.**"]:
template_files.extend(
Expand Down Expand Up @@ -151,30 +137,8 @@ def _collect_requirements(requires):
extras_require["all"] = _collect_requirements(extras_require)

setup(
name=name,
version=version,
description="Kedro helps you build production-ready data and analytics pipelines",
license="Apache Software License (Apache 2.0)",
long_description=readme,
long_description_content_type="text/markdown",
url="https://github.com/kedro-org/kedro",
python_requires=">=3.7, <3.11",
packages=find_packages(exclude=["docs*", "tests*", "tools*", "features*"]),
include_package_data=True,
install_requires=requires,
author="Kedro",
entry_points={"console_scripts": ["kedro = kedro.framework.cli:main"]},
package_data={
name: ["py.typed", "test_requirements.txt"] + template_files
},
zip_safe=False,
keywords="pipelines, machine learning, data pipelines, data science, data engineering",
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
extras_require=extras_require,
)

0 comments on commit 8f3706f

Please sign in to comment.