cocoindex-plus 0.0.0.dev0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,27 @@
1
+ Metadata-Version: 2.2
2
+ Name: cocoindex-plus
3
+ Version: 0.0.0.dev0
4
+ Summary: Placeholder that installs nothing: CocoIndex Plus is published only to its own package index.
5
+ Author-email: CocoIndex <cocoindex.io@gmail.com>
6
+ Project-URL: Homepage, https://cocoindex.io/
7
+ Project-URL: Documentation, https://plus.cocoindex.io/docs/getting_started/installation/
8
+ Classifier: Development Status :: 7 - Inactive
9
+ Dynamic: Requires-Dist
10
+ Description-Content-Type: text/markdown
11
+
12
+ # cocoindex-plus (placeholder)
13
+
14
+ This PyPI project is a placeholder. It installs nothing: installing it stops
15
+ with an error that points to the real package.
16
+
17
+ **CocoIndex Plus**, the enterprise edition of [CocoIndex](https://cocoindex.io/),
18
+ is published only to its own package index, not to PyPI. To install it, follow
19
+ the [installation guide](https://plus.cocoindex.io/docs/getting_started/installation/).
20
+
21
+ We hold this name so that no one else can publish a `cocoindex-plus` here for
22
+ installers to pick up in place of the real one.
23
+
24
+ Looking for the open-source edition? Install
25
+ [`cocoindex`](https://pypi.org/project/cocoindex/).
26
+
27
+ Report security issues to security@cocoindex.io.
@@ -0,0 +1,16 @@
1
+ # cocoindex-plus (placeholder)
2
+
3
+ This PyPI project is a placeholder. It installs nothing: installing it stops
4
+ with an error that points to the real package.
5
+
6
+ **CocoIndex Plus**, the enterprise edition of [CocoIndex](https://cocoindex.io/),
7
+ is published only to its own package index, not to PyPI. To install it, follow
8
+ the [installation guide](https://plus.cocoindex.io/docs/getting_started/installation/).
9
+
10
+ We hold this name so that no one else can publish a `cocoindex-plus` here for
11
+ installers to pick up in place of the real one.
12
+
13
+ Looking for the open-source edition? Install
14
+ [`cocoindex`](https://pypi.org/project/cocoindex/).
15
+
16
+ Report security issues to security@cocoindex.io.
@@ -0,0 +1,116 @@
1
+ """Build backend for the `cocoindex-plus` placeholder on PyPI.
2
+
3
+ CocoIndex Plus is published only to its own package index. The placeholder holds
4
+ the name on PyPI, so no one else can publish a `cocoindex-plus` there for
5
+ installers to pick up instead. It ships as a source distribution only, and every
6
+ wheel hook exits with MESSAGE, so installing it installs nothing.
7
+
8
+ Maintainers:
9
+ - Build with `uv build --sdist` in this directory. Rebuilding the same sources
10
+ gives the same bytes, so a reviewer can check the SHA-256 of what's uploaded.
11
+ - Never delete the PyPI project: deletion frees the name. Never upload a version
12
+ at or above a real CocoIndex Plus release. PyPI never reuses a filename, so a
13
+ corrected placeholder needs a new version (0.0.0.dev1, ...).
14
+
15
+ The wheel hooks run on users' machines, under whatever Python the installer
16
+ uses, so this module sticks to the standard library and to syntax Python 3.7
17
+ accepts.
18
+ """
19
+
20
+ from __future__ import annotations
21
+
22
+ import gzip
23
+ import io
24
+ import os
25
+ import re
26
+ import sys
27
+ import tarfile
28
+ from typing import NoReturn
29
+
30
+ MESSAGE = """\
31
+ cocoindex-plus on PyPI is a placeholder that installs nothing.
32
+
33
+ CocoIndex Plus is published only to its own package index. To install it, see
34
+ https://plus.cocoindex.io/docs/getting_started/installation/
35
+
36
+ If you passed that index with --extra-index-url, your installer found nothing
37
+ usable there and fell back to PyPI: the index rejected your install token, or
38
+ no CocoIndex Plus wheel matches this platform and Python version. Pass it with
39
+ --index-url instead, so a failure there can't fall back to PyPI.
40
+
41
+ For the open-source edition, install `cocoindex`.
42
+ """
43
+
44
+ # What the sdist carries besides PKG-INFO, which build_sdist generates.
45
+ _SDIST_FILES = ("README.md", "_cocoindex_plus_placeholder.py", "pyproject.toml")
46
+
47
+
48
+ def _refuse(*_args: object, **_kwargs: object) -> NoReturn:
49
+ sys.stderr.write(MESSAGE)
50
+ sys.exit(1)
51
+
52
+
53
+ get_requires_for_build_wheel = _refuse
54
+ prepare_metadata_for_build_wheel = _refuse
55
+ build_wheel = _refuse
56
+ get_requires_for_build_editable = _refuse
57
+ prepare_metadata_for_build_editable = _refuse
58
+ build_editable = _refuse
59
+
60
+
61
+ def get_requires_for_build_sdist(
62
+ config_settings: dict[str, object] | None = None,
63
+ ) -> list[str]:
64
+ return []
65
+
66
+
67
+ def build_sdist(
68
+ sdist_directory: str, config_settings: dict[str, object] | None = None
69
+ ) -> str:
70
+ import tomllib # Only maintainers build the sdist, on Python 3.11+.
71
+
72
+ with open("pyproject.toml", "rb") as f:
73
+ project = tomllib.load(f)["project"]
74
+ with open(project["readme"], encoding="utf-8") as f:
75
+ readme = f.read()
76
+
77
+ headers = [
78
+ ("Metadata-Version", "2.2"),
79
+ ("Name", project["name"]),
80
+ ("Version", project["version"]),
81
+ ("Summary", project["description"]),
82
+ (
83
+ "Author-email",
84
+ ", ".join(f"{a['name']} <{a['email']}>" for a in project["authors"]),
85
+ ),
86
+ *(("Project-URL", f"{label}, {url}") for label, url in project["urls"].items()),
87
+ *(("Classifier", c) for c in project["classifiers"]),
88
+ ("Dynamic", "Requires-Dist"),
89
+ ("Description-Content-Type", "text/markdown"),
90
+ ]
91
+ pkg_info = "".join(f"{k}: {v}\n" for k, v in headers) + "\n" + readme
92
+
93
+ files = {"PKG-INFO": pkg_info.encode()}
94
+ for path in _SDIST_FILES:
95
+ with open(path, "rb") as f:
96
+ files[path] = f.read()
97
+
98
+ # PEP 625 filename; fixed timestamps and ownership make the archive
99
+ # reproducible.
100
+ name = re.sub(r"[-_.]+", "_", project["name"]).lower()
101
+ stem = f"{name}-{project['version']}"
102
+ mtime = int(os.environ.get("SOURCE_DATE_EPOCH", "0"))
103
+ archive = io.BytesIO()
104
+ with gzip.GzipFile(filename="", mode="wb", fileobj=archive, mtime=mtime) as gz:
105
+ with tarfile.open(fileobj=gz, mode="w", format=tarfile.PAX_FORMAT) as tar:
106
+ for path, data in sorted(files.items()):
107
+ info = tarfile.TarInfo(f"{stem}/{path}")
108
+ info.size = len(data)
109
+ info.mtime = mtime
110
+ info.mode = 0o644
111
+ tar.addfile(info, io.BytesIO(data))
112
+
113
+ filename = f"{stem}.tar.gz"
114
+ with open(os.path.join(sdist_directory, filename), "wb") as f:
115
+ f.write(archive.getvalue())
116
+ return filename
@@ -0,0 +1,20 @@
1
+ # The `cocoindex-plus` placeholder on PyPI: see _cocoindex_plus_placeholder.py.
2
+ [build-system]
3
+ requires = []
4
+ build-backend = "_cocoindex_plus_placeholder"
5
+ backend-path = ["."]
6
+
7
+ [project]
8
+ name = "cocoindex-plus"
9
+ version = "0.0.0.dev0"
10
+ description = "Placeholder that installs nothing: CocoIndex Plus is published only to its own package index."
11
+ readme = "README.md"
12
+ authors = [{ name = "CocoIndex", email = "cocoindex.io@gmail.com" }]
13
+ classifiers = ["Development Status :: 7 - Inactive"]
14
+ # Dynamic, so a resolver has to ask the backend for them, and fails with its
15
+ # message while resolving rather than later, at install time.
16
+ dynamic = ["dependencies"]
17
+
18
+ [project.urls]
19
+ Homepage = "https://cocoindex.io/"
20
+ Documentation = "https://plus.cocoindex.io/docs/getting_started/installation/"