From 37175f812c3b177d058ab13f1361e41a609bc134 Mon Sep 17 00:00:00 2001 From: Aleksei Filatov Date: Mon, 7 Aug 2023 19:15:39 +0300 Subject: [PATCH] Fix setup --- .github/actions/setup_dependencies/action.yml | 36 ++++ .github/workflows/workflow.yml | 176 +++++++++--------- Makefile | 150 ++++++++++----- ch_tools/__init__.py | 2 +- debian/changelog | 144 ++++++++++++++ poetry.lock | 106 ++--------- pyproject.toml | 54 +++--- pyproject.toml_bak | 131 ------------- 8 files changed, 410 insertions(+), 389 deletions(-) create mode 100644 .github/actions/setup_dependencies/action.yml delete mode 100644 pyproject.toml_bak diff --git a/.github/actions/setup_dependencies/action.yml b/.github/actions/setup_dependencies/action.yml new file mode 100644 index 00000000..8b750415 --- /dev/null +++ b/.github/actions/setup_dependencies/action.yml @@ -0,0 +1,36 @@ +name: setup Python dependensies +description: setup Python environment with all dependencies installed +inputs: + python-version: + required: true + poetry-version: + required: true +runs: + using: "composite" + steps: + - name: set up Python ${{ inputs.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ inputs.python-version }} + + - name: get full Python version + id: full-python-version + shell: bash + run: echo version=$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") >> $GITHUB_OUTPUT + + - name: cache Python dependencies + uses: actions/cache@v3 + with: + path: | + ~/.cache/pip + .venv + key: ${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-poetry-${{ hashFiles('poetry.lock') }} + + - name: install Python dependencies + shell: bash + env: + POETRY_VERSION: ${{ inputs.poetry-version }} + run: | + sudo make install-poetry + make install-deps + \ No newline at end of file diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 92e031a7..f7c6aaee 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -1,59 +1,60 @@ name: main on: - push: { branches: [main, try_poetry] } - pull_request: { branches: [main] } + push: + branches: [main, try_poetry] + tags: "v*" + pull_request: + branches: [main] concurrency: - group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: - # The latest version with support of Python 3.6 + BUILD_DEB_OUTPUT_DIR: out + BUILD_PYTHON_OUTPUT_DIR: dist + # The latest version supporting Python 3.6 POETRY_VERSION: 1.1.15 + jobs: lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 - with: { python-version: "3.11", cache: poetry } - - - run: | - pip install poetry==${{ env.POETRY_VERSION }} - poetry config virtualenvs.in-project true - poetry install --no-root - + - uses: ./.github/actions/setup_dependencies + with: + python-version: "3.10.12" + poetry-version: ${{ env.POETRY_VERSION }} - run: make lint tests: needs: lint - runs-on: ubuntu-latest + runs-on: ubuntu-${{ matrix.target.ubuntu }} + env: + CLICKHOUSE_VERSION: ${{ matrix.clickhouse }} strategy: + fail-fast: false matrix: target: - - {python: "3.6.15", ubuntu: "20.04"} - - {python: "3.10.12", ubuntu: "latest"} + - { python: "3.6.15", ubuntu: "20.04" } + - { python: "3.10.12", ubuntu: "latest" } clickhouse: - - "21.8.15.7" - - "22.3.20.29" - - "22.8.19.10" - - "23.3.4.17" - - "23.4.4.16" - - "23.5.3.24" - - "latest" - env: - CLICKHOUSE_VERSION=${{ matrix.clickhouse }} + # - "21.8.15.7" + # - "22.3.20.29" + # - "22.8.19.10" + # - "23.3.4.17" + # - "23.4.4.16" + # - "23.5.3.24" + - "latest" steps: - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: ./.github/actions/setup_dependencies with: python-version: ${{ matrix.target.python }} - cache: poetry - - run: | - pip install poetry==${{ env.POETRY_VERSION }} - poetry config virtualenvs.in-project true - poetry install --no-root - - run: make unit_tests - - run: make integration_tests + poetry-version: ${{ env.POETRY_VERSION }} + + - run: make unit-tests + # - run: make integration-tests + - name: publish test report uses: mikepenz/action-junit-report@v3 if: always() @@ -61,27 +62,29 @@ jobs: report_paths: 'tests/reports/*.xml' - # push_to_dockerhub: - # runs-on: ubuntu-latest - # env: - # CLICKHOUSE_VERSIONS: "21.8.15.7, 22.3.20.29, 22.8.19.10, 23.3.4.17, 23.4.4.16, 23.5.3.24, latest" - # if: ${{ github.event_name == 'push' }} - # steps: - # - uses: actions/checkout@v3 - # - name: login to dockerhub - # uses: docker/login-action@v2 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - # - name: build and push base images - # uses: docker/bake-action@v3 - # with: - # files: tests/bake.hcl - # push: true + push_to_dockerhub: + runs-on: ubuntu-latest + env: + CLICKHOUSE_VERSIONS: "21.8.15.7, 22.3.20.29, 22.8.19.10, 23.3.4.17, 23.4.4.16, 23.5.3.24, latest" + if: ${{ github.event_name == 'push' }} + steps: + - uses: actions/checkout@v3 + - name: login to dockerhub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: build and push base images + uses: docker/bake-action@v3 + with: + files: tests/bake.hcl + push: true + build: needs: tests strategy: + fail-fast: false matrix: target: - {python: "3.6.15", ubuntu: "20.04"} @@ -92,76 +95,71 @@ jobs: steps: - uses: actions/checkout@v3 - - name: set up python ${{ matrix.target.python }} - uses: actions/setup-python@v4 + - uses: ./.github/actions/setup_dependencies with: python-version: ${{ matrix.target.python }} - cache: poetry - - - name: install dependencies - run: | - pip install poetry==${{ env.POETRY_VERSION }} - poetry config virtualenvs.in-project true - poetry install --no-root + poetry-version: ${{ env.POETRY_VERSION }} - name: build project - run: make build + run: make build-python-packages - name: upload wheel uses: actions/upload-artifact@v3 with: name: ch_tools_py${{ matrix.target.python }}.whl - path: dist/*.whl + path: ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.whl if-no-files-found: error - name: upload sdist uses: actions/upload-artifact@v3 with: name: ch_tools_py${{ matrix.target.python }}.tar.gz - path: dist/*.tar.gz + path: ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.tar.gz if-no-files-found: error - - name: prepare build deb - run: sudo apt install python3-venv debhelper devscripts + - name: install prerequisites for DEB packaging tools + run: sudo make prepare-build-deb - - name: build deb - run: | - # deb building implicitly cleans dist/ - cp dist/*.tar.gz ch_tools.tar.gz - cp dist/*.whl ch_tools.whl + - name: build DEB package + run: | + # Speedup Debian package building echo "force-unsafe-io" | sudo tee /etc/dpkg/dpkg.cfg.d/force-unsafe-io sudo make build-deb-package - - name: test deb + - name: test DEB package run: | sudo make uninstall - sudo apt-get install -q -y ./out/ch-tools*.deb + sudo apt-get install -q -y ./${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb sudo chadmin --help sudo ch-monitoring --no-user-check --help sudo keeper-monitoring --help sudo ch-s3-credentials --help - - name: upload deb package artifact + - name: upload DEB package artifact uses: actions/upload-artifact@v3 with: name: ch-tools_py-${{ matrix.target.python }}_ubuntu-${{ matrix.target.ubuntu }}.deb - path: out/ch-tools*.deb + path: ${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb if-no-files-found: error - # - name: create a release - # uses: softprops/action-gh-release@v1 - # if: ${{ matrix.target.ubuntu == 'latest' && startsWith(github.ref, 'refs/tags/') }} - # with: - # generate_release_notes: true - # fail_on_unmatched_files: true - # files: | - # *.whl - # *.tar.gz - # out/ch-tools*.deb - - # - name: publish to pypi - # if: ${{ matrix.target.ubuntu == 'latest' && startsWith(github.ref, 'refs/tags/') }} - # run: flit publish --no-use-vcs - # env: - # FLIT_USERNAME: "__token__" - # FLIT_PASSWORD: "${{ secrets.PYPI_TOKEN }}" + - name: create a release + uses: softprops/action-gh-release@v1 + if: ${{ matrix.target.ubuntu == 'latest' && startsWith(github.ref, 'refs/tags/') }} + with: + generate_release_notes: true + fail_on_unmatched_files: true + files: | + ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.whl + ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.tar.gz + ${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb + + - name: publish to PYPI + if: ${{ matrix.target.ubuntu == 'latest' && startsWith(github.ref, 'refs/tags/') }} + continue-on-error: true + run: make publish + env: + POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__" + POETRY_HTTP_BASIC_PYPI_PASSWORD: ${{ secrets.ALEXFVK_TEST_PYPI_TOKEN }} + # POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}" + # Disable using keyring for poetry to get password from env variables + PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring diff --git a/Makefile b/Makefile index ae1e168e..b1741e27 100644 --- a/Makefile +++ b/Makefile @@ -12,8 +12,14 @@ MAKEFLAGS += --warn-undefined-variables MAKEFLAGS += --no-builtin-rules PYTHON ?= python3 + +POETRY_VERSION ?= 1.1.15 +POETRY_HOME ?= /opt/poetry +POETRY := $(POETRY_HOME)/bin/poetry + PREFIX ?= /opt/yandex/ch-tools -OUTPUT_DIR ?= out +BUILD_PYTHON_OUTPUT_DIR ?= dist +BUILD_DEB_OUTPUT_DIR ?= out # It is used by DEB building tools to install a program to temporary # directory before packaging @@ -26,71 +32,101 @@ SYMLINK_BIN_DIR = $(DESTDIR)/usr/bin WHL_FILE = ch_tools-*.whl VENV_DIR = .venv VERSION_FILE = version.txt -INSTALL_DEPS_MARKER = .install-deps +INSTALL_DEPS_STAMP = .install-deps .PHONY: install install: install-python-package install-symlinks install-bash-completions configure-logs ; -.PHONY: install-dependencies -install-dependencies: $(INSTALL_DEPS_MARKER) ; - - .PHONY: uninstall uninstall: uninstall-python-package uninstall-symlinks uninstall-bash-completions uninstall-logrotate ; -.PHONY: check-poetry -check-poetry: - if [ -z $$(command -v poetry 2> /dev/null) ]; then - echo "Poetry could not be found. See https://python-poetry.org/docs/"; - exit 1; +.PHONY: install-deps +install-deps: $(INSTALL_DEPS_STAMP) ; + + +# Update dependencies in poetry.lock to their latest versions according to your pyproject.toml +.PHONY: update-deps +update-deps: + $(POETRY) update + + +$(INSTALL_DEPS_STAMP): ensure-poetry venv pyproject.toml + $(POETRY) install --no-root + touch $(INSTALL_DEPS_STAMP) + +.PHONY: install-poetry +install-poetry: + if [ ! -e $(POETRY) ]; then + echo "Installing poetry $(POETRY_VERSION)..." + curl -sSL https://install.python-poetry.org | POETRY_HOME=$(POETRY_HOME) $(PYTHON) - --version $(POETRY_VERSION) + + # Fix cannot "import name 'appengine' from 'urllib3.contrib'..." error + # while 'poetry publish' for version poetry 1.1.15 + # https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html#importerror-cannot-import-name-gaecontrib-from-requests-toolbelt-compat + $(POETRY_HOME)/venv/bin/python -m pip install urllib3==1.26.15 + else + echo "Found installed poetry $$($(POETRY) --version)" fi +.PHONY: uninstall-poetry +uninstall-poetry: + echo "Uninstalling poetry..." + curl -sSL https://install.python-poetry.org | POETRY_HOME=$(POETRY_HOME) $(PYTHON) - --uninstall -$(VENV_DIR): - poetry env use $(PYTHON) +.PHONY: ensure-poetry +ensure-poetry: + if [ ! -e $(POETRY) ]; then + echo "Poetry could not be found. Please install it manually 'make install-poetry'"; + exit 1; + fi -.PHONY: venv -venv: check-poetry $(VENV_DIR) ; +.PHONY: venv +venv: ensure-poetry $(VENV_DIR) ; -$(INSTALL_DEPS_MARKER): check-poetry venv pyproject.toml - poetry install --no-root - touch $(INSTALL_DEPS_MARKER) +$(VENV_DIR): + $(POETRY) config virtualenvs.in-project true + $(POETRY) env use $(PYTHON) .PHONY: lint -lint: install-dependencies - poetry run black --check --diff ch_tools tests - poetry run isort --diff ch_tools tests +lint: install-deps + $(POETRY) run black --check --diff ch_tools tests + $(POETRY) run isort --diff ch_tools tests .PHONY: unit-tests -unit-tests: install-dependencies - poetry run $(PYTHON) -m pytest tests/unit +unit-tests: install-deps + $(POETRY) run $(PYTHON) -m pytest tests/unit .PHONY: integration-tests -integration-tests: install-dependencies build-python-package +integration-tests: install-deps build-python-packages cd tests - poetry run $(PYTHON) -m env_control create - poetry run behave --show-timings --junit -D skip_setup + $(POETRY) run $(PYTHON) -m env_control create + $(POETRY) run behave --show-timings --junit -D skip_setup + + +.PHONY: publish +publish: + $(POETRY) publish .PHONY: install-python-package -install-python-package: build-python-package +install-python-package: build-python-packages echo 'Installing ch-tools' # Prepare new virual environment - poetry run $(PYTHON) -m venv $(INSTALL_DIR) + $(POETRY) run $(PYTHON) -m venv $(INSTALL_DIR) rm -f $(BIN_DIR)/activate* # Install python package $(BIN_DIR)/pip install --upgrade pip - $(BIN_DIR)/pip install --no-compile dist/$(WHL_FILE) + $(BIN_DIR)/pip install --no-compile $(BUILD_PYTHON_OUTPUT_DIR)/$(WHL_FILE) # Clean python's artefacts find $(INSTALL_DIR) -name __pycache__ -type d -exec rm -rf {} + @@ -102,16 +138,16 @@ install-python-package: build-python-package || true -.PHONY: build-python-package -build-python-package: prepare-version clean-dist +.PHONY: build-python-packages +build-python-packages: install-deps prepare-version clean-dist echo 'Building python packages...' - poetry build + $(POETRY) build .PHONY: clean-dist clean-dist: echo 'Cleaning up residuals from building of Python package' - sudo rm -rf dist + sudo rm -rf $(BUILD_PYTHON_OUTPUT_DIR) .PHONY: uninstall-python-package @@ -186,41 +222,58 @@ prepare-version: $(VERSION_FILE) $(VERSION_FILE): # Generate version - echo "2.$$(git rev-list HEAD --count).$$(git rev-parse --short HEAD | xargs -I {} printf '%d' 0x{})" > $ - # Replace version in src/ch_tools/__init__.py - sed -ie "s/__version__ = \"[0-9\.]\+\"/__version__ = \"$$(cat $@)\"/" src/ch_tools/__init__.py + echo "2.$$(git rev-list HEAD --count).$$(git rev-parse --short HEAD | xargs -I {} printf '%d' 0x{})" > $@ + # Replace version in ch_tools/__init__.py + sed "s/__version__ = \"[0-9\.]\+\"/__version__ = \"$$(cat $@)\"/" ch_tools/__init__.py # Replace version in pyproject.toml - poetry version $$(cat $@) + $(POETRY) version $$(cat $@) + + +.PHONY: prepare-build-deb +prepare-build-deb: + apt install python3-venv debhelper devscripts .PHONY: build-deb-package -build-deb-package: prepare-changelog +build-deb-package: prepare-changelog install-deps # Build DEB package - (cd debian && poetry run debuild --check-dirname-level 0 --preserve-env --no-lintian --no-tgz-check -uc -us) + (cd debian && $(POETRY) run debuild --check-dirname-level 0 --preserve-env --no-lintian --no-tgz-check -uc -us) # Move DEB package to output dir DEB_FILE=$$(echo ../ch-tools*.deb) - mkdir -p $(OUTPUT_DIR) && mv $$DEB_FILE $(OUTPUT_DIR) - # Remove other build artefacts - rm $${DEB_FILE%_*.deb}* + mkdir -p $(BUILD_DEB_OUTPUT_DIR) && mv $$DEB_FILE $(BUILD_DEB_OUTPUT_DIR) + + +.PHONY: clean_debuild +clean_debuild: + rm -rf debian/{files,.debhelper,ch-tools*} + rm -f ../ch-tools_*{build,buildinfo,changes,deb,dsc,gz,xz} .PHONY: clean -clean: +clean: clean_debuild echo 'Cleaning up' - rm -rf build - rm -rf debian/files debian/.debhelper - rm -rf debian/ch-tools* + rm -rf $(BUILD_DEB_OUTPUT_DIR) + rm -rf $(BUILD_PYTHON_OUTPUT_DIR) + rm -rf $(VENV_DIR) .PHONY: help help: echo "Base targets:" + echo " install-poetry Install Poetry" + echo " uninstall-poetry Uninstall Poetry" + echo " install-deps Install Python dependencies to local environment $(VENV_DIR)" + echo " update-deps Update dependencies in poetry.lock to their latest versions" + echo " publish Publish python package to PYPI" + echo " lint Run linters" + echo " unit-tests Run unit tests" + echo " integration-tests Run integration tests" echo " prepare-changelog Add an autobuild version entity to changelog" echo " prepare-version Update version based on latest commit" - echo " build-python-package Build 'ch-tools' Python package" + echo " build-python-packages Build 'ch-tools' Python package" echo " build-deb-package Build 'ch-tools' debian package" - echo " clean Clean up after building debian package" + echo " clean Clean-up all produced/generated files inside tree" echo "" echo "--------------------------------------------------------------------------------" echo "" @@ -236,6 +289,7 @@ help: echo " uninstall-bash-completions Uninstall from /etc/bash_completion.d/" echo " configure-logs Install log rotation rules to /etc/logrotate.d/ and create log dirs" echo " uninstall-logrotate Uninstall log rotation rules from /etc/logrotate.d/" + echo " prepare-build-deb Install prerequisites for DEB packaging tool" echo "" echo "--------------------------------------------------------------------------------" echo "" diff --git a/ch_tools/__init__.py b/ch_tools/__init__.py index 8526f52a..066c5c84 100644 --- a/ch_tools/__init__.py +++ b/ch_tools/__init__.py @@ -1,3 +1,3 @@ """A set of tools for administration and diagnostics of ClickHouse DBMS.""" -__version__ = "1.0.0" +__version__ = "2.529.131159744" diff --git a/debian/changelog b/debian/changelog index 5faf2418..54fa6683 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,147 @@ +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 10:16:36 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:55:22 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:18:44 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:18:30 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:17:59 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:17:28 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:16:37 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:16:05 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:16:03 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:15:31 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:14:26 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:01:19 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 09:00:50 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 08:51:25 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 08:50:06 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 08:47:23 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 08:46:42 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 08:45:43 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Wed, 09 Aug 2023 08:44:50 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Tue, 08 Aug 2023 16:03:28 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Tue, 08 Aug 2023 16:02:13 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Tue, 08 Aug 2023 15:59:35 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Tue, 08 Aug 2023 15:57:24 +0300 + +ch-tools (2.529.131159744) stable; urgency=medium + + * Autobuild + + -- Yandex LLC Tue, 08 Aug 2023 15:54:33 +0300 + ch-tools (2.526.48925339) stable; urgency=medium * Autobuild diff --git a/poetry.lock b/poetry.lock index 55010acd..591cc769 100644 --- a/poetry.lock +++ b/poetry.lock @@ -307,14 +307,6 @@ category = "dev" optional = false python-versions = "*" -[[package]] -name = "docutils" -version = "0.18.1" -description = "Docutils -- Python Documentation Utilities" -category = "dev" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" - [[package]] name = "file-read-backwards" version = "3.0.0" @@ -323,32 +315,6 @@ category = "main" optional = false python-versions = "*" -[[package]] -name = "flit" -version = "3.9.0" -description = "A simple packaging tool for simple packages." -category = "dev" -optional = false -python-versions = ">=3.6" - -[package.dependencies] -docutils = "*" -flit_core = ">=3.9.0" -requests = "*" -tomli-w = "*" - -[package.extras] -doc = ["pygments-github-lexers", "sphinx", "sphinxcontrib-github-alt"] -test = ["pytest (>=2.7.3)", "pytest-cov", "responses", "testpath", "tomli"] - -[[package]] -name = "flit-core" -version = "3.9.0" -description = "Distribution-building parts of Flit. See flit package for more information" -category = "dev" -optional = false -python-versions = ">=3.6" - [[package]] name = "humanfriendly" version = "10.0" @@ -800,11 +766,11 @@ python-versions = "*" [[package]] name = "pyyaml" -version = "5.4.1" +version = "5.3.1" description = "YAML parser and emitter for Python" category = "main" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" [[package]] name = "requests" @@ -892,14 +858,6 @@ category = "dev" optional = false python-versions = ">=3.6" -[[package]] -name = "tomli-w" -version = "0.4.0" -description = "A lil' TOML writer" -category = "dev" -optional = false -python-versions = ">=3.6" - [[package]] name = "tqdm" version = "4.64.1" @@ -1043,7 +1001,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=4.6)", "pytest-black ( [metadata] lock-version = "1.1" python-versions = "^3.6.2" -content-hash = "8f40a4adc8b33214b233f6098f6a049771ab322b11321c44b2bd85a2fb334929" +content-hash = "33fc7c6d37f5775a86f0f0aaaf2ada3b790667f3e776da01b76846c6f82c9a46" [metadata.files] atomicwrites = [ @@ -1254,22 +1212,10 @@ dockerpty = [ docopt = [ {file = "docopt-0.6.2.tar.gz", hash = "sha256:49b3a825280bd66b3aa83585ef59c4a8c82f2c8a522dbe754a8bc8d08c85c491"}, ] -docutils = [ - {file = "docutils-0.18.1-py2.py3-none-any.whl", hash = "sha256:23010f129180089fbcd3bc08cfefccb3b890b0050e1ca00c867036e9d161b98c"}, - {file = "docutils-0.18.1.tar.gz", hash = "sha256:679987caf361a7539d76e584cbeddc311e3aee937877c87346f31debc63e9d06"}, -] file-read-backwards = [ {file = "file_read_backwards-3.0.0-py2.py3-none-any.whl", hash = "sha256:09fbac8bbf6d72c053c6e789768671002806c572d210fbe6861088a4a8bd0968"}, {file = "file_read_backwards-3.0.0.tar.gz", hash = "sha256:512c3e534043527a8fae2a0b7151aa255f2da303e77fd40f7dcf42a1e091cc26"}, ] -flit = [ - {file = "flit-3.9.0-py3-none-any.whl", hash = "sha256:076c3aaba5ac24cf0ad3251f910900d95a08218e6bcb26f21fef1036cc4679ca"}, - {file = "flit-3.9.0.tar.gz", hash = "sha256:d75edf5eb324da20d53570a6a6f87f51e606eee8384925cd66a90611140844c7"}, -] -flit-core = [ - {file = "flit_core-3.9.0-py3-none-any.whl", hash = "sha256:7aada352fb0c7f5538c4fafeddf314d3a6a92ee8e2b1de70482329e42de70301"}, - {file = "flit_core-3.9.0.tar.gz", hash = "sha256:72ad266176c4a3fcfab5f2930d76896059851240570ce9a98733b658cb786eba"}, -] humanfriendly = [ {file = "humanfriendly-10.0-py2.py3-none-any.whl", hash = "sha256:1697e1a8a8f550fd43c2865cd84542fc175a61dcb779b6fee18cf6b6ccba1477"}, {file = "humanfriendly-10.0.tar.gz", hash = "sha256:6b0b831ce8f15f7300721aa49829fc4e83921a9a301cc7f606be6686a2288ddc"}, @@ -1646,35 +1592,19 @@ pywin32 = [ {file = "pywin32-227-cp39-cp39-win_amd64.whl", hash = "sha256:f27cec5e7f588c3d1051651830ecc00294f90728d19c3bf6916e6dba93ea357c"}, ] pyyaml = [ - {file = "PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922"}, - {file = "PyYAML-5.4.1-cp27-cp27m-win32.whl", hash = "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393"}, - {file = "PyYAML-5.4.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8"}, - {file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"}, - {file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"}, - {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"}, - {file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"}, - {file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"}, - {file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"}, - {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"}, - {file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"}, - {file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"}, - {file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"}, - {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"}, - {file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"}, - {file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"}, - {file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"}, - {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"}, - {file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"}, - {file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"}, - {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, + {file = "PyYAML-5.3.1-cp27-cp27m-win32.whl", hash = "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f"}, + {file = "PyYAML-5.3.1-cp27-cp27m-win_amd64.whl", hash = "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76"}, + {file = "PyYAML-5.3.1-cp35-cp35m-win32.whl", hash = "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2"}, + {file = "PyYAML-5.3.1-cp35-cp35m-win_amd64.whl", hash = "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c"}, + {file = "PyYAML-5.3.1-cp36-cp36m-win32.whl", hash = "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2"}, + {file = "PyYAML-5.3.1-cp36-cp36m-win_amd64.whl", hash = "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648"}, + {file = "PyYAML-5.3.1-cp37-cp37m-win32.whl", hash = "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a"}, + {file = "PyYAML-5.3.1-cp37-cp37m-win_amd64.whl", hash = "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf"}, + {file = "PyYAML-5.3.1-cp38-cp38-win32.whl", hash = "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97"}, + {file = "PyYAML-5.3.1-cp38-cp38-win_amd64.whl", hash = "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee"}, + {file = "PyYAML-5.3.1-cp39-cp39-win32.whl", hash = "sha256:ad9c67312c84def58f3c04504727ca879cb0013b2517c85a9a253f0cb6380c0a"}, + {file = "PyYAML-5.3.1-cp39-cp39-win_amd64.whl", hash = "sha256:6034f55dab5fea9e53f436aa68fa3ace2634918e8b5994d82f3621c04ff5ed2e"}, + {file = "PyYAML-5.3.1.tar.gz", hash = "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d"}, ] requests = [ {file = "requests-2.27.1-py2.py3-none-any.whl", hash = "sha256:f22fa1e554c9ddfd16e6e41ac79759e17be9e492b3587efa038054674760e72d"}, @@ -1708,10 +1638,6 @@ tomli = [ {file = "tomli-1.2.3-py3-none-any.whl", hash = "sha256:e3069e4be3ead9668e21cb9b074cd948f7b3113fd9c8bba083f48247aab8b11c"}, {file = "tomli-1.2.3.tar.gz", hash = "sha256:05b6166bff487dc068d322585c7ea4ef78deed501cc124060e0f238e89a9231f"}, ] -tomli-w = [ - {file = "tomli_w-0.4.0-py3-none-any.whl", hash = "sha256:83a8b8df5174e0ab949783200fa0f1e382c5ae5f53d714c226775bc0592c5906"}, - {file = "tomli_w-0.4.0.tar.gz", hash = "sha256:47643abe03b628b6e214c38cf0816dca7b63888e503ec8580d251e331c0526b6"}, -] tqdm = [ {file = "tqdm-4.64.1-py2.py3-none-any.whl", hash = "sha256:6fee160d6ffcd1b1c68c65f14c829c22832bc401726335ce92c52d395944a6a1"}, {file = "tqdm-4.64.1.tar.gz", hash = "sha256:5f4f682a004951c1b450bc753c710e9280c5746ce6ffedee253ddbcbf54cf1e4"}, diff --git a/pyproject.toml b/pyproject.toml index 402d7796..41ea8a00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,42 +4,41 @@ build-backend = "poetry.core.masonry.api" [tool.poetry] name = "ch-tools" -version = "2.526.48925339" +version = "2.529.131159744" license = "MIT" description = "ch-tools is a set of tools for administration and diagnostics of ClickHouse DBMS." authors = [ "Alexander Burmak ", "Dmitry Starov ", - # {name = "Anton Ivashkin", email="iantonspb@yandex-team.ru"}, - # {name = "Grigory Pervakov", email="pervakovg@yandex-team.ru"}, - # {name = "Petr Nuzhnov", email="petrnuzhnov@yandex-team.ru"}, - # {name = "Egor Medvedev", email="egor-medvedev@yandex-team.ru"}, - # {name = "Aleksei Filatov", email="alexfvk@yandex-team.ru"}, - # {name = "Evgeny Dyukov", email="secwall@yandex-team.ru"}, - # {name = "Evgeny Strizhnev", email="estrizhnev@yandex-team.ru"}, - # {name = "Vadim Volodin", email="vadim-volodin@yandex-team.ru"}, - # {name = "Anton Chaporgin", email="chapson@yandex-team.ru"}, - # {name = "Evgenii Kopanev", email="ekopanev@yandex-team.ru"}, - # {name = "Mikhail Kot", email="myrrc@yandex-team.ru"}, + "Anton Ivashkin ", + "Grigory Pervakov ", + "Petr Nuzhnov ", + "Egor Medvedev ", + "Aleksei Filatov ", + "Evgeny Dyukov ", + "Evgeny Strizhnev ", + "Vadim Volodin ", + "Anton Chaporgin ", + "Evgenii Kopanev ", + "Mikhail Kot ", ] maintainers = [ "Alexander Burmak ", - # {name = "Dmitry Starov", email="dstaroff@yandex-team.ru"}, - # {name = "Anton Ivashkin", email="iantonspb@yandex-team.ru"}, - # {name = "Grigory Pervakov", email="pervakovg@yandex-team.ru"}, - # {name = "Petr Nuzhnov", email="petrnuzhnov@yandex-team.ru"}, - # {name = "Egor Medvedev", email="egor-medvedev@yandex-team.ru"}, - # {name = "Aleksei Filatov", email="alexfvk@yandex-team.ru"}, - # {name = "Evgenii Kopanev", email="ekopanev@yandex-team.ru"}, - # {name = "Mikhail Kot", email="myrrc@yandex-team.ru"}, + "Dmitry Starov ", + "Anton Ivashkin ", + "Grigory Pervakov ", + "Petr Nuzhnov ", + "Egor Medvedev ", + "Aleksei Filatov ", + "Evgenii Kopanev ", + "Mikhail Kot ", ] readme = "README.md" - -repository = "https://github.com/yandex/ch-tools" homepage = "https://github.com/yandex/ch-tools" +repository = "https://github.com/yandex/ch-tools" keywords=[ "clickhouse", @@ -71,16 +70,12 @@ classifiers = [ "Typing :: Typed", ] -# packages - -# [tool.flit.sdist] -# include = ["resources/"] include = ["resources/"] -# requires-python = ">=3.6.2" [tool.poetry.dependencies] python = "^3.6.2" + boto3 = "*" click = "*" cloup = "*" @@ -95,17 +90,16 @@ psutil = "*" pygments = "*" pyopenssl = "*" python-dateutil = "*" -pyyaml = "*" +pyyaml = "<5.4" requests = "*" tabulate = "*" tenacity = "*" termcolor = "*" tqdm = "*" -xmltodict = "*" typing-extensions = "*" +xmltodict = "*" [tool.poetry.dev-dependencies] -flit = "*" black = "*" isort = {version = "^5.0.0", extras = ["pyproject"]} mypy = "*" diff --git a/pyproject.toml_bak b/pyproject.toml_bak deleted file mode 100644 index c5deb9be..00000000 --- a/pyproject.toml_bak +++ /dev/null @@ -1,131 +0,0 @@ -[build-system] -requires = ["flit_core >=3.2,<4"] -build-backend = "flit_core.buildapi" - -[project] -name = "ch-tools" -license = { file = "LICENSE" } -dynamic = ["version", "description"] - -authors = [ - {name = "Alexander Burmak", email = "alex-burmak@yandex-team.ru"}, - {name = "Dmitry Starov", email="dstaroff@yandex-team.ru"}, - {name = "Anton Ivashkin", email="iantonspb@yandex-team.ru"}, - {name = "Grigory Pervakov", email="pervakovg@yandex-team.ru"}, - {name = "Petr Nuzhnov", email="petrnuzhnov@yandex-team.ru"}, - {name = "Egor Medvedev", email="egor-medvedev@yandex-team.ru"}, - {name = "Aleksei Filatov", email="alexfvk@yandex-team.ru"}, - {name = "Evgeny Dyukov", email="secwall@yandex-team.ru"}, - {name = "Evgeny Strizhnev", email="estrizhnev@yandex-team.ru"}, - {name = "Vadim Volodin", email="vadim-volodin@yandex-team.ru"}, - {name = "Anton Chaporgin", email="chapson@yandex-team.ru"}, - {name = "Evgenii Kopanev", email="ekopanev@yandex-team.ru"}, - {name = "Mikhail Kot", email="myrrc@yandex-team.ru"}, -] - -maintainers = [ - {name = "Alexander Burmak", email = "alex-burmak@yandex-team.ru"}, - {name = "Dmitry Starov", email="dstaroff@yandex-team.ru"}, - {name = "Anton Ivashkin", email="iantonspb@yandex-team.ru"}, - {name = "Grigory Pervakov", email="pervakovg@yandex-team.ru"}, - {name = "Petr Nuzhnov", email="petrnuzhnov@yandex-team.ru"}, - {name = "Egor Medvedev", email="egor-medvedev@yandex-team.ru"}, - {name = "Aleksei Filatov", email="alexfvk@yandex-team.ru"}, - {name = "Evgenii Kopanev", email="ekopanev@yandex-team.ru"}, - {name = "Mikhail Kot", email="myrrc@yandex-team.ru"}, -] - -readme = "README.md" - -keywords=[ - "clickhouse", - "database", - "monitoring", - "diagnostics", - "administration", -] - -classifiers = [ - "Development Status :: 5 - Production/Stable", - "Intended Audience :: Developers", - "Intended Audience :: System Administrators", - "License :: OSI Approved :: MIT License", - "Operating System :: MacOS", - "Operating System :: POSIX :: BSD", - "Operating System :: POSIX :: Linux", - "Operating System :: Unix", - "Environment :: Console", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Topic :: Database", - "Typing :: Typed", -] - -requires-python = ">=3.6.2" - -dependencies = [ - "boto3", - "click", - "cloup", - "deepdiff", - "dnspython", - "file_read_backwards", - "humanfriendly", - "jinja2", - "kazoo", - "lxml", - "psutil", - "pygments", - "pyopenssl", - "python-dateutil", - "pyyaml", - "requests", - "tabulate", - "tenacity", - "termcolor", - "tqdm", - "xmltodict", - "typing-extensions" -] - -[tool.flit.sdist] -include = ["resources/"] - -[project.urls] -Source = "https://github.com/yandex/ch-tools" - -[project.optional-dependencies] -test = [ - "flit", - "black", - "isort", - "mypy", - "types-pyyaml", - "types-requests", - "types-python-dateutil", - "types-tabulate", - "types-pyOpenSSL", - "types-setuptools", -#pylint = "^2.13" -#bandit = "*" - "behave", - "docker", - "docker-compose", - "pyhamcrest", - "pytest" -] - -[project.scripts] -chadmin = "ch_tools.chadmin.chadmin_cli:main" -ch-monitoring = "ch_tools.monrun_checks.main:main" -keeper-monitoring = "ch_tools.monrun_checks_keeper.main:main" -ch-s3-credentials = "ch_tools.s3_credentials.main:main" - -[tool.isort] -profile = "black"