From 444bb421e7af569597a02a50dca709ed341913ab Mon Sep 17 00:00:00 2001 From: Aleksei Filatov Date: Fri, 11 Aug 2023 16:27:42 +0300 Subject: [PATCH] [rev: 1] --- .github/actions/setup_dependencies/action.yml | 4 - .github/workflows/workflow.yml | 41 +++--- AUTHORS | 2 +- Makefile | 124 +++++++++++------- README.md | 28 ++-- debian/.gitignore | 2 + debian/changelog | 2 +- debian/control | 4 +- debian/copyright | 2 +- poetry.lock | 55 ++++---- pyproject.toml | 32 +++-- 11 files changed, 156 insertions(+), 140 deletions(-) diff --git a/.github/actions/setup_dependencies/action.yml b/.github/actions/setup_dependencies/action.yml index 9e1c4696..3abf977d 100644 --- a/.github/actions/setup_dependencies/action.yml +++ b/.github/actions/setup_dependencies/action.yml @@ -3,8 +3,6 @@ description: Create Python environment with all dependencies installed inputs: python-version: required: true - poetry-version: - required: true runs: using: "composite" steps: @@ -28,8 +26,6 @@ runs: - name: Install Python dependencies shell: bash - env: - POETRY_VERSION: ${{ inputs.poetry-version }} run: | sudo make install-poetry make install-deps diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 7316f4da..6e184d16 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -11,9 +11,8 @@ concurrency: env: BUILD_DEB_OUTPUT_DIR: out BUILD_PYTHON_OUTPUT_DIR: dist - # The latest version supporting Python 3.6 - POETRY_VERSION: 1.1.15 - + PROJECT_NAME: clickhouse-tools + PROJECT_NAME_UNDESCORE: clickhouse_tools jobs: lint: @@ -22,8 +21,7 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/setup_dependencies with: - python-version: "3.10.12" - poetry-version: ${{ env.POETRY_VERSION }} + python-version: "3.10" - name: "lint: isort" run: make isort - name: "lint: black" @@ -44,8 +42,8 @@ jobs: fail-fast: false matrix: target: - - { python: "3.6.15", ubuntu: "20.04" } - - { python: "3.10.12", ubuntu: "latest" } + - { python: "3.6", ubuntu: "20.04" } + - { python: "3.10", ubuntu: "latest" } clickhouse: - "21.8.15.7" - "22.3.20.29" @@ -59,10 +57,9 @@ jobs: - uses: ./.github/actions/setup_dependencies with: python-version: ${{ matrix.target.python }} - poetry-version: ${{ env.POETRY_VERSION }} - - run: make unit-tests - - run: make integration-tests + - run: make test-unit + - run: make test-integration - name: publish test report uses: mikepenz/action-junit-report@v3 @@ -90,15 +87,14 @@ jobs: push: true - build: + release: needs: tests strategy: fail-fast: false matrix: target: - - {python: "3.6.15", ubuntu: "20.04"} - - {python: "3.10.12", ubuntu: "latest"} - # a copy-paste of the above as github CI can't use env context in matrices + - {python: "3.6", ubuntu: "20.04"} + - {python: "3.10", ubuntu: "latest"} runs-on: ubuntu-${{ matrix.target.ubuntu }} steps: @@ -107,7 +103,6 @@ jobs: - uses: ./.github/actions/setup_dependencies with: python-version: ${{ matrix.target.python }} - poetry-version: ${{ env.POETRY_VERSION }} - name: build project run: make build-python-packages @@ -115,14 +110,14 @@ jobs: - name: upload wheel uses: actions/upload-artifact@v3 with: - name: ch_tools_py${{ matrix.target.python }}.whl + name: ${{ env.PROJECT_NAME_UNDESCORE }}_py${{ matrix.target.python }}.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 + name: ${{ env.PROJECT_NAME_UNDESCORE }}_py${{ matrix.target.python }}.tar.gz path: ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.tar.gz if-no-files-found: error @@ -133,12 +128,12 @@ jobs: run: | # Speedup Debian package building echo "force-unsafe-io" | sudo tee /etc/dpkg/dpkg.cfg.d/force-unsafe-io - sudo make build-deb-package + make build-deb-package - name: test DEB package run: | sudo make uninstall - sudo apt-get install -q -y ./${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb + sudo apt-get install -q -y ./${{ env.BUILD_DEB_OUTPUT_DIR }}/*.deb sudo chadmin --help sudo ch-monitoring --no-user-check --help sudo keeper-monitoring --help @@ -147,8 +142,8 @@ jobs: - name: upload DEB package artifact uses: actions/upload-artifact@v3 with: - name: ch-tools_py-${{ matrix.target.python }}_ubuntu-${{ matrix.target.ubuntu }}.deb - path: ${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb + name: ${{ env.PROJECT_NAME }}_py-${{ matrix.target.python }}_ubuntu-${{ matrix.target.ubuntu }}.deb + path: ${{ env.BUILD_DEB_OUTPUT_DIR }}/*.deb if-no-files-found: error - name: create a release @@ -160,7 +155,7 @@ jobs: files: | ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.whl ${{ env.BUILD_PYTHON_OUTPUT_DIR }}/*.tar.gz - ${{ env.BUILD_DEB_OUTPUT_DIR }}/ch-tools*.deb + ${{ env.BUILD_DEB_OUTPUT_DIR }}/*.deb - name: publish to PYPI if: ${{ matrix.target.ubuntu == 'latest' && startsWith(github.ref, 'refs/tags/') }} @@ -169,5 +164,5 @@ jobs: env: POETRY_HTTP_BASIC_PYPI_USERNAME: "__token__" POETRY_HTTP_BASIC_PYPI_PASSWORD: "${{ secrets.PYPI_TOKEN }}" - # Disable using keyring for poetry to get password from env variables + # Disable using keyring for poetry to get password from env variable PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring diff --git a/AUTHORS b/AUTHORS index 84ce8d82..163ab15b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,4 +1,4 @@ -The following authors have created the source code of "ch-tools" +The following authors have created the source code of "clickhouse-tools" published and distributed by YANDEX LLC as the owner: Alexander Burmak diff --git a/Makefile b/Makefile index e6f237c7..a34b747c 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ SHELL := bash MAKEFLAGS += --warn-undefined-variables MAKEFLAGS += --no-builtin-rules +PROJECT_NAME ?= "clickhouse-tools" +PROJECT_NAME_UNDERSCORE ?= $(subst -,_,$(PROJECT_NAME)) + PYTHON ?= python3 # The latest version supporting Python 3.6 @@ -18,7 +21,7 @@ POETRY_VERSION ?= 1.1.15 POETRY_HOME ?= /opt/poetry POETRY := $(POETRY_HOME)/bin/poetry -PREFIX ?= /opt/yandex/ch-tools +PREFIX ?= /opt/yandex/$(PROJECT_NAME) BUILD_PYTHON_OUTPUT_DIR ?= dist BUILD_DEB_OUTPUT_DIR ?= out SRC_DIR ?= ch_tools @@ -32,16 +35,33 @@ INSTALL_DIR = $(DESTDIR)$(PREFIX) BIN_DIR = $(INSTALL_DIR)/bin SYMLINK_BIN_DIR = $(DESTDIR)/usr/bin -WHL_FILE = ch_tools-*.whl -VENV_DIR = .venv -VERSION_FILE = version.txt -INSTALL_DEPS_STAMP = .install-deps +WHL_FILE := $(PROJECT_NAME_UNDERSCORE)-*.whl +VENV_DIR := .venv +VERSION_FILE := version.txt +INSTALL_DEPS_STAMP := .install-deps # Pass arguments for testing tools -BEHAVE_ARGS ?= -D skip_setup +BEHAVE_ARGS ?= PYTEST_ARGS ?= +define ensure_poetry + if [ ! -e $(POETRY) ]; then + echo "Poetry could not be found. Please install it manually 'make install-poetry'"; + exit 1; + fi +endef + + +# Should be default target, because "make" is just run +# by debhelper(dh_auto_build stage) for building the program during +# creation of a DEB package +.PHONY: build +build: build-python-packages ; + +.PHONY: all +all: build lint test-unit test-integration + .PHONY: install install: install-python-package install-symlinks install-bash-completions configure-logs ; @@ -57,45 +77,39 @@ install-deps: $(INSTALL_DEPS_STAMP) ; # Update dependencies in poetry.lock to their latest versions according to your pyproject.toml .PHONY: update-deps update-deps: + $(ensure_poetry) $(POETRY) update - -$(INSTALL_DEPS_STAMP): ensure-poetry venv pyproject.toml +$(INSTALL_DEPS_STAMP): $(VENV_DIR) pyproject.toml poetry.lock + $(ensure_poetry) $(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 + [ -e $(POETRY) ] && echo "Found installed poetry $$($(POETRY) --version)" && exit 0 -.PHONY: uninstall-poetry -uninstall-poetry: - echo "Uninstalling poetry..." - curl -sSL https://install.python-poetry.org | POETRY_HOME=$(POETRY_HOME) $(PYTHON) - --uninstall + echo "Installing poetry $(POETRY_VERSION)..." + $(PYTHON) -m venv $(POETRY_HOME) + $(POETRY_HOME)/bin/pip install poetry==$(POETRY_VERSION) + # TODO: remove after getting rid of support Python 3.6 + # Fix "cannot import name 'appengine' from 'urllib3.contrib'..." error + # while 'poetry publish' for version poetry 1.1.15 due to incompatibility with urllib3 >= 2.0.0 + # https://urllib3.readthedocs.io/en/stable/v2-migration-guide.html#importerror-cannot-import-name-gaecontrib-from-requests-toolbelt-compat + $(POETRY_HOME)/bin/python -m pip install "urllib3<2.0.0" -.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: uninstall-poetry +uninstall-poetry: + [ ! -e $(POETRY_HOME) ] && exit 0; + + rm -rf $(POETRY_HOME) + echo "Uninstalled poetry from $(POETRY_HOME)" -.PHONY: venv -venv: ensure-poetry $(VENV_DIR) ; $(VENV_DIR): + $(ensure_poetry) $(POETRY) config virtualenvs.in-project true $(POETRY) env use $(PYTHON) @@ -134,16 +148,16 @@ format: install-deps $(POETRY) run black $(SRC_DIR) $(TESTS_DIR) -.PHONY: unit-tests -unit-tests: install-deps +.PHONY: test-unit +test-unit: install-deps $(POETRY) run $(PYTHON) -m pytest $(PYTEST_ARGS) $(TESTS_DIR)/unit -.PHONY: integration-tests -integration-tests: install-deps build-python-packages +.PHONY: test-integration +test-integration: install-deps build-python-packages cd $(TESTS_DIR) $(POETRY) run $(PYTHON) -m env_control create - $(POETRY) run behave --show-timings --junit $(BEHAVE_ARGS) + $(POETRY) run behave --show-timings -D skip_setup --junit $(BEHAVE_ARGS) .PHONY: publish @@ -153,7 +167,7 @@ publish: .PHONY: install-python-package install-python-package: build-python-packages - echo 'Installing ch-tools' + echo 'Installing $(PROJECT_NAME)' # Prepare new virual environment $(POETRY) run $(PYTHON) -m venv $(INSTALL_DIR) @@ -176,18 +190,25 @@ install-python-package: build-python-packages .PHONY: build-python-packages build-python-packages: install-deps prepare-version clean-dist echo 'Building python packages...' - $(POETRY) build + $(POETRY) build + + # Normalize SDIST name for consistency + # (dashes are replaced by undescores in project name) + # Poetry >= 1.2 does this itself + cd $(BUILD_PYTHON_OUTPUT_DIR) + sdist=$$(echo $(PROJECT_NAME)*.gz) + mv $${sdist} $${sdist/$(PROJECT_NAME)/$(PROJECT_NAME_UNDERSCORE)} 2>/dev/null .PHONY: clean-dist clean-dist: echo 'Cleaning up residuals from building of Python package' - sudo rm -rf $(BUILD_PYTHON_OUTPUT_DIR) + rm -rf $(BUILD_PYTHON_OUTPUT_DIR) .PHONY: uninstall-python-package uninstall-python-package: - echo 'Uninstalling ch-tools' + echo 'Uninstalling $(PROJECT_NAME)' rm -rf $(INSTALL_DIR) @@ -247,7 +268,7 @@ uninstall-logrotate: .PHONY: prepare-changelog prepare-changelog: prepare-version echo 'Bumping version into Debian package changelog' - DEBFULLNAME="Yandex LLC" DEBEMAIL="ch-tools@yandex-team.ru" dch --force-bad-version --distribution stable -v $$(cat $(VERSION_FILE)) Autobuild + DEBFULLNAME="Yandex LLC" DEBEMAIL="clickhouse-tools@yandex-team.ru" dch --force-bad-version --distribution stable -v $$(cat $(VERSION_FILE)) Autobuild .PHONY: prepare-version @@ -274,14 +295,14 @@ 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) # Move DEB package to output dir - DEB_FILE=$$(echo ../ch-tools*.deb) + DEB_FILE=$$(echo ../$(PROJECT_NAME)*.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*,*stamp} - rm -f ../ch-tools_*{build,buildinfo,changes,deb,dsc,gz,xz} + rm -rf debian/{files,.debhelper,$(PROJECT_NAME)*,*stamp} + rm -f ../$(PROJECT_NAME)_*{build,buildinfo,changes,deb,dsc,gz,xz} .PHONY: clean @@ -291,6 +312,7 @@ clean: clean_debuild rm -rf $(BUILD_DEB_OUTPUT_DIR) rm -rf $(BUILD_PYTHON_OUTPUT_DIR) rm -rf $(VENV_DIR) + rm -rf $(INSTALL_DEPS_STAMP) .PHONY: help @@ -302,6 +324,8 @@ help: echo " update-deps Update dependencies in poetry.lock to their latest versions" echo " publish Publish python package to PYPI" echo " lint Run linters. Alias for \"isort black flake8 pylint mypy\"." + echo " test-unit Run unit tests." + echo " test-integration Run integration tests." echo " isort Perform isort checks." echo " black Perform black checks." echo " flake8 Perform flake8 checks." @@ -311,19 +335,19 @@ help: echo " isort and black tools." echo " prepare-changelog Add an autobuild version entity to changelog" echo " prepare-version Update version based on latest commit" - echo " build-python-packages Build 'ch-tools' Python packages (sdist and wheel)" + echo " build-python-packages Build '$(PROJECT_NAME)' Python packages (sdist and wheel)" echo " prepare-build-deb Install prerequisites for DEB packaging tool" - echo " build-deb-package Build 'ch-tools' debian package" + echo " build-deb-package Build '$(PROJECT_NAME)' debian package" echo " clean Clean-up all produced/generated files inside tree" echo "" echo "--------------------------------------------------------------------------------" echo "" echo "Debian package build targets:" - echo " install Install 'ch-tools' debian package" - echo " uninstall Uninstall 'ch-tools' debian package" + echo " install Install '$(PROJECT_NAME)' debian package" + echo " uninstall Uninstall '$(PROJECT_NAME)' debian package" echo "" - echo " install-python-package Install 'ch-tools' python package" - echo " uninstall-python-package Uninstall 'ch-tools' python package" + echo " install-python-package Install '$(PROJECT_NAME)' python package" + echo " uninstall-python-package Uninstall '$(PROJECT_NAME)' python package" echo " install-symlinks Install symlinks to /usr/bin/" echo " uninstall-symlinks Uninstall symlinks from /usr/bin/" echo " install-bash-completions Install to /etc/bash_completion.d/" diff --git a/README.md b/README.md index 5c048d72..41c22c3f 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ [![license](https://img.shields.io/github/license/yandex/ch-tools)](https://github.com/yandex/ch-tools/blob/main/LICENSE) [![tests status](https://img.shields.io/github/actions/workflow/status/yandex/ch-tools/.github%2Fworkflows%2Fworkflow.yml?event=push&label=tests)](https://github.com/yandex/ch-tools/actions/workflows/workflow.yml?query=event%3Apush) -# ch-tools +# clickhouse-tools -**ch-tools** is a set of tools for administration and diagnostics of [ClickHouse](https://clickhouse.com/) DBMS. +**clickhouse-tools** is a set of tools for administration and diagnostics of [ClickHouse](https://clickhouse.com/) DBMS. ## Tools -**ch-tools** consist of following components: +**clickhouse-tools** consist of following components: - [chadmin](./src/chtools/chadmin/README.md) - ClickHouse administration tool - [ch-monitoring](./src/chtools/monrun_checks/README.md) - ClickHouse monitoring tool - [keeper-monitoring](./src/chtools/monrun_checks_keeper/README.md) - ClickHouse Keeper / ZooKeeper monitoring tool @@ -22,29 +22,25 @@ sudo make install-poetry # or to install in user's home directory make POETRY_HOME=~/opt/poetry install-poetry -# For building deb packages -sudo make prepare-build-deb -sudo make build-deb-package - # lint make lint # unit tests -make unit-tests -make unit-tests PYTEST_ARGS="-k test_name" +make test-unit +make test-unit PYTEST_ARGS="-k test_name" # integration tests (rebuild docker images using a .whl file) -make integration-tests - -# integration tests (do not rebuild docker images) -# useful when you didn't change source code -make integration-tests BEHAVE_ARGS="-D skip_setup" +make test-integration +make test-integration BEHAVE_ARGS="-i feature_name" # integration tests (supply a custom ClickHouse version to test against) -CLICKHOUSE_VERSION="1.2.3.4" make integration-tests - +CLICKHOUSE_VERSION="1.2.3.4" make test-integration # If you want to have containers running on failure, supply a flag: # BEHAVE_ARGS="-D no_stop_on_fail" + +# For building deb packages +make prepare-build-deb +make build-deb-package ``` Please note: base images for tests are pulled from [chtools Dockerhub](https://hub.docker.com/u/chtools). diff --git a/debian/.gitignore b/debian/.gitignore index 397b4a76..e34a43f0 100644 --- a/debian/.gitignore +++ b/debian/.gitignore @@ -1 +1,3 @@ *.log +.debhelper/ +clickhouse-tools diff --git a/debian/changelog b/debian/changelog index d336f92e..0469a70c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -ch-tools (1.0.0) UNRELEASED; urgency=low +clickhouse-tools (1.0.0) UNRELEASED; urgency=low * Initial Release. diff --git a/debian/control b/debian/control index a1a774ae..28ec3a2e 100644 --- a/debian/control +++ b/debian/control @@ -1,4 +1,4 @@ -Source: ch-tools +Source: clickhouse-tools Section: database Priority: optional Maintainer: Yandex LLC @@ -18,7 +18,7 @@ Vcs-Browser: https://github.com/yandex/ch-tools.git Vcs-Git: git://github.com:yandex/ch-tools.git X-Python3-Version: >= 3.6 -Package: ch-tools +Package: clickhouse-tools Architecture: any Description: A set of tools for administration and diagnostics of ClickHouse DBMS. Replaces: mdb-ch-tools diff --git a/debian/copyright b/debian/copyright index 1d287f99..aa55cabe 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,5 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: ch-tools +Upstream-Name: clickhouse-tools Source: https://github.com/yandex/ch-tools Files: * diff --git a/poetry.lock b/poetry.lock index a0d12ced..44af6b20 100644 --- a/poetry.lock +++ b/poetry.lock @@ -518,11 +518,11 @@ python-versions = ">=3.6" [[package]] name = "mypy" -version = "1.4.1" +version = "1.5.0" description = "Optional static typing for Python" category = "dev" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" [package.dependencies] mypy-extensions = ">=1.0.0" @@ -532,7 +532,6 @@ typing-extensions = ">=4.1.0" [package.extras] dmypy = ["psutil (>=4.0)"] install-types = ["pip"] -python2 = ["typed-ast (>=1.4.0,<2)"] reports = ["lxml"] [[package]] @@ -1095,7 +1094,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=4.6)", "pytest-black ( [metadata] lock-version = "1.1" python-versions = "^3.6.2" -content-hash = "b28b29d5ff88d835f4f26526999565b80b6b2f66a51701fe66232649f25e1150" +content-hash = "32360c6d9287d5c5c540d5a3d7a680d0d283c59a653476c742499202b02b6376" [metadata.files] astroid = [ @@ -1555,32 +1554,28 @@ mccabe = [ {file = "mccabe-0.7.0.tar.gz", hash = "sha256:348e0240c33b60bbdf4e523192ef919f28cb2c3d7d5c7794f74009290f236325"}, ] mypy = [ - {file = "mypy-1.4.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:566e72b0cd6598503e48ea610e0052d1b8168e60a46e0bfd34b3acf2d57f96a8"}, - {file = "mypy-1.4.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ca637024ca67ab24a7fd6f65d280572c3794665eaf5edcc7e90a866544076878"}, - {file = "mypy-1.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0dde1d180cd84f0624c5dcaaa89c89775550a675aff96b5848de78fb11adabcd"}, - {file = "mypy-1.4.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:8c4d8e89aa7de683e2056a581ce63c46a0c41e31bd2b6d34144e2c80f5ea53dc"}, - {file = "mypy-1.4.1-cp310-cp310-win_amd64.whl", hash = "sha256:bfdca17c36ae01a21274a3c387a63aa1aafe72bff976522886869ef131b937f1"}, - {file = "mypy-1.4.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:7549fbf655e5825d787bbc9ecf6028731973f78088fbca3a1f4145c39ef09462"}, - {file = "mypy-1.4.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:98324ec3ecf12296e6422939e54763faedbfcc502ea4a4c38502082711867258"}, - {file = "mypy-1.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:141dedfdbfe8a04142881ff30ce6e6653c9685b354876b12e4fe6c78598b45e2"}, - {file = "mypy-1.4.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8207b7105829eca6f3d774f64a904190bb2231de91b8b186d21ffd98005f14a7"}, - {file = "mypy-1.4.1-cp311-cp311-win_amd64.whl", hash = "sha256:16f0db5b641ba159eff72cff08edc3875f2b62b2fa2bc24f68c1e7a4e8232d01"}, - {file = "mypy-1.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:470c969bb3f9a9efcedbadcd19a74ffb34a25f8e6b0e02dae7c0e71f8372f97b"}, - {file = "mypy-1.4.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e5952d2d18b79f7dc25e62e014fe5a23eb1a3d2bc66318df8988a01b1a037c5b"}, - {file = "mypy-1.4.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:190b6bab0302cec4e9e6767d3eb66085aef2a1cc98fe04936d8a42ed2ba77bb7"}, - {file = "mypy-1.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:9d40652cc4fe33871ad3338581dca3297ff5f2213d0df345bcfbde5162abf0c9"}, - {file = "mypy-1.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:01fd2e9f85622d981fd9063bfaef1aed6e336eaacca00892cd2d82801ab7c042"}, - {file = "mypy-1.4.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:2460a58faeea905aeb1b9b36f5065f2dc9a9c6e4c992a6499a2360c6c74ceca3"}, - {file = "mypy-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a2746d69a8196698146a3dbe29104f9eb6a2a4d8a27878d92169a6c0b74435b6"}, - {file = "mypy-1.4.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:ae704dcfaa180ff7c4cfbad23e74321a2b774f92ca77fd94ce1049175a21c97f"}, - {file = "mypy-1.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:43d24f6437925ce50139a310a64b2ab048cb2d3694c84c71c3f2a1626d8101dc"}, - {file = "mypy-1.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:c482e1246726616088532b5e964e39765b6d1520791348e6c9dc3af25b233828"}, - {file = "mypy-1.4.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:43b592511672017f5b1a483527fd2684347fdffc041c9ef53428c8dc530f79a3"}, - {file = "mypy-1.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:34a9239d5b3502c17f07fd7c0b2ae6b7dd7d7f6af35fbb5072c6208e76295816"}, - {file = "mypy-1.4.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:5703097c4936bbb9e9bce41478c8d08edd2865e177dc4c52be759f81ee4dd26c"}, - {file = "mypy-1.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:e02d700ec8d9b1859790c0475df4e4092c7bf3272a4fd2c9f33d87fac4427b8f"}, - {file = "mypy-1.4.1-py3-none-any.whl", hash = "sha256:45d32cec14e7b97af848bddd97d85ea4f0db4d5a149ed9676caa4eb2f7402bb4"}, - {file = "mypy-1.4.1.tar.gz", hash = "sha256:9bbcd9ab8ea1f2e1c8031c21445b511442cc45c89951e49bbf852cbb70755b1b"}, + {file = "mypy-1.5.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:ad3109bec37cc33654de8db30fe8ff3a1bb57ea65144167d68185e6dced9868d"}, + {file = "mypy-1.5.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:b4ea3a0241cb005b0ccdbd318fb99619b21ae51bcf1660b95fc22e0e7d3ba4a1"}, + {file = "mypy-1.5.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1fe816e26e676c1311b9e04fd576543b873576d39439f7c24c8e5c7728391ecf"}, + {file = "mypy-1.5.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:42170e68adb1603ccdc55a30068f72bcfcde2ce650188e4c1b2a93018b826735"}, + {file = "mypy-1.5.0-cp310-cp310-win_amd64.whl", hash = "sha256:d145b81a8214687cfc1f85c03663a5bbe736777410e5580e54d526e7e904f564"}, + {file = "mypy-1.5.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:c36011320e452eb30bec38b9fd3ba20569dc9545d7d4540d967f3ea1fab9c374"}, + {file = "mypy-1.5.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:f3940cf5845b2512b3ab95463198b0cdf87975dfd17fdcc6ce9709a9abe09e69"}, + {file = "mypy-1.5.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9166186c498170e1ff478a7f540846b2169243feb95bc228d39a67a1a450cdc6"}, + {file = "mypy-1.5.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:725b57a19b7408ef66a0fd9db59b5d3e528922250fb56e50bded27fea9ff28f0"}, + {file = "mypy-1.5.0-cp311-cp311-win_amd64.whl", hash = "sha256:eec5c927aa4b3e8b4781840f1550079969926d0a22ce38075f6cfcf4b13e3eb4"}, + {file = "mypy-1.5.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:79c520aa24f21852206b5ff2cf746dc13020113aa73fa55af504635a96e62718"}, + {file = "mypy-1.5.0-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:769ddb6bfe55c2bd9c7d6d7020885a5ea14289619db7ee650e06b1ef0852c6f4"}, + {file = "mypy-1.5.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cbf18f8db7e5f060d61c91e334d3b96d6bb624ddc9ee8a1cde407b737acbca2c"}, + {file = "mypy-1.5.0-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:a2500ad063413bc873ae102cf655bf49889e0763b260a3a7cf544a0cbbf7e70a"}, + {file = "mypy-1.5.0-cp38-cp38-win_amd64.whl", hash = "sha256:84cf9f7d8a8a22bb6a36444480f4cbf089c917a4179fbf7eea003ea931944a7f"}, + {file = "mypy-1.5.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:a551ed0fc02455fe2c1fb0145160df8336b90ab80224739627b15ebe2b45e9dc"}, + {file = "mypy-1.5.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:372fd97293ed0076d52695849f59acbbb8461c4ab447858cdaeaf734a396d823"}, + {file = "mypy-1.5.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c8a7444d6fcac7e2585b10abb91ad900a576da7af8f5cffffbff6065d9115813"}, + {file = "mypy-1.5.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:35b13335c6c46a386577a51f3d38b2b5d14aa619e9633bb756bd77205e4bd09f"}, + {file = "mypy-1.5.0-cp39-cp39-win_amd64.whl", hash = "sha256:2c9d570f53908cbea326ad8f96028a673b814d9dca7515bf71d95fa662c3eb6f"}, + {file = "mypy-1.5.0-py3-none-any.whl", hash = "sha256:69b32d0dedd211b80f1b7435644e1ef83033a2af2ac65adcdc87c38db68a86be"}, + {file = "mypy-1.5.0.tar.gz", hash = "sha256:f3460f34b3839b9bc84ee3ed65076eb827cd99ed13ed08d723f9083cada4a212"}, ] mypy-extensions = [ {file = "mypy_extensions-1.0.0-py3-none-any.whl", hash = "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d"}, diff --git a/pyproject.toml b/pyproject.toml index f0feeb61..a468ed72 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,10 +3,10 @@ requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" [tool.poetry] -name = "ch-tools" -version = "2.529.131159744" +name = "clickhouse-tools" +version = "0.1.0" license = "MIT" -description = "ch-tools is a set of tools for administration and diagnostics of ClickHouse DBMS." +description = "clickhouse-tools is a set of tools for administration and diagnostics of ClickHouse DBMS." authors = [ "Alexander Burmak ", @@ -70,6 +70,10 @@ classifiers = [ "Typing :: Typed", ] +packages = [ + { include = "ch_tools" }, +] + include = ["resources/"] @@ -100,22 +104,26 @@ typing-extensions = "~4.1.1" xmltodict = "*" [tool.poetry.dev-dependencies] +# TODO: use groups in a modern version of poetry +# tests behave = "*" -black = { version = "^22.0.0", python = ">=3.10" } docker = "*" docker-compose = "*" +pyhamcrest = "*" +pytest = "*" + +# lint +black = { version = "^22.0.0", python = ">=3.10" } flake8 = { version = "^6.1.0", python = ">=3.10" } isort = { version = "^5.0.0", extras = ["pyproject"] } mypy = { version = "^1.4.1", python = ">=3.10" } -pyhamcrest = "*" pylint = { version = "^2.17.5", python = ">=3.10" } -pytest = "*" -types-pyOpenSSL = "*" -types-python-dateutil = "*" -types-pyyaml = "*" -types-requests = "*" -types-setuptools = "*" -types-tabulate = "*" +types-pyOpenSSL = { version = "*", python = ">=3.10" } +types-python-dateutil = { version = "*", python = ">=3.10" } +types-pyyaml = { version = "*", python = ">=3.10" } +types-requests = { version = "*", python = ">=3.10" } +types-setuptools = { version = "*", python = ">=3.10" } +types-tabulate = { version = "*", python = ">=3.10" } [tool.poetry.scripts] chadmin = "ch_tools.chadmin.chadmin_cli:main"