Skip to content

Commit

Permalink
rename to ch_tools; publish into pypi on github release (#19)
Browse files Browse the repository at this point in the history
* testing initial

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* rename project for pypi

* fix

* fix

* fix
  • Loading branch information
myrrc authored Jul 17, 2023
1 parent 85e8c95 commit adf3ea1
Show file tree
Hide file tree
Showing 122 changed files with 233 additions and 389 deletions.
29 changes: 25 additions & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ jobs:
uses: actions/upload-artifact@v3
if: ${{ matrix.clickhouse == 'latest' }}
with:
name: chtools_py${{ matrix.target.python }}.whl
name: ch_tools_py${{ matrix.target.python }}.whl
path: dist/*.whl
if-no-files-found: error

- name: upload sdist
uses: actions/upload-artifact@v3
if: ${{ matrix.clickhouse == 'latest' }}
with:
name: chtools_py${{ matrix.target.python }}.tar.gz
name: ch_tools_py${{ matrix.target.python }}.tar.gz
path: dist/*.tar.gz
if-no-files-found: error

Expand Down Expand Up @@ -123,8 +123,11 @@ jobs:
if: ${{ matrix.clickhouse == 'latest' }}
# language=sh
run: |
cp dist/*.tar.gz chtools.tar.gz
sudo make clean build-deb-package
# deb building implicitly cleans dist/
cp dist/*.tar.gz ch_tools.tar.gz
cp dist/*.whl ch_tools.whl
echo "force-unsafe-io" | sudo tee /etc/dpkg/dpkg.cfg.d/force-unsafe-io
sudo make build-deb-package
- name: test deb
if: ${{ matrix.clickhouse == 'latest' }}
Expand All @@ -144,3 +147,21 @@ jobs:
name: ch-tools_py-${{ matrix.target.python }}_ubuntu-${{ matrix.target.ubuntu }}.deb
path: out/ch-tools*.deb
if-no-files-found: error

- name: create a release
uses: softprops/action-gh-release@v1
if: ${{ matrix.clickhouse == 'latest' && 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.clickhouse == 'latest' && matrix.target.ubuntu == 'latest' && startsWith(github.ref, 'refs/tags/') }}
run: flit publish --no-use-vcs
env:
FLIT_USERNAME: "__token__"
FLIT_PASSWORD: "${{ secrets.PYPI_TOKEN }}"
179 changes: 0 additions & 179 deletions .style.yapf

This file was deleted.

8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install-python-package: build-python-package
rm -f $(INSTALL_DIR)/bin/activate*
$(INSTALL_DIR)/bin/pip install -U pip

$(INSTALL_DIR)/bin/pip install --no-compile chtools.tar.gz
$(INSTALL_DIR)/bin/pip install --no-compile ch_tools.tar.gz

find $(INSTALL_DIR) -name __pycache__ -type d -exec rm -rf {} +
test -n '$(DESTDIR)' \
Expand All @@ -26,11 +26,11 @@ install-python-package: build-python-package
|| true

.PHONY: build-python-package
build-python-package: chtools.tar.gz ;
build-python-package: ch_tools.tar.gz ;
@echo 'Cleaning up residuals from building of Python package'
rm -rf venv dist

chtools.tar.gz: venv-build prepare-version
ch_tools.tar.gz: venv-build prepare-version
@echo 'Building Python package'

venv/bin/flit build --no-use-vcs
Expand Down Expand Up @@ -115,7 +115,7 @@ prepare-version: version.txt
version.txt:
@echo "2.$$(git rev-list HEAD --count).$$(git rev-parse --short HEAD | perl -ne 'print hex $$_')" > $@
@# Replace version in pyproject.toml
sed -ie "s/__version__ = \"[0-9\.]\+\"/__version__ = \"`cat $@`\"/" src/chtools/__init__.py
sed -ie "s/__version__ = \"[0-9\.]\+\"/__version__ = \"`cat $@`\"/" src/ch_tools/__init__.py

.PHONY: build-deb-package
build-deb-package: prepare-changelog
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "chtools"
name = "ch-tools"
license = { file = "LICENSE" }
dynamic = ["version", "description"]

Expand Down Expand Up @@ -122,10 +122,10 @@ test = [
]

[project.scripts]
chadmin = "chtools.chadmin.chadmin_cli:main"
ch-monitoring = "chtools.monrun_checks.main:main"
keeper-monitoring = "chtools.monrun_checks_keeper.main:main"
ch-s3-credentials = "chtools.s3_credentials.main:main"
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"
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,51 +8,51 @@

import cloup # noqa: E402

from chtools.chadmin.cli.chs3_backup_group import chs3_backup_group # noqa: E402
from chtools.chadmin.cli.config_command import config_command # noqa: E402
from chtools.chadmin.cli.crash_log_group import crash_log_group # noqa: E402
from chtools.chadmin.cli.data_store_group import data_store_group # noqa: E402
from chtools.chadmin.cli.database_group import database_group # noqa: E402
from chtools.chadmin.cli.diagnostics_command import diagnostics_command # noqa: E402
from chtools.chadmin.cli.dictionary_group import dictionary_group # noqa: E402
from chtools.chadmin.cli.disk_group import disks_group # noqa: E402
from chtools.chadmin.cli.list_async_metrics_command import ( # noqa: E402
from ch_tools.chadmin.cli.chs3_backup_group import chs3_backup_group # noqa: E402
from ch_tools.chadmin.cli.config_command import config_command # noqa: E402
from ch_tools.chadmin.cli.crash_log_group import crash_log_group # noqa: E402
from ch_tools.chadmin.cli.data_store_group import data_store_group # noqa: E402
from ch_tools.chadmin.cli.database_group import database_group # noqa: E402
from ch_tools.chadmin.cli.diagnostics_command import diagnostics_command # noqa: E402
from ch_tools.chadmin.cli.dictionary_group import dictionary_group # noqa: E402
from ch_tools.chadmin.cli.disk_group import disks_group # noqa: E402
from ch_tools.chadmin.cli.list_async_metrics_command import ( # noqa: E402
list_async_metrics_command,
)
from chtools.chadmin.cli.list_events_command import list_events_command # noqa: E402
from chtools.chadmin.cli.list_functions_command import ( # noqa: E402
from ch_tools.chadmin.cli.list_events_command import list_events_command # noqa: E402
from ch_tools.chadmin.cli.list_functions_command import ( # noqa: E402
list_functions_command,
)
from chtools.chadmin.cli.list_macros_command import list_macros_command # noqa: E402
from chtools.chadmin.cli.list_metrics_command import list_metrics_command # noqa: E402
from chtools.chadmin.cli.list_settings_command import ( # noqa: E402
from ch_tools.chadmin.cli.list_macros_command import list_macros_command # noqa: E402
from ch_tools.chadmin.cli.list_metrics_command import list_metrics_command # noqa: E402
from ch_tools.chadmin.cli.list_settings_command import ( # noqa: E402
list_settings_command,
)
from chtools.chadmin.cli.merge_group import merge_group # noqa: E402
from chtools.chadmin.cli.mutation_group import mutation_group # noqa: E402
from chtools.chadmin.cli.object_storage_group import object_storage_group # noqa: E402
from chtools.chadmin.cli.part_group import part_group # noqa: E402
from chtools.chadmin.cli.part_log_group import part_log_group # noqa: E402
from chtools.chadmin.cli.partition_group import partition_group # noqa: E402
from chtools.chadmin.cli.process_group import process_group # noqa: E402
from chtools.chadmin.cli.query_log_group import query_log_group # noqa: E402
from chtools.chadmin.cli.replicated_fetch_group import ( # noqa: E402
from ch_tools.chadmin.cli.merge_group import merge_group # noqa: E402
from ch_tools.chadmin.cli.mutation_group import mutation_group # noqa: E402
from ch_tools.chadmin.cli.object_storage_group import object_storage_group # noqa: E402
from ch_tools.chadmin.cli.part_group import part_group # noqa: E402
from ch_tools.chadmin.cli.part_log_group import part_log_group # noqa: E402
from ch_tools.chadmin.cli.partition_group import partition_group # noqa: E402
from ch_tools.chadmin.cli.process_group import process_group # noqa: E402
from ch_tools.chadmin.cli.query_log_group import query_log_group # noqa: E402
from ch_tools.chadmin.cli.replicated_fetch_group import ( # noqa: E402
replicated_fetch_group,
)
from chtools.chadmin.cli.replication_queue_group import ( # noqa: E402
from ch_tools.chadmin.cli.replication_queue_group import ( # noqa: E402
replication_queue_group,
)
from chtools.chadmin.cli.restore_replica_command import ( # noqa: E402
from ch_tools.chadmin.cli.restore_replica_command import ( # noqa: E402
restore_replica_command,
)
from chtools.chadmin.cli.stack_trace_command import stack_trace_command # noqa: E402
from chtools.chadmin.cli.table_group import table_group # noqa: E402
from chtools.chadmin.cli.table_replica_group import table_replica_group # noqa: E402
from chtools.chadmin.cli.thread_log_group import thread_log_group # noqa: E402
from chtools.chadmin.cli.wait_started_command import wait_started_command # noqa: E402
from chtools.chadmin.cli.zookeeper_group import zookeeper_group # noqa: E402
from chtools.common.cli.context_settings import CONTEXT_SETTINGS # noqa: E402
from chtools.common.cli.parameters import TimeSpanParamType # noqa: E402
from ch_tools.chadmin.cli.stack_trace_command import stack_trace_command # noqa: E402
from ch_tools.chadmin.cli.table_group import table_group # noqa: E402
from ch_tools.chadmin.cli.table_replica_group import table_replica_group # noqa: E402
from ch_tools.chadmin.cli.thread_log_group import thread_log_group # noqa: E402
from ch_tools.chadmin.cli.wait_started_command import wait_started_command # noqa: E402
from ch_tools.chadmin.cli.zookeeper_group import zookeeper_group # noqa: E402
from ch_tools.common.cli.context_settings import CONTEXT_SETTINGS # noqa: E402
from ch_tools.common.cli.parameters import TimeSpanParamType # noqa: E402

LOG_FILE = "/var/log/chadmin/chadmin.log"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from click import Context

from chtools.common.clickhouse.config import ClickhouseConfig
from ch_tools.common.clickhouse.config import ClickhouseConfig


def get_config(ctx: Context, try_preprocessed: bool = True) -> ClickhouseConfig:
Expand Down
Loading

0 comments on commit adf3ea1

Please sign in to comment.