Skip to content

Commit

Permalink
Skeleton cudf polars package
Browse files Browse the repository at this point in the history
  • Loading branch information
wence- committed May 9, 2024
1 parent 3481042 commit 9d5ae66
Show file tree
Hide file tree
Showing 7 changed files with 189 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ repos:
# project can specify its own first/third-party packages.
args: ["--config-root=python/", "--resolve-all-configs"]
files: python/.*
exclude: |
(?x)^(^python/cudf_polars/.*)
types_or: [python, cython, pyi]
- repo: https://github.com/MarcoGorelli/cython-lint
rev: v0.16.2
Expand All @@ -36,6 +38,7 @@ repos:
"python/cudf/cudf",
"python/custreamz/custreamz",
"python/cudf_kafka/cudf_kafka",
"python/cudf_polars/cudf_polars",
"python/dask_cudf/dask_cudf"]
pass_filenames: false
- repo: https://github.com/nbQA-dev/nbQA
Expand Down
29 changes: 29 additions & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,30 @@ files:
key: cudf-pandas-tests
includes:
- test_python_cudf_pandas
py_build_cudf_polars:
output: pyproject
pyproject_dir: python/cudf_polars
extras:
table: build-system
includes:
- build_wheels
py_run_cudf_polars:
output: pyproject
pyproject_dir: python/cudf_polars
extras:
table: project
includes:
- run_common
- run_cudf_polars
- depends_on_cudf
py_test_cudf_polars:
output: pyproject
pyproject_dir: python/cudf_polars
extras:
table: project.optional-dependencies
key: test
includes:
- test_python_common
py_build_dask_cudf:
output: pyproject
pyproject_dir: python/dask_cudf
Expand Down Expand Up @@ -559,6 +583,11 @@ dependencies:
- output_types: pyproject
matrices:
- {matrix: null, packages: [cubinlinker, ptxcompiler, *rmm_conda] }
run_cudf_polars:
common:
- output_types: [conda, requirements, pyproject]
packages:
- polars>=0.20.24
run_dask_cudf:
common:
- output_types: [conda, requirements, pyproject]
Expand Down
1 change: 1 addition & 0 deletions python/cudf_polars/LICENSE
1 change: 1 addition & 0 deletions python/cudf_polars/README.md
1 change: 1 addition & 0 deletions python/cudf_polars/cudf_polars/VERSION
13 changes: 13 additions & 0 deletions python/cudf_polars/cudf_polars/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
# SPDX-License-Identifier: Apache-2.0

"""
An executor for polars logical plans.
This package implements an executor for polars logical plans using
pylibcudf to execute the plans on device.
"""

from __future__ import annotations

__all__: list[str] = []
141 changes: 141 additions & 0 deletions python/cudf_polars/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Copyright (c) 2024, NVIDIA CORPORATION.

[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
"wheel",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

[project]
name = "cudf-polars"
dynamic = ["version"]
description = "Executor for polars using cudf"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
{ name = "NVIDIA Corporation" },
]
license = { text = "Apache 2.0" }
requires-python = ">=3.9"
dependencies = [
"cudf==24.6.*",
"fsspec>=0.6.0",
"numpy>=1.23,<2.0a0",
"pandas>=2.0,<2.2.3dev0",
"polars>=0.20.24",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
classifiers = [
"Intended Audience :: Developers",
"Topic :: Database",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]

[project.optional-dependencies]
test = [
"pytest-cov",
"pytest-xdist",
"pytest<8",
] # This list was generated by `rapids-dependency-file-generator`. To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.

[project.urls]
Homepage = "https://github.com/rapidsai/cudf"

[tool.setuptools]
license-files = ["LICENSE"]

[tool.setuptools.dynamic]
version = {file = "cudf_polars/VERSION"}

[tool.setuptools.packages.find]
exclude = ["*tests*"]

[tool.ruff]
line-length = 88
indent-width = 4
target-version = "py39"
fix = true

[tool.ruff.lint]
# __init__.py must re-export everything it imports
ignore-init-module-imports = false
select = [
"E", # pycodestyle
"W", # pycodestyle
"F", # Pyflakes
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"D", # flake8-docstrings
"D213", # Augment NumPy docstring convention: Multi-line docstring summary should start at the second line
"D417", # Augment NumPy docstring convention: Missing argument descriptions
"I", # isort
"SIM", # flake8-simplify
"TCH", # flake8-type-checking
"TID", # flake8-tidy-imports
"UP", # pyupgrade
"PT", # flake8-pytest-style
"RUF", # Ruff-specific rules
"PTH", # flake8-use-pathlib
"FA", # flake8-future-annotations
"PIE", # flake8-pie
"TD", # flake8-todos
"TRY", # tryceratops
"FBT001", # flake8-boolean-trap
]

ignore = [
# Line length regulated by formatter
"E501",
# pydocstyle: http://www.pydocstyle.org/en/stable/error_codes.html
"D401", # Relax NumPy docstring convention: First line should be in imperative mood
# flake8-pytest-style:
"PT011", # pytest.raises({exception}) is too broad, set the match parameter or use a more specific exception
# flake8-simplify
"SIM108", # Use ternary operator
# flake8-todos
"TD002", # Missing author in TODO
"TD003", # Missing issue link on the line following this TODO
# tryceratops
"TRY003", # Avoid specifying long messages outside the exception class
# Lints below are turned off because of conflicts with the ruff formatter
"D206",
"W191",
]
fixable = ["ALL"]

[tool.ruff.lint.pydocstyle]
convention = "numpy"

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.lint.flake8-type-checking]
strict = true

[tool.ruff.lint.isort]
case-sensitive = true
combine-as-imports = true
order-by-type = true
known-first-party = ["cudf_polars"]
default-section = "third-party"
section-order = [
"future",
"standard-library",
"third-party",
"polars",
"rapids",
"first-party",
"local-folder"
]
required-imports = ["from __future__ import annotations"]

[tool.ruff.lint.isort.sections]
polars = ["polars"]
rapids = ["rmm", "cudf"]

[tool.ruff.format]
docstring-code-format = true

0 comments on commit 9d5ae66

Please sign in to comment.