Skip to content

Commit 62524dd

Browse files
Switch to pyproject.toml and use src-layout. (#365)
By using the src-layout convention, we can eliminate our custom `setup.py` logic entirely and switch to using a purely-declarative `pyproject.toml` file.
1 parent 8abefa3 commit 62524dd

File tree

755 files changed

+57
-64
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

755 files changed

+57
-64
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ venv.bak/
104104
.mypy_cache/
105105

106106
.idea
107-
tiledb/cloud/version.py
107+
src/tiledb/cloud/version.py

.isort.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ profile=black
33
line_length=88
44
force_single_line=True
55
single_line_exclusions=typing
6+
known_first_party=tiledb

MANIFEST.in

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Because `setuptools-scm` tries to include every single file known to Git,
2+
# we trim that down to include only the Python files themselves and manadatory
3+
# package metadata.
4+
5+
global-exclude *
6+
include pyproject.toml
7+
include MANIFEST.in
8+
recursive-include src *.py
9+
recursive-exclude src/tiledb/cloud/_common/api_v2/test *
10+
recursive-exclude src/tiledb/cloud/rest_api/test *

pyproject.toml

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
1+
[project]
2+
name = "tiledb-cloud"
3+
description = "TileDB Cloud platform Python client"
4+
dynamic = ["version"]
5+
6+
dependencies = [
7+
"attrs>=21.4.0",
8+
"certifi",
9+
"cloudpickle==1.4.1",
10+
# as of 2021-07-06, the runtime (pinned to 1.1) is incompatible with 1.3
11+
"pandas<1.3; python_version < '3.10'",
12+
"pandas>=1.3; python_version >= '3.10'",
13+
"pyarrow>=3.0.0",
14+
"python-dateutil",
15+
"six>=1.10",
16+
"tiledb>=0.5.0",
17+
"urllib3>=1.26",
18+
]
19+
20+
[project.optional-dependencies]
21+
viz-tiledb = ["networkx>=2", "pydot", "tiledb-plot-widget>=0.1.7"]
22+
viz-plotly = ["networkx>=2", "plotly>=4", "pydot"]
23+
all = ["networkx>=2", "plotly>=4", "pydot", "tiledb-plot-widget>=0.1.7"]
24+
25+
[project.urls]
26+
homepage = "https://tiledb.com"
27+
repository = "https://github.com/TileDB-Inc/TileDB-Cloud-Py"
28+
29+
130
[build-system]
231
requires = ["setuptools>=42", "wheel", "setuptools_scm>=6"]
332

33+
[tool.setuptools]
34+
zip-safe = false
35+
36+
[tool.setuptools.packages.find]
37+
where = ["src"]
38+
439
[tool.setuptools_scm]
5-
write_to = "tiledb/cloud/version.py"
40+
write_to = "src/tiledb/cloud/version.py"

setup.py

Lines changed: 3 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,5 @@
1-
# coding: utf-8
1+
# Minimal setup.py to enable editable install (pip install -e .).
22

3-
"""
4-
TileDB Cloud Platform Python Client
5-
"""
3+
import setuptools
64

7-
from setuptools import find_packages # noqa: H301
8-
from setuptools import setup
9-
10-
# NOTE: we cannot use an __init__.py file in the tiledb/ directory, because it is supplied
11-
# by core tiledb-py. Therefore, `find_packages` at the root directory does not find
12-
# any sub-packages. We must explicitly iterate the `tiledb/cloud` subdirectory
13-
# 1) https://packaging.python.org/guides/packaging-namespace-packages/#native-namespace-packages
14-
# 2) https://stackoverflow.com/a/53486554
15-
# Note: we also exclude `namespace_packages` argument, because it causes creation of the
16-
# '[].nspkg.pth' pointer file, which breaks imports of tiledb.cloud.
17-
# 3) https://stackoverflow.com/a/50301070
18-
19-
PACKAGES = ["tiledb.cloud"]
20-
PACKAGES.extend(
21-
"tiledb.cloud." + x for x in find_packages("./tiledb/cloud", exclude=("testonly",))
22-
)
23-
VIZ_REQUIRES = ["networkx>=2", "pydot"]
24-
TILEDB_VIZ_REQUIRES = ["tiledb-plot-widget>=0.1.7", *VIZ_REQUIRES]
25-
PLOTLY_VIZ_REQUIRES = ["plotly>=4", *VIZ_REQUIRES]
26-
ALL_REQUIRES = list(set(TILEDB_VIZ_REQUIRES + PLOTLY_VIZ_REQUIRES))
27-
28-
setup(
29-
name="tiledb-cloud",
30-
description="TileDB Cloud Platform Python Client",
31-
author_email="",
32-
url="https://tiledb.io",
33-
keywords=["TileDB", "cloud"],
34-
install_requires=[
35-
"attrs>=21.4.0",
36-
"tiledb>=0.5.0",
37-
"urllib3>=1.26",
38-
"six>=1.10",
39-
"certifi",
40-
"python-dateutil",
41-
"cloudpickle==1.4.1",
42-
# as of 2021-07-06, the runtime (pinned to 1.1) is incompatible with 1.3
43-
"pandas<1.3; python_version < '3.10'",
44-
"pandas>=1.3; python_version >= '3.10'",
45-
"pyarrow>=3.0.0",
46-
],
47-
extras_require={
48-
"viz-tiledb": TILEDB_VIZ_REQUIRES,
49-
"viz-plotly": PLOTLY_VIZ_REQUIRES,
50-
"all": ALL_REQUIRES,
51-
},
52-
packages=PACKAGES,
53-
include_package_data=True,
54-
zip_safe=False, # Force folder install; egg doesn't work for namespace
55-
long_description="""\
56-
TileDB Cloud Platform Python API # noqa: E501
57-
""",
58-
)
5+
setuptools.setup()
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)