diff --git a/Makefile b/Makefile index 86daa6313..be653ed59 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ package: cd $(plugin);\ rm -Rf dist;\ - python setup.py sdist bdist_wheel + python -m build pypi: python -m pip install twine -U diff --git a/kedro-datasets/pyproject.toml b/kedro-datasets/pyproject.toml index 6df7bd372..21c4fadbe 100644 --- a/kedro-datasets/pyproject.toml +++ b/kedro-datasets/pyproject.toml @@ -1,3 +1,26 @@ +[project] +name = "kedro-datasets" +authors = [ + {name = "Kedro"} +] +description = "Kedro-Datasets is where you can find all of Kedro's data connectors." +requires-python = ">=3.7, <3.11" +license = {text = "Apache Software License (Apache 2.0)"} +dynamic = ["readme", "version", "dependencies", "optional-dependencies"] + +[project.urls] +Source = "https://github.com/kedro-org/kedro-plugins/tree/main/kedro-datasets" +Documentation = "https://docs.kedro.org" +Tracker = "https://github.com/kedro-org/kedro-plugins/issues" + +[tool.setuptools.packages.find] +include = ["kedro_datasets*"] + +[tool.setuptools.dynamic] +readme = {file = "README.md", content-type = "text/markdown"} +version = {attr = "kedro_datasets.__version__"} +dependencies = {file = "requirements.txt"} + [tool.black] [tool.isort] diff --git a/kedro-datasets/setup.py b/kedro-datasets/setup.py index 6d88fe50e..e84e77e89 100644 --- a/kedro-datasets/setup.py +++ b/kedro-datasets/setup.py @@ -1,12 +1,7 @@ -import re -from codecs import open from itertools import chain -from os import path -from setuptools import find_packages, setup +from setuptools import setup -name = "kedro-datasets" -here = path.abspath(path.dirname(__file__)) # at least 1.3 to be able to use XMLDataSet and pandas integration with fsspec PANDAS = "pandas>=1.3, <3.0" @@ -15,21 +10,6 @@ S3FS = "s3fs>=0.3.0, <0.5" POLARS = "polars~=0.15.16" -with open("requirements.txt", "r", encoding="utf-8") as f: - install_requires = [x.strip() for x in f if x.strip()] - -with open("test_requirements.txt", "r", encoding="utf-8") as f: - tests_require = [x.strip() for x in f if x.strip() and not x.startswith("-r")] - -# 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 long description from the README file -with open(path.join(here, "README.md"), encoding="utf-8") as f: - readme = f.read() - def _collect_requirements(requires): return sorted(set(chain.from_iterable(requires.values()))) @@ -145,17 +125,5 @@ def _collect_requirements(requires): extras_require["all"] = _collect_requirements(extras_require) setup( - name=name, - version=version, - description="Kedro-Datasets is where you can find all of Kedro's data connectors.", - long_description=readme, - long_description_content_type="text/markdown", - url="https://github.com/kedro-org/kedro-plugins/tree/main/kedro-datasets", - install_requires=install_requires, - tests_require=tests_require, - author="Kedro", - python_requires=">=3.7, <3.11", - license="Apache Software License (Apache 2.0)", - packages=find_packages(exclude=["tests*"]), extras_require=extras_require, )