-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2download.bat
More file actions
50 lines (50 loc) · 2.26 KB
/
Copy path2download.bat
File metadata and controls
50 lines (50 loc) · 2.26 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
@echo off
::set TEST_MODE=TRUE
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Determine directory/project name
set "mydir=%~dp0"
set "mydir=%mydir:~0,-1%"
for /f %%i in ("%mydir%") do set "mydir=%%~ni"
for /f %%i in ('setup.py --name') do set "myprj=%%i"
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Check/create virtual environment
set "venv_dir=..\%mydir%.virtenv"
if not exist %venv_dir% (
echo **********************************************************************
echo *** venv %venv_dir%
echo **********************************************************************
python -m venv %venv_dir%
call %venv_dir%\Scripts\activate.bat
python -m pip install pytest
)
call %venv_dir%\Scripts\activate.bat
pushd %venv_dir%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo **********************************************************************
echo *** pip show %myprj%
echo **********************************************************************
python -m pip show %myprj%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Download
if not "%TEST_MODE%"=="" (
set "test_dnload=-i https://test.pypi.org/simple/"
set "test_upload=--repository testpypi"
rem Because of not all required packages are in test repository,
rem we need to install them from the main
python -m pip install --upgrade xmltodict
)
echo **********************************************************************
echo *** pip install --upgrade %test_dnload% %myprj%
echo **********************************************************************
python -m pip install --upgrade %test_dnload% %myprj%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo **********************************************************************
echo *** pip show %myprj%
echo **********************************************************************
python -m pip show %myprj%
echo **********************************************************************
echo *** pytest --pyargs %myprj%
echo **********************************************************************
pytest --pyargs %myprj%
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
popd