-
Notifications
You must be signed in to change notification settings - Fork 7
/
gen-pypyoject-websocat.py
55 lines (45 loc) · 1.46 KB
/
gen-pypyoject-websocat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import sys, argparse, re
parser = argparse.ArgumentParser(description='pyproject generator for golem-node')
parser.add_argument('tag', type=str, help='release tag')
args = parser.parse_args()
p = re.compile(r"^(pre-rel-)?v([0-9]+\.[0-9]+\.[0-9]+)(-rc([0-9]+))?$")
x = p.match(args.tag)
if x is None:
sys.exit(f'invalid version tag: {args.tag}')
rc = x.group(4)
if rc:
py_ver = f"{x.group(2)}a{x.group(4)}"
else:
py_ver = x.group(2)
print(f"""
[build-system]
requires = ["maturin>=1.0,<2.0"]
build-backend = "maturin"
[project]
name = "websocat"
version = "{ py_ver }"
description = "Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions"
readme = "README.md"
requires-python = ">=3.7"
license = {{ file = "LICENSE" }}
keywords = ["cli", "socat", "proxy"]
classifiers = [
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Rust",
]
urls = {{ repository = "https://github.com/vi/websocat.git" }}
[tool.maturin]
bindings = "bin"
manifest-path = "Cargo.toml"
strip = true
""")