Skip to content

Commit

Permalink
Migrate most project metadata to static pyproject.toml (kedro-org#2475
Browse files Browse the repository at this point in the history
)

* Remove deprecated tests_require

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

* Migrate most project metadata to static pyproject.toml

See kedro-orggh-2152.

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

* Replace direct setup.py invokations by standard command

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>

---------

Signed-off-by: Juan Luis Cano Rodríguez <juan_luis_cano@mckinsey.com>
Signed-off-by: MaximeSteinmetz <maxime.steinmetz@gadz.org>
  • Loading branch information
astrojuanlu authored and MaximeSteinmetz committed Apr 3, 2023
1 parent 8279b19 commit 5371945
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 45 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ linkcheck:
./docs/build-docs.sh "linkcheck"

package: clean install
python setup.py sdist bdist_wheel
python -m pip install build && python -m build

install-test-requirements:
pip install -r test_requirements.txt
Expand All @@ -60,7 +60,7 @@ print-python-env:
@./tools/print_env.sh

databricks-build:
python setup.py bdist_wheel
python -m pip install build && python -m build
python ./tools/databricks_build.py

sign-off:
Expand Down
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
44 changes: 1 addition & 43 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,28 +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 test dependencies and installs
with open("test_requirements.txt", encoding="utf-8") as f:
test_requires = [x.strip() for x in f if x.strip() and not x.startswith("-r")]


# 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 @@ -164,31 +145,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,
tests_require=test_requires,
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 5371945

Please sign in to comment.