deno 0.0.1__tar.gz → 0.0.2__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.
Potentially problematic release.
This version of deno might be problematic. Click here for more details.
- deno-0.0.2/.gitignore +72 -0
- deno-0.0.2/PKG-INFO +23 -0
- deno-0.0.2/README.md +17 -0
- deno-0.0.2/pyproject.toml +15 -0
- deno-0.0.2/scripts/build.sh +14 -0
- deno-0.0.2/scripts/hatch_build.py +89 -0
- deno-0.0.2/src/deno/__init__.py +6 -0
- deno-0.0.2/src/deno/__main__.py +44 -0
- deno-0.0.2/src/deno/_find_deno.py +36 -0
- deno-0.0.2/uv.lock +8 -0
- deno-0.0.1/PKG-INFO +0 -4
- deno-0.0.1/pyproject.toml +0 -11
- deno-0.0.1/src/__init__.py +0 -1
deno-0.0.2/.gitignore
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/target
|
|
2
|
+
|
|
3
|
+
# Byte-compiled / optimized / DLL files
|
|
4
|
+
__pycache__/
|
|
5
|
+
.pytest_cache/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
|
|
8
|
+
# C extensions
|
|
9
|
+
*.so
|
|
10
|
+
|
|
11
|
+
# Distribution / packaging
|
|
12
|
+
.Python
|
|
13
|
+
.venv/
|
|
14
|
+
env/
|
|
15
|
+
bin/
|
|
16
|
+
build/
|
|
17
|
+
develop-eggs/
|
|
18
|
+
dist/
|
|
19
|
+
eggs/
|
|
20
|
+
lib/
|
|
21
|
+
lib64/
|
|
22
|
+
parts/
|
|
23
|
+
sdist/
|
|
24
|
+
var/
|
|
25
|
+
include/
|
|
26
|
+
man/
|
|
27
|
+
venv/
|
|
28
|
+
*.egg-info/
|
|
29
|
+
.installed.cfg
|
|
30
|
+
*.egg
|
|
31
|
+
|
|
32
|
+
# Installer logs
|
|
33
|
+
pip-log.txt
|
|
34
|
+
pip-delete-this-directory.txt
|
|
35
|
+
pip-selfcheck.json
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.coverage
|
|
41
|
+
.cache
|
|
42
|
+
nosetests.xml
|
|
43
|
+
coverage.xml
|
|
44
|
+
|
|
45
|
+
# Translations
|
|
46
|
+
*.mo
|
|
47
|
+
|
|
48
|
+
# Mr Developer
|
|
49
|
+
.mr.developer.cfg
|
|
50
|
+
.project
|
|
51
|
+
.pydevproject
|
|
52
|
+
|
|
53
|
+
# Rope
|
|
54
|
+
.ropeproject
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
.DS_Store
|
|
61
|
+
|
|
62
|
+
# Sphinx documentation
|
|
63
|
+
docs/_build/
|
|
64
|
+
|
|
65
|
+
# PyCharm
|
|
66
|
+
.idea/
|
|
67
|
+
|
|
68
|
+
# VSCode
|
|
69
|
+
.vscode/
|
|
70
|
+
|
|
71
|
+
# Pyenv
|
|
72
|
+
.python-version
|
deno-0.0.2/PKG-INFO
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: deno
|
|
3
|
+
Version: 0.0.2
|
|
4
|
+
Requires-Python: >=3.10
|
|
5
|
+
Description-Content-Type: text/markdown
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
scripts/build.sh # build all the distributions under ./dist
|
|
9
|
+
uvx --from dist/deno-2.3.5-py3-none-macosx_11_0_arm64.whl deno --version
|
|
10
|
+
# deno 2.3.5 (stable, release, aarch64-apple-darwin)
|
|
11
|
+
# v8 13.7.152.6-rusty
|
|
12
|
+
# typescript 5.8.3
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```py
|
|
16
|
+
$ uv run --with dist/deno-2.3.5-py3-none-macosx_11_0_arm64.whl python
|
|
17
|
+
# Python 3.13.3 (main, May 30 2025, 05:45:55) [Clang 20.1.4 ] on darwin
|
|
18
|
+
# Type "help", "copyright", "credits" or "license" for more information.
|
|
19
|
+
# >>> import deno
|
|
20
|
+
# >>> deno.find_deno_bin()
|
|
21
|
+
# '/Users/manzt/.cache/uv/archive-v0/BykgqI7nUKj0T27s79pu3/bin/deno'
|
|
22
|
+
# >>>
|
|
23
|
+
```
|
deno-0.0.2/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
```sh
|
|
2
|
+
scripts/build.sh # build all the distributions under ./dist
|
|
3
|
+
uvx --from dist/deno-2.3.5-py3-none-macosx_11_0_arm64.whl deno --version
|
|
4
|
+
# deno 2.3.5 (stable, release, aarch64-apple-darwin)
|
|
5
|
+
# v8 13.7.152.6-rusty
|
|
6
|
+
# typescript 5.8.3
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```py
|
|
10
|
+
$ uv run --with dist/deno-2.3.5-py3-none-macosx_11_0_arm64.whl python
|
|
11
|
+
# Python 3.13.3 (main, May 30 2025, 05:45:55) [Clang 20.1.4 ] on darwin
|
|
12
|
+
# Type "help", "copyright", "credits" or "license" for more information.
|
|
13
|
+
# >>> import deno
|
|
14
|
+
# >>> deno.find_deno_bin()
|
|
15
|
+
# '/Users/manzt/.cache/uv/archive-v0/BykgqI7nUKj0T27s79pu3/bin/deno'
|
|
16
|
+
# >>>
|
|
17
|
+
```
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "deno"
|
|
7
|
+
version = "0.0.2"
|
|
8
|
+
readme = "README.md"
|
|
9
|
+
requires-python = ">=3.10"
|
|
10
|
+
|
|
11
|
+
[tool.hatch.build]
|
|
12
|
+
artifacts = ["scripts/hatch_build.py"]
|
|
13
|
+
|
|
14
|
+
[tool.hatch.build.hooks.custom]
|
|
15
|
+
path = "scripts/hatch_build.py"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Build the main
|
|
2
|
+
uv build --sdist
|
|
3
|
+
|
|
4
|
+
# Build the wheels
|
|
5
|
+
for zip in \
|
|
6
|
+
"deno-aarch64-apple-darwin.zip" \
|
|
7
|
+
"deno-aarch64-unknown-linux-gnu.zip" \
|
|
8
|
+
"deno-x86_64-apple-darwin.zip" \
|
|
9
|
+
"deno-x86_64-pc-windows-msvc.zip" \
|
|
10
|
+
"deno-x86_64-unknown-linux-gnu.zip"
|
|
11
|
+
do
|
|
12
|
+
# Set the target binary
|
|
13
|
+
DENO_ARCHIVE_TARGET=$zip uv build --wheel
|
|
14
|
+
done
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import urllib.request
|
|
2
|
+
import zipfile
|
|
3
|
+
import platform
|
|
4
|
+
import os
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
SELF_DIR = Path(__file__).parent
|
|
11
|
+
|
|
12
|
+
# these are the binaries provided by deno, mapped to a python tag
|
|
13
|
+
binary_to_tag = {
|
|
14
|
+
"deno-x86_64-apple-darwin.zip": "py3-none-macosx_10_12_x86_64",
|
|
15
|
+
"deno-aarch64-apple-darwin.zip": "py3-none-macosx_11_0_arm64",
|
|
16
|
+
"deno-aarch64-unknown-linux-gnu.zip": "py3-none-manylinux_2_17_aarch64",
|
|
17
|
+
"deno-x86_64-pc-windows-msvc.zip": "py3-none-win_amd64",
|
|
18
|
+
"deno-x86_64-unknown-linux-gnu.zip": "py3-none-manylinux_2_17_x86_64",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def detect_platform() -> tuple[str, str]:
|
|
23
|
+
"""Detect the platform and architecture."""
|
|
24
|
+
system = platform.system().lower()
|
|
25
|
+
os_name = {
|
|
26
|
+
"darwin": "apple-darwin",
|
|
27
|
+
"linux": "unknown-linux-gnu",
|
|
28
|
+
"windows": "pc-windows-msvc",
|
|
29
|
+
}.get(system)
|
|
30
|
+
if not os_name:
|
|
31
|
+
raise RuntimeError(f"Unsupported OS: {system}")
|
|
32
|
+
|
|
33
|
+
arch = platform.machine().lower()
|
|
34
|
+
if arch in {"x86_64", "amd64"}:
|
|
35
|
+
arch = "x86_64"
|
|
36
|
+
elif arch in {"aarch64", "arm64"}:
|
|
37
|
+
arch = "aarch64"
|
|
38
|
+
else:
|
|
39
|
+
raise RuntimeError(f"Unsupported architecture: {arch}")
|
|
40
|
+
|
|
41
|
+
return os_name, arch
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def download_deno_bin(dir: Path, version: str, zname: str) -> Path:
|
|
45
|
+
assert zname in binary_to_tag, f"Unsupported binary: {zname}"
|
|
46
|
+
url = f"https://github.com/denoland/deno/releases/download/v{version}/{zname}"
|
|
47
|
+
|
|
48
|
+
with urllib.request.urlopen(url) as resp, (dir / zname).open("wb") as out_file:
|
|
49
|
+
out_file.write(resp.read())
|
|
50
|
+
|
|
51
|
+
with zipfile.ZipFile(dir / zname, "r") as zf:
|
|
52
|
+
for fname in zf.namelist():
|
|
53
|
+
if fname in ("deno", "deno.exe"):
|
|
54
|
+
with (dir / fname).open("wb") as out_file:
|
|
55
|
+
out_file.write(zf.read(fname))
|
|
56
|
+
return dir / fname
|
|
57
|
+
|
|
58
|
+
raise FileNotFoundError("Binary 'deno' not found in archive.")
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def resolve_deno_archive_name():
|
|
62
|
+
if "DENO_ARCHIVE_TARGET" in os.environ:
|
|
63
|
+
return os.environ["DENO_ARCHIVE_TARGET"]
|
|
64
|
+
os_name, arch = detect_platform()
|
|
65
|
+
return f"deno-{arch}-{os_name}.zip"
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class CustomHook(BuildHookInterface):
|
|
69
|
+
def initialize(self, version: str, build_data: dict) -> None:
|
|
70
|
+
if self.target_name == "sdist":
|
|
71
|
+
return
|
|
72
|
+
|
|
73
|
+
zname = resolve_deno_archive_name()
|
|
74
|
+
deno = download_deno_bin(
|
|
75
|
+
Path(self.directory),
|
|
76
|
+
os.environ.get("DENO_VERSION", self.metadata.version),
|
|
77
|
+
zname,
|
|
78
|
+
)
|
|
79
|
+
build_data["tag"] = binary_to_tag[zname]
|
|
80
|
+
build_data["shared_scripts"][str(deno.absolute())] = f"src/{deno.name}"
|
|
81
|
+
|
|
82
|
+
def finalize(self, version: str, build_data: dict, artifact_path: str) -> None:
|
|
83
|
+
if self.target_name == "sdist":
|
|
84
|
+
return
|
|
85
|
+
build = Path(self.directory)
|
|
86
|
+
(build / "deno").unlink(missing_ok=True)
|
|
87
|
+
(build / "deno.exe").unlink(missing_ok=True)
|
|
88
|
+
for f in build.glob("*.zip"):
|
|
89
|
+
f.unlink(missing_ok=True)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import sys
|
|
3
|
+
|
|
4
|
+
from deno import find_deno_bin
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def _detect_virtualenv() -> str:
|
|
8
|
+
"""
|
|
9
|
+
Find the virtual environment path for the current Python executable.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
# If it's already set, then just use it
|
|
13
|
+
value = os.getenv("VIRTUAL_ENV")
|
|
14
|
+
if value:
|
|
15
|
+
return value
|
|
16
|
+
|
|
17
|
+
# Otherwise, check if we're in a venv
|
|
18
|
+
venv_marker = os.path.join(sys.prefix, "pyvenv.cfg")
|
|
19
|
+
|
|
20
|
+
if os.path.exists(venv_marker):
|
|
21
|
+
return sys.prefix
|
|
22
|
+
|
|
23
|
+
return ""
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _run() -> None:
|
|
27
|
+
deno = os.fsdecode(find_deno_bin())
|
|
28
|
+
|
|
29
|
+
env = os.environ.copy()
|
|
30
|
+
venv = _detect_virtualenv()
|
|
31
|
+
if venv:
|
|
32
|
+
env.setdefault("VIRTUAL_ENV", venv)
|
|
33
|
+
|
|
34
|
+
if sys.platform == "win32":
|
|
35
|
+
import subprocess
|
|
36
|
+
|
|
37
|
+
completed_process = subprocess.run([deno, *sys.argv[1:]], env=env)
|
|
38
|
+
sys.exit(completed_process.returncode)
|
|
39
|
+
else:
|
|
40
|
+
os.execvpe(deno, [deno, *sys.argv[1:]], env=env)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
if __name__ == "__main__":
|
|
44
|
+
_run()
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
5
|
+
import sysconfig
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def find_deno_bin() -> str:
|
|
9
|
+
"""Return the deno binary path."""
|
|
10
|
+
|
|
11
|
+
deno_exe = "deno" + sysconfig.get_config_var("EXE")
|
|
12
|
+
|
|
13
|
+
path = os.path.join(sysconfig.get_path("scripts"), deno_exe)
|
|
14
|
+
if os.path.isfile(path):
|
|
15
|
+
return path
|
|
16
|
+
|
|
17
|
+
if sys.version_info >= (3, 10):
|
|
18
|
+
user_scheme = sysconfig.get_preferred_scheme("user")
|
|
19
|
+
elif os.name == "nt":
|
|
20
|
+
user_scheme = "nt_user"
|
|
21
|
+
elif sys.platform == "darwin" and sys._framework:
|
|
22
|
+
user_scheme = "osx_framework_user"
|
|
23
|
+
else:
|
|
24
|
+
user_scheme = "posix_user"
|
|
25
|
+
|
|
26
|
+
path = os.path.join(sysconfig.get_path("scripts", scheme=user_scheme), deno_exe)
|
|
27
|
+
if os.path.isfile(path):
|
|
28
|
+
return path
|
|
29
|
+
|
|
30
|
+
# Search in `bin` adjacent to package root (as created by `pip install --target`).
|
|
31
|
+
pkg_root = os.path.dirname(os.path.dirname(__file__))
|
|
32
|
+
target_path = os.path.join(pkg_root, "bin", deno_exe)
|
|
33
|
+
if os.path.isfile(target_path):
|
|
34
|
+
return target_path
|
|
35
|
+
|
|
36
|
+
raise FileNotFoundError(path)
|
deno-0.0.2/uv.lock
ADDED
deno-0.0.1/PKG-INFO
DELETED
deno-0.0.1/pyproject.toml
DELETED
deno-0.0.1/src/__init__.py
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.0.1"
|