diff --git a/.gitignore b/.gitignore index 108141c2..412ec701 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ node_modules -vstutils/static/bundle +vstutils/static/spa +vstutils_utils/target +vstutils_tools/target *.pyc *.c *.so diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6e578540..3c2a0edf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,6 @@ variables: RESTORE_CACHE_ATTEMPTS: 3 DJANGO_LOG_LEVEL: 'CRITICAL' TOX_ARGS: "--workdir /cache/.tox_vstutils_${CI_COMMIT_REF_NAME}" - CC: "ccache gcc" UWSGI_PROFILE: "minimal" stages: @@ -30,6 +29,7 @@ stages: variables: TOX_ENVS: "" YARN_CACHE_FOLDER: "${CI_PROJECT_DIR}/yarn" + CC: "ccache gcc" before_script: - > if [ "${CI_COMMIT_REF_NAME}" != "master" -a "${CI_COMMIT_REF_NAME}" != "developer" ]; then @@ -50,7 +50,7 @@ stages: .js_tests_template: &branch_js_tests <<: *branch_tests - image: registry.gitlab.com/vstconsulting/images:node18-tests + image: registry.gitlab.com/vstconsulting/images:node20-tests before_script: - yarn install --pure-lockfile --mutex network script: @@ -62,10 +62,8 @@ code_style: parallel: matrix: - TOX_ENVS: - - flake - - mypy - - pylint - - bandit + - flake,bandit + - mypy,pylint js_style: <<: *branch_js_tests @@ -81,9 +79,9 @@ functional_test: parallel: matrix: - TOX_ENVS: - - py38-django42-install + - py310-django50-install - TOX_ENVS: - - py312-django42-coverage + - py312-django50-coverage js_tests: <<: *branch_js_tests @@ -117,6 +115,8 @@ release: when: on_success - if: '$CI_COMMIT_BRANCH =~ /^release_/ && $GIT_ACCESS_USER && $GIT_ACCESS_PASSWORD' when: on_success + - if: '$CI_COMMIT_BRANCH =~ /^collect-release-/ && $GIT_ACCESS_USER && $GIT_ACCESS_PASSWORD' + when: manual - when: never before_script: - url_host=`echo "${CI_REPOSITORY_URL}" | sed -e "s/https:\/\/gitlab-ci-token:.*@//g"` @@ -126,28 +126,37 @@ release: script: - bash autorelease.sh -release_pypi: +release_packages: stage: release - image: registry.gitlab.com/vstconsulting/images:ubuntu-v3 + image: registry.gitlab.com/vstconsulting/images:manylinux_2_17 artifacts: reports: dotenv: variables.env rules: - - if: '$CI_COMMIT_TAG && $PYPI_UPLOAD_PASSWORD && $PYPI_UPLOAD_NAME' + - if: '$CI_COMMIT_TAG && $PYPI_UPLOAD_PASSWORD && $PYPI_UPLOAD_NAME && $NPM_TOKEN' when: on_success - when: never script: + - echo MILESTONE=${CI_COMMIT_TAG%.*} > variables.env + # pypi - tox -e build - twine upload -u ${PYPI_UPLOAD_NAME} -p ${PYPI_UPLOAD_PASSWORD} $(find dist/* -type f -name '*.tar.gz') $(find dist/* -type f -name '*.whl') - - echo MILESTONE=${CI_COMMIT_TAG%.*} > variables.env + # npm + - | + VERSION=$(grep "__version__" vstutils/__init__.py | sed -E "s/__version__: str = '(.+)'/\1/" | sed -E "s/(a|b|rc|post)/-\1/") + sed -i -E "s/\"version\": \"[^\"]+\"/\"version\": \"$VERSION\"/" package.json + - echo NPM_VERSION=$VERSION >> variables.env + - yarn build-lib + - cd dist + - echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}'>.npmrc + - npm publish --access public allow_failure: true - release_job: stage: post_release image: registry.gitlab.com/gitlab-org/release-cli:latest needs: - - job: release_pypi + - job: release_packages artifacts: true rules: - if: '$CI_COMMIT_TAG && $PYPI_UPLOAD_PASSWORD && $PYPI_UPLOAD_NAME' @@ -167,3 +176,6 @@ release_job: - name: 'PyPI' url: "https://pypi.org/project/vstutils/${CI_COMMIT_TAG}/" link_type: 'other' + - name: 'npm' + url: "https://www.npmjs.com/package/@vstconsulting/vstutils/v/${NPM_VERSION}" + link_type: 'other' diff --git a/.pylintrc b/.pylintrc index 297ec92a..927aae29 100644 --- a/.pylintrc +++ b/.pylintrc @@ -13,7 +13,7 @@ ignore=CVS,migrations,unittests,tests,settings.py,settings_production.py # Add files or directories matching the regex patterns to the blacklist. The # regex matches against base names, not paths. -# ignore-patterns= +ignore-patterns=.*.pyi # Pickle collected data for later comparisons. # persistent=yes @@ -56,7 +56,7 @@ confidence= # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" -disable=unused-private-member,super-with-arguments,duplicate-code,logging-fstring-interpolation,no-else-continue,unused-argument,signature-differs,no-else-return,consider-using-ternary,inconsistent-return-statements,len-as-condition,keyword-arg-before-vararg,expression-not-assigned,broad-except,logging-format-interpolation,model-no-explicit-unicode,too-many-ancestors,redefined-builtin,missing-docstring,line-too-long,suppressed-message,useless-suppression,model-has-unicode,bare-except,too-few-public-methods,fixme,dangerous-default-value,attribute-defined-outside-init,pointless-string-statement,too-many-instance-attributes,arguments-differ,binary-op-exception,bad-classmethod-argument,locally-disabled,file-ignored,multiple-statements,superfluous-parens,isinstance-second-argument-not-valid-type +disable=cyclic-import,unused-private-member,super-with-arguments,duplicate-code,logging-fstring-interpolation,no-else-continue,unused-argument,signature-differs,no-else-return,consider-using-ternary,inconsistent-return-statements,len-as-condition,keyword-arg-before-vararg,expression-not-assigned,broad-except,logging-format-interpolation,model-no-explicit-unicode,too-many-ancestors,redefined-builtin,missing-docstring,line-too-long,suppressed-message,useless-suppression,model-has-unicode,bare-except,too-few-public-methods,fixme,dangerous-default-value,attribute-defined-outside-init,pointless-string-statement,too-many-instance-attributes,arguments-differ,binary-op-exception,bad-classmethod-argument,locally-disabled,file-ignored,multiple-statements,superfluous-parens,isinstance-second-argument-not-valid-type [REPORTS] diff --git a/.run/Full.run.xml b/.run/Full.run.xml index f4f4989f..bc507e90 100644 --- a/.run/Full.run.xml +++ b/.run/Full.run.xml @@ -1,10 +1,12 @@ +