Skip to content
This repository has been archived by the owner on Jul 22, 2023. It is now read-only.

Commit

Permalink
write version.txt before generating the setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Mar 17, 2015
1 parent eee6ab0 commit 966d5e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions build_setup_help_on_windows.bat
Expand Up @@ -3,6 +3,7 @@ IF EXIST dist del /Q dist\*.*

if "%1"=="" goto default_value:
set pythonexe="%1"
%pythonexe% setup.py write_version
goto custom_python:

:default_value:
Expand Down Expand Up @@ -42,13 +43,15 @@ echo #######################################################
:setup34:
IF NOT EXIST c:\Python34 GOTO utpy34_64:
set pythonexe="c:\Python34\python"
%pythonexe% setup.py write_version
%pythonexe% setup.py clean_pyd
%pythonexe% setup.py build bdist_wininst --plat-name=win-amd64
if %errorlevel% neq 0 exit /b %errorlevel%
echo #######################################################

:utpy34_64:
set pythonexe="c:\Python34_x64\python"
%pythonexe% setup.py write_version
%pythonexe% -u setup.py clean_space
if %errorlevel% neq 0 exit /b %errorlevel%
%pythonexe% -u setup.py unittests
Expand Down
10 changes: 10 additions & 0 deletions setup.py
Expand Up @@ -144,6 +144,16 @@ def import_pyquickhelper():
".sh"])
print("number of impacted files", len(rem))

elif "write_version" in sys.argv:
pyquickhelper = import_pyquickhelper()
from pyquickhelper.loghelper.pyrepo_helper import SourceRepository
src = SourceRepository(commandline=True)
fold = os.path.abspath(os.path.dirname(__file__))
version = src.version(fold)
if version is not None:
with open(os.path.join(fold, "version.txt"), "w") as f:
f.write(str(version) + "\n")

elif "clean_pyd" in sys.argv:
pyquickhelper = import_pyquickhelper()
pyquickhelper.clean_exts()
Expand Down

0 comments on commit 966d5e2

Please sign in to comment.