Skip to content

Commit

Permalink
Migrate most project metadata to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
astrojuanlu committed Apr 11, 2023
1 parent bbe419b commit 868bc14
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 34 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
23 changes: 23 additions & 0 deletions kedro-datasets/pyproject.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
34 changes: 1 addition & 33 deletions kedro-datasets/setup.py
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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())))
Expand Down Expand Up @@ -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,
)

0 comments on commit 868bc14

Please sign in to comment.