-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.py
executable file
·81 lines (73 loc) · 1.59 KB
/
build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/python
# license is gnu agpl 3 - gnu.org/licenses/agpl-3.0.en.html
from pathlib import Path
import subprocess
import shutil
import toml
import sys
from setup import (
app_name,
)
from anarchy_bot.config import (
app_version,
)
from setup import (
dependencies,
app_name,
)
app_path = Path(
__file__
).parent.resolve()
pypr_path = app_path / 'pyproject.toml'
dist_path = app_path / 'dist'
description = 'true anarchy in telegram chats'
pypr_data = {
'build-system': {
'requires': ['hatchling'],
'build-backend': 'hatchling.build',
},
'project': {
'dependencies': dependencies,
'name': app_name,
'version': app_version,
'authors': [
{
'name': 'gmanka',
'email': '[email protected]',
},
],
'description': description,
'readme': 'readme.md',
'requires-python': '>=3.10',
'classifiers': [
'Programming Language :: Python :: 3',
'Operating System :: OS Independent',
],
'urls': {
'Documentation': 'https://t.me/gmanka',
'Bug Tracker': 'https://t.me/gmanka',
'Homepage': 'https://t.me/gmanka',
}
}
}
with open(
pypr_path,
'w',
) as file:
file.write(
toml.dumps(
pypr_data
)
)
shutil.rmtree(
dist_path,
ignore_errors = True,
)
subprocess.run(
[sys.executable, '-m', 'hatchling', 'build'],
check=True,
)
subprocess.run(
[sys.executable, '-m', 'twine', 'upload', 'dist/*'],
check=True,
)