Skip to content

Commit 89ae6ec

Browse files
authored
Merge pull request #52 from sunsingerus/master
prepare distribution structure for packaging
2 parents d63c97f + bf3e193 commit 89ae6ec

33 files changed

+103
-28
lines changed

clickhouse_mysql/__init__.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
from .main import Main
5+
6+
7+
def main():
8+
"""Entry point for the application script"""
9+
main = Main()
10+
main.start()
11+
12+
13+
if __name__ == '__main__':
14+
main()

src/cliopts.py renamed to clickhouse_mysql/cliopts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
# -*- coding: utf-8 -*-
33

44
import argparse
5-
from .config import Config
65
import logging
76

7+
from .config import Config
8+
89

910
class CLIOpts(object):
1011

File renamed without changes.

clickhouse_mysql/converter/__init__.py

Whitespace-only changes.
File renamed without changes.
File renamed without changes.

clickhouse_mysql/event/__init__.py

Whitespace-only changes.
File renamed without changes.

clickhouse-mysql renamed to clickhouse_mysql/main.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
from src.cliopts import CLIOpts
5-
from src.pumper import Pumper
6-
from src.daemon import Daemon
4+
from .cliopts import CLIOpts
5+
from .pumper import Pumper
6+
from .daemon import Daemon
77

88
import sys
99
import multiprocessing as mp
1010
import logging
1111
import pprint
1212
import json
1313

14-
if sys.version_info[0] < 3:
15-
raise "Must be using Python 3"
16-
1714

1815
class Main(Daemon):
1916

File renamed without changes.
File renamed without changes.

clickhouse_mysql/pool/__init__.py

Whitespace-only changes.

src/pool/bbpool.py renamed to clickhouse_mysql/pool/bbpool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
# -*- coding: utf-8 -*-
33

44
import time
5+
import logging
56

67
from .pool import Pool
78
from ..objectbuilder import ObjectBuilder
8-
import logging
99

1010

1111
# Buckets Belts' Index Generator
File renamed without changes.
File renamed without changes.

clickhouse_mysql/reader/__init__.py

Whitespace-only changes.

src/reader/csvreader.py renamed to clickhouse_mysql/reader/csvreader.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
import csv
5+
import os
6+
47
from .reader import Reader
58
from ..event.event import Event
69
from ..converter.csvreadconverter import CSVReadConverter
7-
import csv
8-
import os
910

1011

1112
class CSVReader(Reader):

src/reader/mysqlreader.py renamed to clickhouse_mysql/reader/mysqlreader.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
from .reader import Reader
5-
from ..event.event import Event
4+
import time
5+
import logging
6+
67
from pymysqlreplication import BinLogStreamReader
78
from pymysqlreplication.row_event import WriteRowsEvent, UpdateRowsEvent, DeleteRowsEvent
9+
10+
from .reader import Reader
11+
from ..event.event import Event
812
#from pymysqlreplication.event import QueryEvent, RotateEvent, FormatDescriptionEvent
9-
import time
10-
import logging
13+
1114

1215
class MySQLReader(Reader):
1316

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

clickhouse_mysql/writer/__init__.py

Whitespace-only changes.

src/writer/chcsvwriter.py renamed to clickhouse_mysql/writer/chcsvwriter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
from .writer import Writer
5-
64
import os
75
import time
86
import logging
97

8+
from .writer import Writer
9+
10+
1011
class CHCSVWriter(Writer):
1112

1213
host = None

src/writer/chwriter.py renamed to clickhouse_mysql/writer/chwriter.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
import logging
5+
import sys
6+
47
from clickhouse_driver.client import Client
8+
59
from .writer import Writer
610
from ..event.event import Event
7-
import logging
8-
import sys
911

1012

1113
class CHWriter(Writer):

src/writer/csvwriter.py renamed to clickhouse_mysql/writer/csvwriter.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
from .writer import Writer
5-
from ..event.event import Event
64
import csv
75
import os.path
86
import logging
97

8+
from .writer import Writer
9+
from ..event.event import Event
10+
1011

1112
class CSVWriter(Writer):
1213

src/writer/poolwriter.py renamed to clickhouse_mysql/writer/poolwriter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4+
import logging
5+
46
from .writer import Writer
57
from ..event.event import Event
68
from ..pool.bbpool import BBPool
7-
import logging
89

910

1011
class PoolWriter(Writer):

src/writer/processwriter.py renamed to clickhouse_mysql/writer/processwriter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
from .writer import Writer
54
import multiprocessing as mp
65
import logging
76

7+
from .writer import Writer
8+
89

910
class ProcessWriter(Writer):
1011

File renamed without changes.

setup.py

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,68 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33

4-
version = "0.1"
4+
from setuptools import setup, find_packages
55

66
setup(
7-
name="clickhouse-mysql-data-reader",
8-
version=version,
7+
name="clickhouse-mysql",
8+
9+
# version should comply with PEP440
10+
version='0.0.1',
11+
12+
description='ClickHouse Data Reader',
13+
long_description='ClickHouse Data Reader',
14+
15+
# homepage
916
url="https://github.com/altinity/clickhouse-mysql-data-reader",
10-
author="sunsingerus",
17+
18+
author="Vladislav Klimenko",
1119
author_email="[email protected]",
12-
description=("ClickHouse data reader"),
20+
1321
license="MIT",
14-
install_requires=['pymysqlreplication'],
22+
23+
# see https://pypi.python.org/pypi?%3Aaction=list_classifiers
24+
classifiers=[
25+
# How mature is this project? Common values are
26+
# 3 - Alpha
27+
# 4 - Beta
28+
# 5 - Production/Stable
29+
'Development Status :: 3 - Alpha',
30+
31+
'Intended Audience :: Developers',
32+
'Topic :: Database',
33+
34+
# should match license above
35+
'License :: OSI Approved :: MIT License',
36+
37+
# supported Python versions
38+
'Programming Language :: Python :: 3',
39+
'Programming Language :: Python :: 3.3',
40+
'Programming Language :: Python :: 3.4',
41+
'Programming Language :: Python :: 3.5',
42+
'Programming Language :: Python :: 3.6',
43+
],
44+
45+
# what does the project relate to?
46+
keywords='clickhouse mysql data migration',
47+
48+
# list of packages to be included into project
49+
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
50+
51+
# run-time dependencies
52+
# these will be installed by pip
53+
# https://packaging.python.org/en/latest/requirements.html
54+
install_requires=[
55+
'mysqlclient',
56+
'mysql-replication',
57+
'clickhouse-driver',
58+
],
59+
60+
# cross-platform support for pip to create the appropriate form of executable
61+
entry_points={
62+
'console_scripts': [
63+
'clickhouse-mysql=clickhouse_mysql:main',
64+
],
65+
},
66+
67+
# python_requires='>=3.3',
1568
)

0 commit comments

Comments
 (0)