-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathmake.bat
More file actions
219 lines (187 loc) · 4.91 KB
/
Copy pathmake.bat
File metadata and controls
219 lines (187 loc) · 4.91 KB
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
@echo off
REM Batch file for d365fo-client Python package (Windows equivalent of Makefile)
REM Use this with 'make.bat <target>' on Windows
if "%1"=="help" goto help
if "%1"=="dev-setup" goto dev-setup
if "%1"=="install" goto install
if "%1"=="install-dev" goto install-dev
if "%1"=="format" goto format
if "%1"=="format-check" goto format-check
if "%1"=="lint" goto lint
if "%1"=="lint-fix" goto lint-fix
if "%1"=="type-check" goto type-check
if "%1"=="quality-check" goto quality-check
if "%1"=="test" goto test
if "%1"=="test-unit" goto test-unit
if "%1"=="test-integration" goto test-integration
if "%1"=="test-verbose" goto test-verbose
if "%1"=="test-coverage" goto test-coverage
if "%1"=="clean" goto clean
if "%1"=="build" goto build
if "%1"=="publish-test" goto publish-test
if "%1"=="publish" goto publish
if "%1"=="run" goto run
if "%1"=="shell" goto shell
if "%1"=="pre-commit-install" goto pre-commit-install
if "%1"=="pre-commit" goto pre-commit
if "%1"=="all" goto all
if "%1"=="ci" goto ci
if "%1"=="security-check" goto security-check
if "%1"=="info" goto info
if "%1"=="dev" goto dev
if "%1"=="" goto help
echo Unknown target: %1
goto help
:help
echo Available targets:
echo help Show this help message
echo dev-setup Set up development environment
echo install Install package dependencies
echo install-dev Install package with development dependencies
echo format Format code with black and isort
echo format-check Check code formatting without making changes
echo lint Run linting with ruff
echo lint-fix Run linting with automatic fixes
echo type-check Run type checking with mypy
echo quality-check Run all code quality checks
echo test Run tests
echo test-unit Run unit tests only
echo test-integration Run integration tests only
echo test-verbose Run tests with verbose output
echo test-coverage Run tests with coverage report
echo clean Clean build artifacts
echo build Build package
echo publish-test Publish to Test PyPI
echo publish Publish to PyPI
echo run Run the application
echo shell Open Python shell with package installed
echo pre-commit-install Install pre-commit hooks
echo pre-commit Run pre-commit hooks on all files
echo all Run quality checks, tests, and build
echo ci Run CI pipeline
echo security-check Run security checks
echo info Show environment information
echo dev Quick development check
goto end
:dev-setup
echo Setting up development environment...
uv sync
uv add --dev pytest black isort mypy ruff pre-commit pytest-cov pip-audit
echo Development environment setup complete!
goto end
:install
uv sync
goto end
:install-dev
uv sync --dev
goto end
:format
echo Formatting code...
uv run black .
uv run isort .
echo Code formatting complete!
goto end
:format-check
echo Checking code formatting...
uv run black --check .
uv run isort --check-only .
goto end
:lint
uv run ruff check .
goto end
:lint-fix
uv run ruff check --fix .
goto end
:type-check
uv run mypy src/
goto end
:quality-check
echo Running all code quality checks...
call %0 format-check
call %0 lint
call %0 type-check
goto end
:test
uv run pytest
goto end
:test-unit
uv run pytest tests/unit
goto end
:test-integration
uv run pytest tests/integration
goto end
:test-verbose
uv run pytest -v
goto end
:test-coverage
uv run pytest --cov=d365fo_client --cov-report=html --cov-report=term
goto end
:clean
echo Cleaning build artifacts...
if exist dist rmdir /s /q dist
if exist build rmdir /s /q build
if exist *.egg-info rmdir /s /q *.egg-info
if exist src\*.egg-info rmdir /s /q src\*.egg-info
for /d /r . %%d in (__pycache__) do @if exist "%%d" rmdir /s /q "%%d"
for /d /r . %%d in (.pytest_cache) do @if exist "%%d" rmdir /s /q "%%d"
for /d /r . %%d in (.mypy_cache) do @if exist "%%d" rmdir /s /q "%%d"
del /s /q *.pyc 2>nul
echo Clean complete!
goto end
:build
call %0 clean
uv build
goto end
:publish-test
call %0 build
uv publish --repository testpypi
goto end
:publish
call %0 build
uv publish
goto end
:run
uv run d365fo-client
goto end
:shell
uv run python
goto end
:pre-commit-install
uv run pre-commit install
goto end
:pre-commit
uv run pre-commit run --all-files
goto end
:all
echo Running comprehensive checks...
call %0 quality-check
call %0 test
call %0 build
goto end
:ci
echo Running CI pipeline...
call %0 install-dev
call %0 quality-check
call %0 test
goto end
:security-check
uv run pip-audit
goto end
:info
echo Python version:
uv run python --version
echo.
echo Package version:
uv run python -c "import d365fo_client; print(d365fo_client.__version__)"
echo.
echo Installed packages:
uv pip list
goto end
:dev
echo Running quick development check...
call %0 format
call %0 lint
call %0 type-check
call %0 test
goto end
:end