Skip to content

Commit

Permalink
Fix Windows release builds
Browse files Browse the repository at this point in the history
* Fix but in versioneer that fails to detect versions on Windows
* Fix PowerShell scripts
* Fix typo in README.md
  • Loading branch information
mducle committed Nov 12, 2021
1 parent 8dc3527 commit 0d08929
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ pace_neutrons --spyder

## Developer notes

Developer documentation is [here](docs/developer.md)
Developer documentation is [here](docs/developers.md)
2 changes: 1 addition & 1 deletion cmake/copy_and_remove_0.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
robocopy "$($args[0])" "$($args[1])" /s
Get-ChildItem "$($args[1])" -recurse | where-object {$_.length -eq 0} | ?{Remove-Item $_.fullname}
Get-ChildItem "$($args[1])" -recurse | where-object {$_.Name -match "_docify"} | ?{Remove-Item $_.fullname -recurse}
Get-ChildItem "$($args[1])" -recurse | where-object {$_.Name -match "@*_old"} | ?{Remove-Item $_.fullname -recurse}
Get-ChildItem "$($args[1])" -recurse | where-object {($_.Name -match "@*_old") -and ($_.GetType().Name -eq "DirectoryInfo")} | ?{Remove-Item $_.fullname -recurse}
13 changes: 12 additions & 1 deletion cmake/run_release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@ $Env:_CONDA_ROOT = "$conda_root_dir"
$Env:_CONDA_EXE = "$conda_root_dir\Scripts\conda.exe"
Import-Module "$Env:_CONDA_ROOT\shell\condabin\Conda.psm1"

Write-and-Invoke "matlab -nodesktop -r \"try, cd('installer'), run('make_package.m'), catch ME, fprintf('%s: %s\n', ME.identifier, ME.message), end, exit\""
# Hard code to use R2020a as it is the mininum version needed for pace_neutrons
Try {
$MATLAB_REG = Get-ItemProperty "Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Mathworks\MATLAB\9.8" -ErrorAction Stop
$MATLAB_EXE = $MATLAB_REG.MATLABROOT + "\bin\matlab.exe"
} Catch {
Write-Output "Could not find Matlab R2020a folder. Using default Matlab"
$MATLAB_EXE = "matlab.exe"
}

$mstr = "try, cd('installer'), run('make_package.m'), catch ME, fprintf('%s: %s\n', ME.identifier, ME.message), end, exit"
Write-and-Invoke "& `'$MATLAB_EXE`' -nosplash -nodesktop -wait -r `"$mstr`""

Write-and-Invoke "Enter-CondaEnvironment pace_neutrons"
Write-and-Invoke "python -m pip install requests pyyaml"
Write-and-Invoke "python release.py --github --notest"
2 changes: 1 addition & 1 deletion pace_neutrons/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
TAG_PREFIX_REGEX = "*"
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
TAG_PREFIX_REGEX = r"\*"
#TAG_PREFIX_REGEX = r"\*"

_, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root,
hide_stderr=True)
Expand Down
4 changes: 2 additions & 2 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
TAG_PREFIX_REGEX = "*"
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
TAG_PREFIX_REGEX = r"\*"
#TAG_PREFIX_REGEX = r"\*"
_, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root,
hide_stderr=True)
Expand Down Expand Up @@ -1165,7 +1165,7 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, runner=run_command):
TAG_PREFIX_REGEX = "*"
if sys.platform == "win32":
GITS = ["git.cmd", "git.exe"]
TAG_PREFIX_REGEX = r"\*"
#TAG_PREFIX_REGEX = r"\*"

_, rc = runner(GITS, ["rev-parse", "--git-dir"], cwd=root,
hide_stderr=True)
Expand Down

0 comments on commit 0d08929

Please sign in to comment.