Skip to content

Commit 20a3b36

Browse files
authored
Merge pull request #972 from I2PC/release-3.24.12
colectin tag name or branch
2 parents 4e2b285 + e202bb0 commit 20a3b36

File tree

4 files changed

+33
-14
lines changed

4 files changed

+33
-14
lines changed

installer/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
# Self imports
3636
from .cmake import parseCmakeVersions
37-
from .utils import runJob, getCurrentBranch, isBranchUpToDate, runParallelJobs
37+
from .utils import runJob, getCurrentName, isBranchUpToDate, runParallelJobs
3838
from .constants import (API_URL, LOG_FILE, TAIL_LOG_NCHARS, UNKNOWN_VALUE,
3939
XMIPP_VERSIONS, XMIPP, VERSION_KEY, MASTER_BRANCHNAME, VERSION_FILE, CMAKE_PYTHON,
4040
CMAKE_CUDA, CMAKE_MPI, CMAKE_HDF5, CMAKE_JPEG, CMAKE_SQLITE, CMAKE_JAVA,
@@ -124,7 +124,7 @@ def __getJSON(retCode: int=0) -> Optional[Dict]:
124124
jsonData = runParallelJobs([
125125
(getOSReleaseName, ()),
126126
(__getCPUFlags, ()),
127-
(getCurrentBranch, ()),
127+
(getCurrentName, ()),
128128
(isBranchUpToDate, ()),
129129
(__getLogTail, ())
130130
])

installer/constants/versions.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
from .main import XMIPP, XMIPP_CORE, XMIPP_VIZ, XMIPP_PLUGIN
2929

3030
# Xmipp's current versions
31-
__LATEST_RELEASE_NUMBER = '3.24.12.0'
32-
__LATEST_RELEASE_NAME = 'v3.24.12.0-Poseidon'
31+
LATEST_RELEASE_NUMBER = '3.24.12.0'
32+
LATEST_RELEASE_NAME = 'v3.24.12.0-Poseidon'
3333
RELEASE_DATE = '23/12/2024'
3434
#####################################
3535
DEVEL_BRANCHNAME = 'devel'
@@ -39,20 +39,20 @@
3939
VERNAME_KEY = 'vername'
4040
XMIPP_VERSIONS = {
4141
XMIPP: {
42-
VERSION_KEY: __LATEST_RELEASE_NUMBER,
43-
VERNAME_KEY: __LATEST_RELEASE_NAME
42+
VERSION_KEY: LATEST_RELEASE_NUMBER,
43+
VERNAME_KEY: LATEST_RELEASE_NAME
4444
},
4545
XMIPP_CORE: {
46-
VERSION_KEY: __LATEST_RELEASE_NUMBER,
47-
VERNAME_KEY: __LATEST_RELEASE_NAME
46+
VERSION_KEY: LATEST_RELEASE_NUMBER,
47+
VERNAME_KEY: LATEST_RELEASE_NAME
4848
},
4949
XMIPP_VIZ: {
50-
VERSION_KEY: __LATEST_RELEASE_NUMBER,
51-
VERNAME_KEY: __LATEST_RELEASE_NAME
50+
VERSION_KEY: LATEST_RELEASE_NUMBER,
51+
VERNAME_KEY: LATEST_RELEASE_NAME
5252
},
5353
XMIPP_PLUGIN: {
54-
VERSION_KEY: __LATEST_RELEASE_NUMBER,
55-
VERNAME_KEY: __LATEST_RELEASE_NAME
54+
VERSION_KEY: LATEST_RELEASE_NUMBER,
55+
VERNAME_KEY: LATEST_RELEASE_NAME
5656
}
5757
}
5858
#####################################

installer/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from typing import Tuple, Optional
3131

3232
# Module imports
33-
from .utils import runJob, getCurrentBranch, isProductionMode
33+
from .utils import runJob, getCurrentBranch, isProductionMode, getCurrentName
3434
from .logger import logger, yellow, green, bold
3535
from .constants import (REPOSITORIES, XMIPP_SOURCES, SOURCES_PATH, MASTER_BRANCHNAME,
3636
SOURCE_CLONE_ERROR, TAG_BRANCH_NAME, INTERRUPTED_ERROR, VERSION_FILE, RELEASE_DATE,
@@ -101,7 +101,7 @@ def getSuccessMessage() -> str:
101101
- (str): Success message.
102102
"""
103103
# Getting release name
104-
branchName = getCurrentBranch()
104+
branchName = getCurrentName()
105105
releaseName = branchName
106106
if branchName is None or branchName == MASTER_BRANCHNAME:
107107
releaseName = XMIPP_VERSIONS[XMIPP][VERSION_KEY]

installer/utils.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535

3636
# Installer imports
3737
from .constants import XMIPP, VERNAME_KEY, XMIPP_VERSIONS, INTERRUPTED_ERROR
38+
from .constants.versions import LATEST_RELEASE_NAME
3839
from .logger import blue, red, logger
3940

4041
####################### RUN FUNCTIONS #######################
@@ -215,6 +216,24 @@ def isTag(dir: str='./') -> bool:
215216
currentBranch = getCurrentBranch(dir=dir)
216217
return not currentBranch or currentBranch == "HEAD"
217218

219+
220+
def getCurrentName():
221+
"""
222+
### This function returns the current branch of the repository of the given directory or the name of the tag.
223+
224+
#### Params:
225+
- dir (str): Optional. Directory of the repository where the check will happen. Default is current directory.
226+
227+
#### Returns:
228+
- (str): The name of the branch or the tag.
229+
"""
230+
if isTag():
231+
return LATEST_RELEASE_NAME
232+
else:
233+
return getCurrentBranch()
234+
235+
236+
218237
def isBranchUpToDate(dir: str='./') -> bool:
219238
"""
220239
### This function returns True if the current branch is up to date, or False otherwise or if some error happened.

0 commit comments

Comments
 (0)