Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate as much as possible to pyproject.toml #1151

Merged
merged 25 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
6f3ae8f
Explicitly set `build-backend`
jakirkham Nov 4, 2022
f01fb1b
Add symlinks to README
jakirkham Nov 4, 2022
fea5f3a
Use `MANIFEST.in` to handle package data
jakirkham Nov 4, 2022
43cbd29
Move `isort` config to `pyproject.toml` and `flake8` config to `.flak…
jakirkham Nov 4, 2022
60c04b2
Migrate as much as possible to `pyproject.toml`
jakirkham Nov 4, 2022
b95a4a2
Require `tomli`
jakirkham Nov 4, 2022
f2bbd70
Use setuptools package discovery
jakirkham Nov 8, 2022
eafe8bd
Move license file into `project`
jakirkham Nov 8, 2022
6b2ca6a
Move setuptools options back to `setup.py`
jakirkham Nov 8, 2022
14743e6
Keep license metadata & add license file in setup
jakirkham Nov 8, 2022
5c898b1
Fix style.
vyasr Feb 17, 2023
9bc840e
Fix flake8 pre-commit dir.
vyasr Feb 17, 2023
ca8d812
Include top-level CMakeLists.txt.
vyasr Feb 17, 2023
6f0a1d2
Clean up sdist.
vyasr Feb 17, 2023
868968d
Revert "Keep license metadata & add license file in setup"
vyasr Feb 17, 2023
691e3f8
Revert "Move setuptools options back to `setup.py`"
vyasr Feb 17, 2023
b27f348
Require sufficiently new setuptools for PEP 621 support.
vyasr Feb 17, 2023
47d0bbb
Stop using legacy build_meta now that we have removed versioneer.
vyasr Feb 17, 2023
ccc313c
Put find back into setup.py for now.
vyasr Feb 17, 2023
a786ed6
Update wheel modification script.
vyasr Feb 17, 2023
6e5c2d0
Apply suggestions from code review
vyasr Feb 18, 2023
dc88c49
Update script doc.
vyasr Feb 21, 2023
a52aa5a
Merge branch 'branch-23.04' into migr_pyproj
jakirkham Feb 21, 2023
cb02e41
Address PR comments.
vyasr Feb 22, 2023
f3525e1
Also remove sections.
vyasr Feb 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repos:
rev: 5.12.0
hooks:
- id: isort
args: ["--config-root=python/", "--resolve-all-configs"]
args: ["--settings-path=python/pyproject.toml"]
files: python/.*
types_or: [python, cython, pyi]
- repo: https://github.com/ambv/black
Expand All @@ -21,7 +21,7 @@ repos:
rev: 5.0.4
hooks:
- id: flake8
args: ["--config=python/setup.cfg"]
args: ["--config=python/.flake8"]
files: python/.*$
types: [file]
types_or: [python, cython]
Expand Down
6 changes: 3 additions & 3 deletions ci/release/apply_wheel_modifications.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/bin/bash
# Copyright (c) 2023, NVIDIA CORPORATION.
#
# Usage: bash apply_wheel_modifications.sh <new_version>
# Usage: bash apply_wheel_modifications.sh <new_version> <cuda_suffix>

VERSION=${1}
CUDA_SUFFIX=${2}

sed -i "s/__version__ = .*/__version__ = \"${VERSION}\"/g" python/rmm/__init__.py
sed -i "s/version=.*,/version=\"${VERSION}\",/g" python/setup.py
sed -i "s/^version = .*/version = \"${VERSION}\"/g" python/pyproject.toml

sed -i "s/name=\"rmm\",/name=\"rmm${CUDA_SUFFIX}\",/g" python/setup.py
sed -i "s/^name = \"rmm\"/name = \"rmm${CUDA_SUFFIX}\"/g" python/pyproject.toml
1 change: 1 addition & 0 deletions conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ dependencies:
- python>=3.8,<3.11
- scikit-build>=0.13.1
- spdlog>=1.11.0,<1.12
- tomli
name: all_cuda-118_arch-x86_64
3 changes: 2 additions & 1 deletion conda/recipes/rmm/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ requirements:
- librmm ={{ version }}
- python
- scikit-build >=0.13.1
- setuptools
- setuptools >=61.0.0
- tomli # [py<311]
run:
- cuda-python >=11.7.1,<12.0
- numba >=0.49
Expand Down
1 change: 1 addition & 0 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ dependencies:
- ninja
- python>=3.8,<3.11
- scikit-build>=0.13.1
- tomli
- output_types: conda
packages:
- fmt>=9.1.0,<10
Expand Down
38 changes: 1 addition & 37 deletions python/setup.cfg → python/.flake8
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright (c) 2018-2021, NVIDIA CORPORATION.

# Copyright (c) 2023, NVIDIA CORPORATION.

[flake8]
filename = *.py, *.pyx, *.pxd, *.pxi
Expand All @@ -23,38 +22,3 @@ per-file-ignores =
*.pyx: E211, E225, E226, E227, E275, E402, E999, W504
*.pxd: E211, E225, E226, E227, E275, E402, E999, W504
*.pxi: E211, E225, E226, E227, E275, E402, E999, W504

[isort]
line_length=79
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
order_by_type=True
known_dask=
dask
distributed
dask_cuda
known_rapids=
nvtext
cudf
cuml
cugraph
dask_cudf
known_first_party=
rmm
default_section=THIRDPARTY
sections=FUTURE,STDLIB,THIRDPARTY,DASK,RAPIDS,FIRSTPARTY,LOCALFOLDER
skip=
thirdparty
.eggs
.git
.hg
.mypy_cache
.tox
.venv
_build
buck-out
build
dist
__init__.py
13 changes: 13 additions & 0 deletions python/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Cython files
recursive-include rmm *.pxd
vyasr marked this conversation as resolved.
Show resolved Hide resolved
recursive-include rmm *.pyx

# Build files. Don't use a recursive include on '.' in case the repo is dirty
include . CMakeLists.txt
recursive-include rmm CMakeLists.txt

# License
include LICENSE

# README
include README
vyasr marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions python/README.md
78 changes: 75 additions & 3 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,52 @@
# limitations under the License.

[build-system]

build-backend = "setuptools.build_meta"
requires = [
"wheel",
"setuptools",
"setuptools>=61.0.0",
"cython>=0.29,<0.30",
"scikit-build>=0.13.1",
"cmake>=3.23.1,!=3.25.0",
"ninja",
"cuda-python>=11.7.1,<12.0"
"cuda-python>=11.7.1,<12.0",
vyasr marked this conversation as resolved.
Show resolved Hide resolved
"tomli; python_version < '3.11'",
]

[project]
name = "rmm"
version = "23.04.00"
description = "rmm - RAPIDS Memory Manager"
readme = { file = "README.md", content-type = "text/markdown" }
authors = [
{ name = "NVIDIA Corporation" },
]
license = { text = "Apache 2.0" }
requires-python = ">=3.8"
dependencies = [
"cuda-python>=11.7.1,<12.0",
"numpy>=1.19",
"numba>=0.49",
]
classifiers = [
"Intended Audience :: Developers",
"Topic :: Database",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.10",
]

[project.optional-dependencies]
test = [
"pytest",
"pytest-xdist",
]

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

[tool.black]
line-length = 79
target-version = ["py38"]
Expand All @@ -43,3 +78,40 @@ exclude = '''
dist
)/
'''

[tool.isort]
line_length = 79
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
combine_as_imports = true
order_by_type = true
known_first_party = [
"rmm",
]
default_section = "THIRDPARTY"
sections = [
"FUTURE",
"STDLIB",
"THIRDPARTY",
"FIRSTPARTY",
"LOCALFOLDER",
]
skip = [
"thirdparty",
".eggs",
".git",
".hg",
".mypy_cache",
".tox",
".venv",
"_build",
"buck-out",
"build",
"dist",
"__init__.py",
]

[tool.setuptools]
vyasr marked this conversation as resolved.
Show resolved Hide resolved
license-files = ["LICENSE"]
zip-safe = false
35 changes: 0 additions & 35 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,5 @@
from skbuild import setup

setup(
name="rmm",
version="23.04.00",
description="rmm - RAPIDS Memory Manager",
url="https://github.com/rapidsai/rmm",
author="NVIDIA Corporation",
license="Apache 2.0",
classifiers=[
"Intended Audience :: Developers",
"Topic :: Database",
"Topic :: Scientific/Engineering",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
# Include the separately-compiled shared library
extras_require={"test": ["pytest"]},
packages=find_packages(include=["rmm", "rmm.*"]),
vyasr marked this conversation as resolved.
Show resolved Hide resolved
include_package_data=True,
python_requires=">=3.8",
package_data={
# Note: A dict comprehension with an explicit copy is necessary (rather
# than something simpler like a dict.fromkeys) because otherwise every
# package will refer to the same list and skbuild modifies it in place.
key: ["*.hpp", "*.pxd"]
for key in find_packages(
include=["rmm._lib", "rmm._lib.includes", "rmm._cuda*"]
)
},
install_requires=[
"cuda-python>=11.7.1,<12.0",
"numpy>=1.19",
"numba>=0.49",
],
zip_safe=False,
)