kenkyu 0.1.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.
- kenkyu-0.1.2/PKG-INFO +32 -0
- kenkyu-0.1.2/README.md +14 -0
- kenkyu-0.1.2/pyproject.toml +34 -0
- kenkyu-0.1.2/setup.cfg +4 -0
- kenkyu-0.1.2/src/kenkyu/__init__.py +5 -0
- kenkyu-0.1.2/src/kenkyu/__main__.py +3 -0
- kenkyu-0.1.2/src/kenkyu/_launcher.py +126 -0
- kenkyu-0.1.2/src/kenkyu/_version.py +2 -0
- kenkyu-0.1.2/src/kenkyu.egg-info/PKG-INFO +32 -0
- kenkyu-0.1.2/src/kenkyu.egg-info/SOURCES.txt +11 -0
- kenkyu-0.1.2/src/kenkyu.egg-info/dependency_links.txt +1 -0
- kenkyu-0.1.2/src/kenkyu.egg-info/entry_points.txt +3 -0
- kenkyu-0.1.2/src/kenkyu.egg-info/top_level.txt +1 -0
kenkyu-0.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kenkyu
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Installer for kenkyu: downloads the kenkyu binary for your system from GitHub Releases and runs it
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/ShashankRaoCoding/kenkyu
|
|
7
|
+
Project-URL: Releases, https://github.com/ShashankRaoCoding/kenkyu/releases
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Environment :: Web Environment
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: Operating System :: MacOS
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# kenkyu (installer)
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
pip install kenkyu
|
|
23
|
+
kenkyu
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This package is a small installer for [kenkyu](https://github.com/ShashankRaoCoding/kenkyu). It holds no binary. The first time you run `kenkyu`, it downloads the kenkyu binary for your system and version from the [GitHub release](https://github.com/ShashankRaoCoding/kenkyu/releases), checks it against the release's `SHA256SUMS`, keeps it, and runs it with your arguments. Later runs start the kept binary straight away.
|
|
27
|
+
|
|
28
|
+
- **Where it is kept:** `$KENKYU_HOME/bin`, else `%LOCALAPPDATA%\kenkyu\bin` (Windows), `~/Library/Application Support/kenkyu/bin` (macOS) or `$XDG_DATA_HOME/kenkyu/bin` (`~/.local/share/kenkyu/bin`, Linux).
|
|
29
|
+
- **Download only:** `kenkyu-install` downloads the binary and prints its path, without starting kenkyu (useful before going offline).
|
|
30
|
+
- **Your own binary:** set `$KENKYU_BINARY` to a kenkyu binary to run that instead.
|
|
31
|
+
|
|
32
|
+
Supported: Windows, macOS and Linux on amd64 (Intel/AMD) or arm64 (Apple Silicon, ARM).
|
kenkyu-0.1.2/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# kenkyu (installer)
|
|
2
|
+
|
|
3
|
+
```
|
|
4
|
+
pip install kenkyu
|
|
5
|
+
kenkyu
|
|
6
|
+
```
|
|
7
|
+
|
|
8
|
+
This package is a small installer for [kenkyu](https://github.com/ShashankRaoCoding/kenkyu). It holds no binary. The first time you run `kenkyu`, it downloads the kenkyu binary for your system and version from the [GitHub release](https://github.com/ShashankRaoCoding/kenkyu/releases), checks it against the release's `SHA256SUMS`, keeps it, and runs it with your arguments. Later runs start the kept binary straight away.
|
|
9
|
+
|
|
10
|
+
- **Where it is kept:** `$KENKYU_HOME/bin`, else `%LOCALAPPDATA%\kenkyu\bin` (Windows), `~/Library/Application Support/kenkyu/bin` (macOS) or `$XDG_DATA_HOME/kenkyu/bin` (`~/.local/share/kenkyu/bin`, Linux).
|
|
11
|
+
- **Download only:** `kenkyu-install` downloads the binary and prints its path, without starting kenkyu (useful before going offline).
|
|
12
|
+
- **Your own binary:** set `$KENKYU_BINARY` to a kenkyu binary to run that instead.
|
|
13
|
+
|
|
14
|
+
Supported: Windows, macOS and Linux on amd64 (Intel/AMD) or arm64 (Apple Silicon, ARM).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=69"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "kenkyu"
|
|
7
|
+
# Set from the release tag by .github/workflows/publish.yml.
|
|
8
|
+
version = "0.1.2"
|
|
9
|
+
description = "Installer for kenkyu: downloads the kenkyu binary for your system from GitHub Releases and runs it"
|
|
10
|
+
readme = "README.md"
|
|
11
|
+
license = "Apache-2.0"
|
|
12
|
+
requires-python = ">=3.8"
|
|
13
|
+
dependencies = []
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Environment :: Web Environment",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"Operating System :: MacOS",
|
|
19
|
+
"Operating System :: Microsoft :: Windows",
|
|
20
|
+
"Operating System :: POSIX :: Linux",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Topic :: Scientific/Engineering",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/ShashankRaoCoding/kenkyu"
|
|
27
|
+
Releases = "https://github.com/ShashankRaoCoding/kenkyu/releases"
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
kenkyu = "kenkyu._launcher:main"
|
|
31
|
+
kenkyu-install = "kenkyu._launcher:install_main"
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.packages.find]
|
|
34
|
+
where = ["src"]
|
kenkyu-0.1.2/setup.cfg
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"""Download the kenkyu binary for this system from GitHub Releases, then run it.
|
|
2
|
+
|
|
3
|
+
The binary is checked against the release's SHA256SUMS and kept, so only the
|
|
4
|
+
first run of each version downloads anything.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
import hashlib
|
|
8
|
+
import os
|
|
9
|
+
import platform
|
|
10
|
+
import stat
|
|
11
|
+
import subprocess
|
|
12
|
+
import sys
|
|
13
|
+
import tempfile
|
|
14
|
+
import urllib.request
|
|
15
|
+
from pathlib import Path
|
|
16
|
+
|
|
17
|
+
from ._version import TAG
|
|
18
|
+
|
|
19
|
+
REPO = "ShashankRaoCoding/kenkyu"
|
|
20
|
+
BASE = "https://github.com/%s/releases/download/%s" % (REPO, TAG)
|
|
21
|
+
|
|
22
|
+
_OS = {"windows": "windows", "darwin": "darwin", "linux": "linux"}
|
|
23
|
+
_ARCH = {
|
|
24
|
+
"x86_64": "amd64",
|
|
25
|
+
"amd64": "amd64",
|
|
26
|
+
"x64": "amd64",
|
|
27
|
+
"arm64": "arm64",
|
|
28
|
+
"aarch64": "arm64",
|
|
29
|
+
"armv8l": "arm64",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _target():
|
|
34
|
+
system = platform.system().lower()
|
|
35
|
+
machine = platform.machine().lower()
|
|
36
|
+
goos, goarch = _OS.get(system), _ARCH.get(machine)
|
|
37
|
+
if goos is None or goarch is None:
|
|
38
|
+
sys.exit(
|
|
39
|
+
"kenkyu: no release binary for %s/%s. Build from source: "
|
|
40
|
+
"https://github.com/%s#build" % (system, machine, REPO)
|
|
41
|
+
)
|
|
42
|
+
return goos, goarch
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def asset_name():
|
|
46
|
+
goos, goarch = _target()
|
|
47
|
+
ext = ".exe" if goos == "windows" else ""
|
|
48
|
+
return "kenkyu_%s_%s_%s%s" % (TAG, goos, goarch, ext)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def bin_dir():
|
|
52
|
+
home = os.environ.get("KENKYU_HOME")
|
|
53
|
+
if home:
|
|
54
|
+
return Path(home) / "bin"
|
|
55
|
+
system = platform.system()
|
|
56
|
+
if system == "Windows":
|
|
57
|
+
root = Path(os.environ.get("LOCALAPPDATA") or Path.home() / "AppData" / "Local")
|
|
58
|
+
elif system == "Darwin":
|
|
59
|
+
root = Path.home() / "Library" / "Application Support"
|
|
60
|
+
else:
|
|
61
|
+
root = Path(os.environ.get("XDG_DATA_HOME") or Path.home() / ".local" / "share")
|
|
62
|
+
return root / "kenkyu" / "bin"
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _fetch(url):
|
|
66
|
+
req = urllib.request.Request(url, headers={"User-Agent": "kenkyu-installer/" + TAG})
|
|
67
|
+
with urllib.request.urlopen(req, timeout=60) as resp:
|
|
68
|
+
return resp.read()
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
def _expected_sha256(name):
|
|
72
|
+
sums = _fetch(BASE + "/SHA256SUMS").decode("utf-8")
|
|
73
|
+
for line in sums.splitlines():
|
|
74
|
+
parts = line.split()
|
|
75
|
+
if len(parts) == 2 and parts[1].lstrip("*") == name:
|
|
76
|
+
return parts[0].lower()
|
|
77
|
+
sys.exit("kenkyu: %s is not listed in the %s SHA256SUMS" % (name, TAG))
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
def install():
|
|
81
|
+
"""Return the path of this version's binary, downloading it if needed."""
|
|
82
|
+
name = asset_name()
|
|
83
|
+
dest = bin_dir() / name
|
|
84
|
+
if dest.is_file():
|
|
85
|
+
return dest
|
|
86
|
+
|
|
87
|
+
dest.parent.mkdir(parents=True, exist_ok=True)
|
|
88
|
+
sys.stderr.write("kenkyu: downloading %s ...\n" % name)
|
|
89
|
+
try:
|
|
90
|
+
want = _expected_sha256(name)
|
|
91
|
+
data = _fetch(BASE + "/" + name)
|
|
92
|
+
except Exception as e: # urllib raises several error types
|
|
93
|
+
sys.exit("kenkyu: could not download %s/%s: %s" % (BASE, name, e))
|
|
94
|
+
|
|
95
|
+
got = hashlib.sha256(data).hexdigest()
|
|
96
|
+
if got != want:
|
|
97
|
+
sys.exit("kenkyu: checksum mismatch for %s (got %s, want %s)" % (name, got, want))
|
|
98
|
+
|
|
99
|
+
fd, tmp = tempfile.mkstemp(dir=str(dest.parent), prefix=".download-")
|
|
100
|
+
try:
|
|
101
|
+
with os.fdopen(fd, "wb") as f:
|
|
102
|
+
f.write(data)
|
|
103
|
+
os.chmod(tmp, os.stat(tmp).st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
|
|
104
|
+
os.replace(tmp, str(dest))
|
|
105
|
+
finally:
|
|
106
|
+
if os.path.exists(tmp):
|
|
107
|
+
os.remove(tmp)
|
|
108
|
+
sys.stderr.write("kenkyu: installed %s\n" % dest)
|
|
109
|
+
return dest
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def main():
|
|
113
|
+
"""Entry point for the `kenkyu` command: run the binary with our arguments."""
|
|
114
|
+
exe = os.environ.get("KENKYU_BINARY") or str(install())
|
|
115
|
+
argv = [exe] + sys.argv[1:]
|
|
116
|
+
if os.name == "nt":
|
|
117
|
+
try:
|
|
118
|
+
sys.exit(subprocess.call(argv))
|
|
119
|
+
except KeyboardInterrupt:
|
|
120
|
+
sys.exit(130)
|
|
121
|
+
os.execv(exe, argv)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def install_main():
|
|
125
|
+
"""Entry point for `kenkyu-install`: download only, print the path."""
|
|
126
|
+
print(install())
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: kenkyu
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Installer for kenkyu: downloads the kenkyu binary for your system from GitHub Releases and runs it
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
Project-URL: Homepage, https://github.com/ShashankRaoCoding/kenkyu
|
|
7
|
+
Project-URL: Releases, https://github.com/ShashankRaoCoding/kenkyu/releases
|
|
8
|
+
Classifier: Environment :: Console
|
|
9
|
+
Classifier: Environment :: Web Environment
|
|
10
|
+
Classifier: Intended Audience :: Science/Research
|
|
11
|
+
Classifier: Operating System :: MacOS
|
|
12
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
|
|
19
|
+
# kenkyu (installer)
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
pip install kenkyu
|
|
23
|
+
kenkyu
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This package is a small installer for [kenkyu](https://github.com/ShashankRaoCoding/kenkyu). It holds no binary. The first time you run `kenkyu`, it downloads the kenkyu binary for your system and version from the [GitHub release](https://github.com/ShashankRaoCoding/kenkyu/releases), checks it against the release's `SHA256SUMS`, keeps it, and runs it with your arguments. Later runs start the kept binary straight away.
|
|
27
|
+
|
|
28
|
+
- **Where it is kept:** `$KENKYU_HOME/bin`, else `%LOCALAPPDATA%\kenkyu\bin` (Windows), `~/Library/Application Support/kenkyu/bin` (macOS) or `$XDG_DATA_HOME/kenkyu/bin` (`~/.local/share/kenkyu/bin`, Linux).
|
|
29
|
+
- **Download only:** `kenkyu-install` downloads the binary and prints its path, without starting kenkyu (useful before going offline).
|
|
30
|
+
- **Your own binary:** set `$KENKYU_BINARY` to a kenkyu binary to run that instead.
|
|
31
|
+
|
|
32
|
+
Supported: Windows, macOS and Linux on amd64 (Intel/AMD) or arm64 (Apple Silicon, ARM).
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/kenkyu/__init__.py
|
|
4
|
+
src/kenkyu/__main__.py
|
|
5
|
+
src/kenkyu/_launcher.py
|
|
6
|
+
src/kenkyu/_version.py
|
|
7
|
+
src/kenkyu.egg-info/PKG-INFO
|
|
8
|
+
src/kenkyu.egg-info/SOURCES.txt
|
|
9
|
+
src/kenkyu.egg-info/dependency_links.txt
|
|
10
|
+
src/kenkyu.egg-info/entry_points.txt
|
|
11
|
+
src/kenkyu.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
kenkyu
|