Skip to content

prepare distribution structure for packaging #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions clickhouse_mysql/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .main import Main


def main():
"""Entry point for the application script"""
main = Main()
main.start()


if __name__ == '__main__':
main()
3 changes: 2 additions & 1 deletion src/cliopts.py → clickhouse_mysql/cliopts.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
# -*- coding: utf-8 -*-

import argparse
from .config import Config
import logging

from .config import Config


class CLIOpts(object):

Expand Down
File renamed without changes.
Empty file.
File renamed without changes.
File renamed without changes.
Empty file.
File renamed without changes.
9 changes: 3 additions & 6 deletions clickhouse-mysql → clickhouse_mysql/main.py
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from src.cliopts import CLIOpts
from src.pumper import Pumper
from src.daemon import Daemon
from .cliopts import CLIOpts
from .pumper import Pumper
from .daemon import Daemon

import sys
import multiprocessing as mp
import logging
import pprint
import json

if sys.version_info[0] < 3:
raise "Must be using Python 3"


class Main(Daemon):

Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
2 changes: 1 addition & 1 deletion src/pool/bbpool.py → clickhouse_mysql/pool/bbpool.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# -*- coding: utf-8 -*-

import time
import logging

from .pool import Pool
from ..objectbuilder import ObjectBuilder
import logging


# Buckets Belts' Index Generator
Expand Down
File renamed without changes.
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import csv
import os

from .reader import Reader
from ..event.event import Event
from ..converter.csvreadconverter import CSVReadConverter
import csv
import os


class CSVReader(Reader):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .reader import Reader
from ..event.event import Event
import time
import logging

from pymysqlreplication import BinLogStreamReader
from pymysqlreplication.row_event import WriteRowsEvent, UpdateRowsEvent, DeleteRowsEvent

from .reader import Reader
from ..event.event import Event
#from pymysqlreplication.event import QueryEvent, RotateEvent, FormatDescriptionEvent
import time
import logging


class MySQLReader(Reader):

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .writer import Writer

import os
import time
import logging

from .writer import Writer


class CHCSVWriter(Writer):

host = None
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import logging
import sys

from clickhouse_driver.client import Client

from .writer import Writer
from ..event.event import Event
import logging
import sys


class CHWriter(Writer):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .writer import Writer
from ..event.event import Event
import csv
import os.path
import logging

from .writer import Writer
from ..event.event import Event


class CSVWriter(Writer):

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import logging

from .writer import Writer
from ..event.event import Event
from ..pool.bbpool import BBPool
import logging


class PoolWriter(Writer):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from .writer import Writer
import multiprocessing as mp
import logging

from .writer import Writer


class ProcessWriter(Writer):

Expand Down
File renamed without changes.
65 changes: 59 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,68 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

version = "0.1"
from setuptools import setup, find_packages

setup(
name="clickhouse-mysql-data-reader",
version=version,
name="clickhouse-mysql",

# version should comply with PEP440
version='0.0.1',

description='ClickHouse Data Reader',
long_description='ClickHouse Data Reader',

# homepage
url="https://github.com/altinity/clickhouse-mysql-data-reader",
author="sunsingerus",

author="Vladislav Klimenko",
author_email="[email protected]",
description=("ClickHouse data reader"),

license="MIT",
install_requires=['pymysqlreplication'],

# see https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 3 - Alpha',

'Intended Audience :: Developers',
'Topic :: Database',

# should match license above
'License :: OSI Approved :: MIT License',

# supported Python versions
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],

# what does the project relate to?
keywords='clickhouse mysql data migration',

# list of packages to be included into project
packages=find_packages(exclude=['contrib', 'docs', 'tests']),

# run-time dependencies
# these will be installed by pip
# https://packaging.python.org/en/latest/requirements.html
install_requires=[
'mysqlclient',
'mysql-replication',
'clickhouse-driver',
],

# cross-platform support for pip to create the appropriate form of executable
entry_points={
'console_scripts': [
'clickhouse-mysql=clickhouse_mysql:main',
],
},

# python_requires='>=3.3',
)