-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.imake
118 lines (109 loc) · 3.36 KB
/
.imake
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
[build]
description = "Compile the project for publication and installation."
initial_message = "Build project ..."
commands = ["imake binary", "python -m snakypy.zshpower", "poetry build"]
final_message = "Build project terminated!"
[install]
description = "Performs the installation of project dependencies and installs the same."
initial_message = "Installing package and dependencies ..."
commands = ["poetry install"]
final_message = "Installation command terminated!"
[tests]
description = "Perform tests using the Pytest library"
initial_message = "Starting tests with Pytest ..."
commands = ["poetry run pytest"]
final_message = "Test command terminated!"
[tox]
description = "Tests using the Tox library."
initial_message = "Starting tests with Tox ..."
commands = ["poetry run tox"]
final_message = "Test command terminated!"
[binary]
description = "Generate binary"
initial_message = "Generate binary..."
commands = [
"""
pyinstaller binary-command.spec
pyinstaller binary-draw.spec
python -c '
import platform
import shutil
from pathlib import Path
from os.path import join
Path(join("binary", "linux")).mkdir(parents=True, exist_ok=True)
Path(join("binary", "macos")).mkdir(parents=True, exist_ok=True)
if platform.system() == "Linux":
shutil.move(join("dist", "zshpower"), join("binary", "linux", "zshpower"))
shutil.move(join("dist", "zshpower-draw"), join("binary", "linux", "zshpower-draw"))
elif platform.system() == "Darwin":
shutil.move(join("dist", "zshpower"), join("binary", "macos", "zshpower"))
shutil.move(join("dist", "zshpower-draw"), join("binary", "macos", "zshpower-draw"))
'
"""
]
final_message = "Generate binary terminated!"
[linters]
description = "Checks if the project structure is in accordance with certain linters."
initial_message = "Checking project structure with linters ..."
commands = [
"""
poetry run flake8 snakypy/ tests/;
poetry run mypy snakypy/ tests/;
poetry run isort --profile black snakypy/ tests/ --check-only;
poetry run black snakypy/ tests/ --check;
"""
]
final_message = "Linter command terminated!"
[fixup]
description = "Corrects the project structure with certain tools."
initial_message = "Correcting the project structure ..."
commands = [
"""
poetry run isort --profile black snakypy/ tests/;
poetry run black snakypy/ tests/;
"""
]
final_message = "Command to correct structure finished!"
[clean]
description = "Removes insignificant objects."
initial_message = "Starting object cleanup ..."
commands = [
"""
rm -rf dist;
rm -rf .pytest_cache;
rm -rf .tox;
rm -rf .mypy_cache;
rm -rf docs/_build;
"""
]
final_message = "Cleaning command finished!"
[pypi]
#
# Add configuration: poetry config repositories.pypi https://upload.pypi.org/legacy/
#
description = "Publish this project to the Pypi repository."
initial_message = "Publishing package to the Pypi repository ..."
commands = [
"""
rm -f dist/*;
python -m snakypy.zshpower;
poetry build;
poetry publish -r pypi -u williamcanin;
"""
]
final_message = "Publishing command terminated!"
[testpypi]
#
# Add configuration: poetry config repositories.testpypi https://test.pypi.org/legacy/
#
description = "Publish this project to the TestPypi repository."
initial_message = "Publishing package to the TestPypi repository ..."
commands = [
"""
rm -f dist/*;
python -m snakypy.zshpower;
poetry build;
poetry publish -r testpypi -u williamcanin;
"""
]
final_message = "Publishing command terminated!"