mirror of
https://github.com/cryptoadvance/specter-desktop.git
synced 2026-08-13 12:33:29 +02:00
fix release_helper lazy gl property (#2448)
* fix release_helper lazy gl property * make osx build script work with pyenv --------- Co-authored-by: Manolis <moneymanolis@protonmail.com>
This commit is contained in:
parent
50b5d6330e
commit
c2cd77f21b
2 changed files with 19 additions and 13 deletions
|
|
@ -12,11 +12,14 @@ function create_virtualenv_for_pyinstaller {
|
|||
# This currently assumes to be run with: Python 3.10.11
|
||||
# Important: pyinstaller needs a Python binary with shared library files
|
||||
# With pyenv, for example, you get this like so: env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.10.4
|
||||
# Use pyenv if available
|
||||
#if command -v pyenv >/dev/null 2>&1; then
|
||||
if /bin/false ; then
|
||||
# Use pyenv if set as environment variable
|
||||
if [ $USE_PYENV_FOR_SPECTER_BUILD = true ]; then
|
||||
echo "Trying to use pyenv ..."
|
||||
if ! command -v pyenv >/dev/null 2>&1; then
|
||||
echo "Error: pyenv is not available. Please make sure pyenv is installed and configured properly." >&2
|
||||
exit 1
|
||||
fi
|
||||
### This is usually in .zshrc, putting it in .bashrc didn't work ###
|
||||
###
|
||||
export PYENV_ROOT="$HOME/.pyenv"
|
||||
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
|
||||
eval "$(pyenv init -)"
|
||||
|
|
@ -26,11 +29,11 @@ function create_virtualenv_for_pyinstaller {
|
|||
### ------------------------------------------------------------ ###
|
||||
PYTHON_VERSION=3.10.11
|
||||
export PYENV_VERSION=$PYTHON_VERSION
|
||||
echo "pyenv is available. Setting PYENV_VERSION to 3.10.4, using pyenv-virtualenv to create the buildenv..."
|
||||
echo "Setting PYENV_VERSION to 3.10.11, using pyenv-virtualenv to create the buildenv..."
|
||||
echo " --> Deleting .buildenv"
|
||||
pyenv uninstall -f .buildenv
|
||||
rm -rf "$HOME/.pyenv/versions/$PYTHON_VERSION/envs/.buildenv"
|
||||
pyenv virtualenv 3.10.4 .buildenv
|
||||
pyenv virtualenv 3.10.11 .buildenv
|
||||
pyenv activate .buildenv
|
||||
else
|
||||
echo "pyenv is not available. Using system Python version."
|
||||
|
|
|
|||
|
|
@ -217,25 +217,26 @@ class ReleaseHelper:
|
|||
|
||||
@property
|
||||
def gl(self):
|
||||
# https://python-gitlab.readthedocs.io/en/stable/api-usage.html
|
||||
import gitlab
|
||||
"""https://python-gitlab.readthedocs.io/en/stable/api-usage.html"""
|
||||
if hasattr(self, "_gl"):
|
||||
return self._gl
|
||||
|
||||
if os.environ.get("GITLAB_PRIVATE_TOKEN"):
|
||||
logger.info("Using GITLAB_PRIVATE_TOKEN")
|
||||
gl = gitlab.Gitlab(
|
||||
self._gl = gitlab.Gitlab(
|
||||
"http://gitlab.com",
|
||||
private_token=os.environ.get("GITLAB_PRIVATE_TOKEN"),
|
||||
)
|
||||
elif os.environ.get("CI_JOB_TOKEN"):
|
||||
logger.info("Using CI_JOB_TOKEN")
|
||||
self.gl = gitlab.Gitlab(
|
||||
self._gl = gitlab.Gitlab(
|
||||
"http://gitlab.com", job_token=os.environ["CI_JOB_TOKEN"]
|
||||
)
|
||||
else:
|
||||
raise Exception(
|
||||
"Can't authenticate against Gitlab ( export GITLAB_PRIVATE_TOKEN )"
|
||||
)
|
||||
return gl
|
||||
return self._gl
|
||||
|
||||
@property
|
||||
def gitlab_project(self):
|
||||
|
|
@ -277,7 +278,9 @@ class ReleaseHelper:
|
|||
)
|
||||
if project.name_with_namespace.startswith("cryptoadvance"):
|
||||
self._ci_project_id = project.id
|
||||
logger.warn("{self._ci_project_id} has been chosen as self._ci_project_id")
|
||||
logger.warning(
|
||||
f"{self._ci_project_id} has been chosen as self._ci_project_id"
|
||||
)
|
||||
return self._ci_project_id
|
||||
|
||||
@property
|
||||
|
|
@ -312,7 +315,7 @@ class ReleaseHelper:
|
|||
)
|
||||
else:
|
||||
self._ci_project_root_namespace = "cryptoadvance"
|
||||
logger.warn(
|
||||
logger.warning(
|
||||
f"Using project_root_namespace: {self._ci_project_root_namespace} ( export CI_PROJECT_ROOT_NAMESPACE={self._ci_project_root_namespace} )"
|
||||
)
|
||||
return self._ci_project_root_namespace
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue