Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 221ee02

Browse files
init packaging
1 parent 328fd85 commit 221ee02

File tree

5 files changed

+35
-43
lines changed

5 files changed

+35
-43
lines changed

‎MANIFEST.in‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.md LICENSE
2+
recursive-include src *.yaml

‎requirements.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
mysql-replication
22
requests
3-
simplejson
43
pyyaml
5-
lxml==3.4.4
4+
lxml
5+

‎sample.yaml‎

Lines changed: 0 additions & 40 deletions
This file was deleted.

‎setup.py‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from setuptools import setup, find_packages
2+
import src
3+
4+
setup(
5+
name='py-mysql-elasticsearch-sync',
6+
version=src.__version__,
7+
packages=find_packages(),
8+
url='https://github.com/zhongbiaodev/py-mysql-elasticsearch-sync',
9+
license='MIT',
10+
author='Windfarer',
11+
author_email='windfarer@gmail.com',
12+
description='MySQL to Elasticsearch sync tool',
13+
install_requires=[
14+
'mysql-replication',
15+
'requests',
16+
'pyyaml',
17+
'lxml',
18+
],
19+
entry_points={
20+
'console_scripts': [
21+
'es-sync=:run',
22+
]
23+
},
24+
include_package_data=True
25+
)

‎main.py‎ renamed to ‎src/__init__.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@
77
import simplejson as json
88
import logging
99
import shlex
10-
import codecs
1110
from datetime import datetime
1211
from lxml.etree import iterparse
1312
from functools import reduce
1413
from pymysqlreplication import BinLogStreamReader
1514
from pymysqlreplication.row_event import DeleteRowsEvent, UpdateRowsEvent, WriteRowsEvent
1615

16+
__version__ = '0.2.0'
17+
1718

1819
def cleanup(*args):
1920
logger.info('Received stop signal')
@@ -392,5 +393,9 @@ def main():
392393
send_email('es sync error', traceback.format_exc())
393394
raise
394395

396+
397+
def run():
398+
main()
399+
395400
if __name__ == '__main__':
396401
main()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /