diff --git a/.gitlabci/prepare.sh b/.gitlabci/prepare.sh index 1ccf61d3ad726945135a48978b9e28ae8d44c355..ea34c9c50eab28d45f751cfd9e321081ef073b1a 100755 --- a/.gitlabci/prepare.sh +++ b/.gitlabci/prepare.sh @@ -6,7 +6,7 @@ echo "+ downloading src..." SRC_URL=${ROOT_URL}/src.git git clone ${SRC_URL} src # creates main branches -(cd src ; git checkout v15 ; git checkout main) +(cd src ; git checkout v16 ; git checkout main) echo "+ downloading the runner image..." source src/env.d/version.sh diff --git a/.gitlabci/test.sh b/.gitlabci/test.sh index 24583808ed4e50d3463dfbd5f281dec9c43a550b..0ccc42df8f371e82f59bf9c71a29059d937ad047 100755 --- a/.gitlabci/test.sh +++ b/.gitlabci/test.sh @@ -9,7 +9,11 @@ git fetch --unshallow # path to the src clone export CODEASTER_SRC=$(pwd)/src # configure src -(cd $CODEASTER_SRC ; ./configure) +( + cd $CODEASTER_SRC ; + git tag -d stable || true # waiting fix in '_gettag()' + ./configure +) cd share/test . env_test.sh diff --git a/.hgignore b/.hgignore deleted file mode 100644 index 54fa3997b40e48f55f049a4886cad91f752f0e08..0000000000000000000000000000000000000000 --- a/.hgignore +++ /dev/null @@ -1,10 +0,0 @@ -syntax: regexp -.*\.pyc$ -.*/aslint\..*\.mo$ -^lib/aslint/fortran/tools/convert$ - -^nosetests.xml$ -\.coverage$ -\.coverage\..* - -share/test/Testing diff --git a/.hgtags b/.hgtags deleted file mode 100644 index 18e12ca813f55c99ceb2f8d5b7546393934592e2..0000000000000000000000000000000000000000 --- a/.hgtags +++ /dev/null @@ -1,4 +0,0 @@ -112c635c5ce1d12228a1a0ead06004402a5367c0 python2 -1b6a65a84514237c50dd9d870fc6a0f8d4e4692c 14.4.0 -1b6a65a84514237c50dd9d870fc6a0f8d4e4692c 13.8.0 -574ebca5aae658facb0b3da8633e3f75cc24a7db 15.1.23 diff --git a/bin/maint/aster_crowdin b/bin/maint/aster_crowdin deleted file mode 100755 index 8333b7701d65342b36d153e6e504f291b103d0da..0000000000000000000000000000000000000000 --- a/bin/maint/aster_crowdin +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/bash - -if [ $# -ge 1 ] && ( [ "$1" = '-h' ] || [ "$1" = "--help" ] ); then - echo "usage: $0 [-h|--help] [--no-proxy] [--after-download] [--after-build] [--after-commit]" - echo " This script " - echo " - builds a package of the translated strings" - echo " - downloads the '.po' files from crowdin.net" - echo " - updates the translation files in the source tree 'src/i18n'" - echo " - merges them with the new strings (from 'aster_messages.pot')" - echo " - commits the merged files in the source tree" - echo " - uploads the new '.po' files to crowdin.net" - echo " " - echo " It must be run from the code_aster 'src' repository." - echo " " - echo " The order of the options is important." - exit 1 -fi - -use_proxy=1 -if [ $# -ge 1 ] && [ "$1" = "--no-proxy" ]; then - use_proxy=0 - shift 1 -fi - -start_at=0 -if [ $# -ge 1 ] && [ "$1" = "--after-download" ]; then - start_at=1 - shift 1 -fi -if [ $# -ge 1 ] && [ "$1" = "--after-build" ]; then - start_at=2 - shift 1 -fi -if [ $# -ge 1 ] && [ "$1" = "--after-commit" ]; then - start_at=3 - shift 1 -fi - -set_prefix() { - local this=`readlink -n -f $1` - prefix=`dirname $this` -} - -set_prefix $0 - -project=code-aster -if [ -z "${key}" ]; then - echo "Please define the environment variable 'key' with the API key of the code_aster Crowdin project." - exit 1 -fi - -url=https://api.crowdin.com/api/project/${project} - -# printf "options:\n use_proxy=${use_proxy}\n start_at=${start_at}\n" ; exit 1 -ALL_LANG="en ja ro" - -if [ $use_proxy -eq 1 ]; then - # enable EDF proxy - ${prefix}/proxy_auth.py - export http_proxy=proxypac.edf.fr:3128 - export https_proxy=proxypac.edf.fr:3128 -fi - -if [ ${start_at} -le 0 ]; then - printf "\n>>> building a fresh package (may take few minutes)...\n" - curl -m 600 ${url}/export?key=${key} - - for lang in ${ALL_LANG} - do - zipfile=/tmp/${lang}.zip - printf "\n>>> downloading a zip file of ${lang} translations...\n" - printf " If it fails, download the file manually as '${zipfile}',\n" - printf " and restart 'aster_crowdin --after-download'\n" - rm -f ${zipfile} - wget ${url}/download/${lang}.zip?key=${key} -O ${zipfile} - if [ ! -f ${zipfile} ]; then - printf " Failure during downloading a new archive!\n" - printf " Try to download it manually using:\n" - printf " wget ${url}/download/${lang}.zip?key=${key} -O ${zipfile}\n\n" - printf " and restart 'aster_crowdin --after-download'\n" - exit 4 - fi - done -fi - -if [ ${start_at} -le 1 ]; then - # extract the archive - printf "\n>>> extracting files in the source tree...\n" - cd i18n - for lang in ${ALL_LANG} - do - zipfile=/tmp/${lang}.zip - # it will create a 'aster' subdirectory - unzip -u -o ${zipfile} 'code_aster/*/aster-messages*' 'code_aster/*/catapy_*' - done - cd code_aster - # check that file for 'en' exists - if [ ! -f en-US/aster-messages.po ]; then - echo "no such file in package: en-US/aster-messages.po" - echo "check export parameters on crowdin." - exit 4 - fi - if [ ! -f en-US/catapy_en_US.ts ]; then - echo "no such file in package: catapy_en_US.ts" - echo "check export parameters on crowdin." - exit 4 - fi - for dir in *; do - mkdir -p ../${dir} - cp ${dir}/aster-messages.po ../${dir}/aster_messages.po - cp ${dir}/catapy_*.ts .. - done - cd .. - rm -rf code_aster - cd .. - - # extract all the strings from the source files and update the ``.po`` files - printf "\n>>> running 'waf i18n'...\n" - waf i18n - - # check the build - printf "\n>>> running 'waf build install'...\n" - waf build install test -n supv002a - iret=$? - if [ ${iret} -ne 0 ]; then - printf " 'waf build install' failed\n" - printf " Fix the build and install manually and restart 'aster_crowdin --after-build'\n" - exit 4 - fi -fi - -if [ ${start_at} -le 2 ]; then - # update the 'src' tree by running: - cp -r build/std/release/i18n_updated/* i18n/ - hg add i18n/*/*.po i18n/catapy_*.ts - hg ci -u 'code_aster <code-aster@edf.fr>' \ - -m '[i18n] update translations from Crowdin code_aster project' i18n - hg parent - - # check the build - printf "\n>>> running 'waf build install'...\n" - waf build install - iret=$? - if [ ${iret} -ne 0 ]; then - printf " 'waf build install' failed\n" - printf " Fix the build and install manually and restart 'aster_crowdin --after-commit'\n" - printf " Amend the revision before continue.\n" - exit 4 - fi -fi - -if [ ${start_at} -le 3 ]; then - # update `aster_messages.pot` file as `code_aster.po` - tmpf=`tempfile` - printf "\n>>> updating 'aster_messages.pot' (as 'code_aster.po') on crowdin...\n" - curl -m 600 -o ${tmpf} \ - -F "files[v15/code_aster.po]=@build/std/release/i18n/aster_messages.pot" \ - ${url}/update-file?key=${key} - if [ `grep -c '<success>' ${tmpf}` -ne 1 ]; then - printf "WARNING: update 'aster_messages.pot' failed!\nOutput:\n" - cat ${tmpf} - fi - curl -m 600 -o ${tmpf} \ - -F "files[v15/aster_catapy.ts]=@build/std/release/i18n/catapy_en_US.ts" \ - ${url}/update-file?key=${key} - if [ `grep -c '<success>' ${tmpf}` -ne 1 ]; then - printf "WARNING: update 'catapy_en_US.ts' failed!\nOutput:\n" - cat ${tmpf} - fi -fi - -if [ $use_proxy -eq 1 ]; then - # unset proxy variables - unset http_proxy - unset https_proxy -fi -exit 0 diff --git a/bin/maint/create_source_snapshot b/bin/maint/create_source_snapshot deleted file mode 100755 index 1b0f9c9751090b6e64421696ed7b0080a2a782b5..0000000000000000000000000000000000000000 --- a/bin/maint/create_source_snapshot +++ /dev/null @@ -1,92 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -"""%prog [options] DEST - -This script creates a snapshot of the source tree. -It may be run to build a nightly snapshot or an archive for a tagged version. - -The archive is written onto DEST (DEST will be a tar archive, compressed -using gzip). -""" - -import os -import os.path as osp -import re -import tempfile -from optparse import OptionParser -from subprocess import PIPE, Popen, check_call - -from aslint.i18n import _ -from aslint.logger import logger, setlevel -from aslint.string_utils import convert -from aslint.utils import clean_dir - -REPODIR = osp.join(os.environ['HOME'], 'dev', 'codeaster', 'src') - - -def create_snapshot(fname, repopath, tag, pkg): - """Create a snapshot of the source tree""" - tag = tag or 'default' - pkg = pkg or 'aster-%s' % tag - logger.info(_("creating snapshot of %s at tag %s"), repopath, tag) - tmpdir = tempfile.mkdtemp() - dest = osp.join(tmpdir, pkg) - # create snapshot directory - cmd = ['hg', 'archive', '-R', repopath, - '--rev', tag, - '--exclude', osp.join(repopath, '.hg*'), - '--type', 'files', - dest] - logger.debug('command line: %s', cmd) - check_call(cmd) - # add pkginfo - get version number from tag (15.2.0 or v15.2_smeca) - mat = re.search(r"(?P<vers>[0-9]+\.[0-9]+(?:\.[0-9]+)?)", tag) - tagspl = [int(i) for i in mat.group("vers").split('.')] - tagspl = tuple(tagspl[:3] + ([0] * (3 - len(tagspl)))) - hglog = ['hg', 'log', '-R', repopath, '--rev', tag] - branch = convert(Popen(hglog + ['--template', '{branch}'], - stdout=PIPE).communicate()[0]) - rev = convert(Popen(hglog + ['--template', '{node|short}'], - stdout=PIPE).communicate()[0]) - date = convert(Popen(hglog + ['--template', "{date(date,'%d/%m/%Y')}"], - stdout=PIPE).communicate()[0]) - pkginfo = [tagspl, rev, branch, date, branch, 0, []] - cnt = os.linesep.join(["# coding=utf-8", "pkginfo = %r" % pkginfo, ""]) - if tagspl < (15, 2): - fpkg = osp.join(dest, 'bibpyt', 'pkginfo.py') - else: - fpkg = osp.join(dest, 'code_aster', 'Utilities', 'pkginfo.py') - with open(fpkg, 'w') as fobj: - fobj.write(cnt) - logger.info(_("writing in %s:\n%s"), fpkg, cnt) - # archive - arch = ['tar', 'czf', osp.abspath(fname), pkg] - logger.debug('command line: %s', arch) - logger.info(_("archiving %s into %s"), pkg, fname) - prev = os.getcwd() - os.chdir(tmpdir) - check_call(arch) - os.chdir(prev) - logger.info(_("cleaning %s"), tmpdir) - clean_dir(tmpdir) - -if __name__ == '__main__': - # command arguments parser - parser = OptionParser(usage=__doc__) - parser.add_option('-g', '--debug', action='callback', callback=setlevel, - help="add debug informations") - parser.add_option('--repo', action='store', default=REPODIR, - help="path to the src repository " - "(default: %s)" % REPODIR) - parser.add_option('--tag', action='store', default=None, - help="build an archive of a selected tag. If --tag is " - "provided and it is not a branch name, " - "a file bibpyt/pkginfo.py will be added in " - "the archive.") - parser.add_option('--pkg', action='store', default=None, - help="name of the package (and base directory)") - opts, args = parser.parse_args() - if len(args) != 1: - parser.error("exactly one argument is required!") - create_snapshot(args[0], opts.repo, opts.tag, opts.pkg) diff --git a/lib/aslint/config.py b/lib/aslint/config.py index 5fc4cf6ec1d27d336836ff4e6327f1238d23e6fe..9e0d0c60ff4e3a40b4c67c51374d314e679f3f39 100644 --- a/lib/aslint/config.py +++ b/lib/aslint/config.py @@ -190,7 +190,7 @@ class AsterCfgSection(object): # pragma pylint: disable=R0902 self.rex_write_user = _read("rex.write_user") self.rex_write_password = UNCACHED self.doc_mirror = "aster-services.der.edf.fr/doc" - self.branches = ("main", "v15") + self.branches = ("main", "v16") self.docaster_uri = _read("docaster_uri", DOCASTER_URI) # tools self.clang_format = _read("clang_format", UNCACHED) @@ -288,13 +288,13 @@ class AsterCfgSection(object): # pragma pylint: disable=R0902 def check_init(self): """Force initialization of required parameters""" username = self.get("username") - assert username is not None, ( - "invalid username, check the [user] section of your ~/.gitconfig file" - ) + assert ( + username is not None + ), "invalid username, check the [user] section of your ~/.gitconfig file" email = self.get("notify.user") - assert email is not None, ( - "invalid email address, check the [user] section of your ~/.gitconfig file" - ) + assert ( + email is not None + ), "invalid email address, check the [user] section of your ~/.gitconfig file" def clean(self, name): """Remove a temporary directory and reset value as uncached diff --git a/share/examples/cron_cluster b/share/examples/cron_cluster deleted file mode 100755 index a55b14101efb73fcf180f67b97f41a9d714f7e14..0000000000000000000000000000000000000000 --- a/share/examples/cron_cluster +++ /dev/null @@ -1,62 +0,0 @@ -#!/bin/bash - -# $HOME/dev/codeaster/devtools/share/examples/cron_cluster std default -# $HOME/dev/codeaster/devtools/share/examples/cron_cluster mpi default -# -# $HOME/dev/codeaster/devtools/share/examples/cron_cluster std v15 -# $HOME/dev/codeaster/devtools/share/examples/cron_cluster mpi v15 - -set_prefix() { - local this=$(readlink -n -f "$1") - devtools=$(dirname $(dirname $(dirname "${this}"))) - DEV=$(dirname $(dirname "${devtools}")) -} - -set_prefix "${0}" - -if [ $# -eq 1 ] && [ "$1" = "-h" ]; then - echo "usage: $0 [VARIANT [BRANCH]]" - echo " This script update the development (minor) version" - echo " and run the testcases." - echo " " - echo " BRANCH: is 'default' by default or another branch name." - exit 1 -fi -VARIANT=$1 -if [ -z "${VARIANT}" ]; then - VARIANT=std -fi -SUFFIX="_${VARIANT}" -BUILD="build/${VARIANT}" -if [ "${VARIANT}" = "std" ]; then - SUFFIX="" -fi - -BR=$2 -NAME="unstable" -if [ -z "${BR}" ]; then - BR=default -fi -if [ "${BR}" != "default" ]; then - NAME="stable-updates" -fi - -ENV=${devtools}/etc/env_${NAME}${SUFFIX}.sh -. ${ENV} - -flog=${DEV}/log/daily_${BR}${SUFFIX}.log - -# install in ${ASTER_INSTALLROOT}/install/... + run src -${devtools}/bin/update_minor_version ${VARIANT} ${BR} -iret=$? - -# run verification tests from validation -if [ ${iret} -eq 0 ]; then - export WAF_SUFFIX="${VARIANT}" - ${devtools}/bin/run_testcases \ - --root=${DEV}/codeaster-${BR} \ - --builddir=${BUILD} --testlist=verification_intra \ - --resutest=${DEV}/resu_test/${BR}${SUFFIX}/validation \ - --timefactor=1.0 --notify-resutest --clean \ - >> ${flog} 2>&1 -fi diff --git a/share/examples/cron_parallel b/share/examples/cron_parallel deleted file mode 100755 index d3b56071ebaf51e8861c0a8ec3374510fa60e37a..0000000000000000000000000000000000000000 --- a/share/examples/cron_parallel +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# -# daily script in crontab: - -set_prefix() { - local this=$(readlink -n -f "$1") - local bindir=$(dirname "${this}") - devtools=$(dirname "${bindir}") -} - -set_prefix "${0}" - -${devtools}/bin/update_minor_version mpi default -${devtools}/bin/update_minor_version mpi v15 diff --git a/share/examples/cron_sequential b/share/examples/cron_sequential deleted file mode 100755 index 5bf6c0295492148576cab908cb9bb3be065e93d3..0000000000000000000000000000000000000000 --- a/share/examples/cron_sequential +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash -# -# daily script in crontab: - -set_prefix() { - local this=$(readlink -n -f "$1") - local bindir=$(dirname "${this}") - devtools=$(dirname "${bindir}") -} - -set_prefix "${0}" - -${devtools}/bin/update_minor_version std default -${devtools}/bin/update_minor_version std v15