diff --git a/.bumpversion.cfg b/.bumpversion.cfg new file mode 100644 index 0000000..12a3bfc --- /dev/null +++ b/.bumpversion.cfg @@ -0,0 +1,13 @@ +[bumpversion] +commit = True +tag = False +current_version = 0.1.0 +parse = (?P\d+)\.(?P\d+)\.(?P\d+)(\-(?P[a-z]+))? +serialize = + {major}.{minor}.{patch}-{release} + {major}.{minor}.{patch} + +[bumpversion:file:kcpy/__init__.py] + +[bumpversion:file:VERSION] + diff --git a/.gitignore b/.gitignore index 78146e0..121aa9d 100644 --- a/.gitignore +++ b/.gitignore @@ -115,3 +115,5 @@ erl_crash.dump *.db Documentation/ .cache/ + +.pytest_cache/ \ No newline at end of file diff --git a/LICENSE b/LICENSE index 41c6bbf..bc1f09c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2017 Hengfeng Li +Copyright (c) 2018 Hengfeng Li Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f1377b5 --- /dev/null +++ b/Makefile @@ -0,0 +1,30 @@ +PYTHON ?= python +GIT ?= git + +clean: clean-pyc clean-build + +clean-dist: clean clean-git-force + +clean-build: + rm -rf build/ dist/ .eggs/ *.egg-info/ .tox/ .coverage cover/ + +clean-pyc: + -find . -type f -a \( -name "*.pyc" -o -name "*$$py.class" \) | xargs rm + -find . -type d -name "__pycache__" | xargs rm -r + +clean-git: + $(GIT) clean -xdn + +clean-git-force: + $(GIT) clean -xdf + +test: + pytest tests/tests.py + +build: + $(PYTHON) setup.py sdist bdist_wheel + +dist: clean-dist build + +lint: + flake8 \ No newline at end of file diff --git a/Pipfile b/Pipfile index 0765722..b604ccd 100644 --- a/Pipfile +++ b/Pipfile @@ -1,17 +1,14 @@ [[source]] - url = "https://pypi.python.org/simple" verify_ssl = true name = "pypi" - [packages] - "boto3" = "*" - [dev-packages] - -moto = "*" pytest = "*" faker = "*" +bumpversion = "*" +"flake8" = "*" +moto = "*" diff --git a/Pipfile.lock b/Pipfile.lock index e1bfdf5..50d981f 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,20 +1,7 @@ { "_meta": { "hash": { - "sha256": "b914738f83cf0ed928010e7d49f54ade3733fe7dd876f0b8665bd58a4383a7fa" - }, - "host-environment-markers": { - "implementation_name": "cpython", - "implementation_version": "3.6.2", - "os_name": "posix", - "platform_machine": "x86_64", - "platform_python_implementation": "CPython", - "platform_release": "16.5.0", - "platform_system": "Darwin", - "platform_version": "Darwin Kernel Version 16.5.0: Fri Mar 3 16:52:33 PST 2017; root:xnu-3789.51.2~3/RELEASE_X86_64", - "python_full_version": "3.6.2", - "python_version": "3.6", - "sys_platform": "darwin" + "sha256": "322a0bbcdf559f60f9e3490e6c6b6b446f015f6120d90c654ac75e09e8ceec02" }, "pipfile-spec": 6, "requires": {}, @@ -29,394 +16,179 @@ "default": { "boto3": { "hashes": [ - "sha256:edd35eb7cd8d56f08e65b112206936cf9f76bb406fb15f63075ff72331ef6f5f", - "sha256:332c6a17fd695581dd6f9ed825ce13c2d5ee3a6f5e1b079bed0ff7293809faf0" + "sha256:8cf861abc8ac7c7db6d4c4cb3f300b64bdc9490482ebdffd6f6cd46a730dd524", + "sha256:afabd27d49b74ae0d5e5f20c9ec7b4b5d26bd1f7bb5b01e670a7d4c35f535a4e" ], - "version": "==1.4.8" + "index": "pypi", + "version": "==1.9.7" }, "botocore": { "hashes": [ - "sha256:2bae4f2a1746ccb5ed6ab07a95de007d72a6d6aea68fef6294580c6bf579e4e3", - "sha256:257f3f85bc292ce4569a3232a4f3b5b07d411d1b51f901218339057682c45d2b" + "sha256:22c1460e0ff40a4d25198b8d807a24fc7ecd95162d72d3e1496a7a571ae7468d", + "sha256:5fca20d37627823d50a101ad9acb5a0b1f6d7f82b6d84cb7a33afe8d68a03f75" ], - "version": "==1.8.1" + "version": "==1.12.7" }, "docutils": { "hashes": [ - "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6", "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", - "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274" + "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", + "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6" ], "version": "==0.14" }, "jmespath": { "hashes": [ - "sha256:f11b4461f425740a1d908e9a3f7365c3d2e569f6ca68a2ff8bc5bcd9676edd63", - "sha256:6a81d4c9aa62caf061cb517b4d9ad1dd300374cd4706997aff9cd6aedd61fc64" + "sha256:6a81d4c9aa62caf061cb517b4d9ad1dd300374cd4706997aff9cd6aedd61fc64", + "sha256:f11b4461f425740a1d908e9a3f7365c3d2e569f6ca68a2ff8bc5bcd9676edd63" ], "version": "==0.9.3" }, "python-dateutil": { "hashes": [ - "sha256:95511bae634d69bc7329ba55e646499a842bc4ec342ad54a8cdb65645a0aad3c", - "sha256:891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca" + "sha256:1adb80e7a782c12e52ef9a8182bebeb73f1d7e24e374397af06fb4956c8dc5c0", + "sha256:e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8" ], - "version": "==2.6.1" + "markers": "python_version >= '2.7'", + "version": "==2.7.3" }, "s3transfer": { "hashes": [ - "sha256:c7b16f4cca5acd2bd57ac9623bfba3fece047247392893506d0d2e6f25620eb3", - "sha256:76f1f58f4a47e2c8afa135e2c76958806a3abbc42b721d87fd9d11409c75d979" + "sha256:90dc18e028989c609146e241ea153250be451e05ecc0c2832565231dacdf59c1", + "sha256:c7a9ec356982d5e9ab2d4b46391a7d6a950e2b04c472419f5fdec70cc0ada72f" ], - "version": "==0.1.11" + "version": "==0.1.13" }, "six": { "hashes": [ - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" ], "version": "==1.11.0" - } - }, - "develop": { - "asn1crypto": { - "hashes": [ - "sha256:654b7db3b120e23474e9a1e5e38d268c77e58a9e17d2cb595456c37309846494", - "sha256:0874981329cfebb366d6584c3d16e913f2a0eb026c9463efcc4aaf42a9d94d70" - ], - "version": "==0.23.0" - }, - "aws-xray-sdk": { - "hashes": [ - "sha256:9733dc0f5f96a6e1ea83fc857c64de146fe0a0281def7cd278e6ed0b0076ca21", - "sha256:129688c3d5adcf0d1fd2d5a5de4ab6aaab2711f54c34b2bab7b4352d32bd42b5" - ], - "version": "==0.94" - }, - "boto": { - "hashes": [ - "sha256:13be844158d1bd80a94c972c806ec8381b9ea72035aa06123c5db6bc6a6f3ead", - "sha256:deb8925b734b109679e3de65856018996338758f4b916ff4fe7bb62b6d7000d1" - ], - "version": "==2.48.0" - }, - "boto3": { - "hashes": [ - "sha256:edd35eb7cd8d56f08e65b112206936cf9f76bb406fb15f63075ff72331ef6f5f", - "sha256:332c6a17fd695581dd6f9ed825ce13c2d5ee3a6f5e1b079bed0ff7293809faf0" - ], - "version": "==1.4.8" }, - "botocore": { - "hashes": [ - "sha256:2bae4f2a1746ccb5ed6ab07a95de007d72a6d6aea68fef6294580c6bf579e4e3", - "sha256:257f3f85bc292ce4569a3232a4f3b5b07d411d1b51f901218339057682c45d2b" - ], - "version": "==1.8.1" - }, - "certifi": { - "hashes": [ - "sha256:244be0d93b71e93fc0a0a479862051414d0e00e16435707e5bf5000f92e04694", - "sha256:5ec74291ca1136b40f0379e1128ff80e866597e4e2c1e755739a913bbc3613c0" - ], - "version": "==2017.11.5" - }, - "cffi": { - "hashes": [ - "sha256:2c707e97ad7b0417713543be7cb87315c015bb5dd97903480168d60ebe3e313e", - "sha256:6d8c7e20eb90be9e1ccce8e8dd4ee5163b37289fc5708f9eeafc00adc07ba891", - "sha256:627298d788edcb317b6a01347428501e773f5e8f2988407231c07e50e3f6c1cf", - "sha256:bdd28cf8302eeca1b4c70ec727de384d4f6ea640b0e698934fd9b4c3bc88eeb1", - "sha256:248198cb714fe09f5c60b6acba3675d52199c6142641536796cdf89dd45e5590", - "sha256:c962cb68987cbfb70b034f153bfa467c615c0b55305d39b3237c4bdbdbc8b0f4", - "sha256:401ba2f6c1f1672b6c38670e1c00fa5f84f841edd30c32742dab5c7151cd89bf", - "sha256:1c103c0ee8235c47c4892288b2287014f33e7cb24b9d4a665be3aa744377dcb9", - "sha256:d7461ef8671ae40f991384bbc4a6b1b79f4e7175d8052584be44041996f46517", - "sha256:3ac9be5763238da1d6fa467c43e3f86472626837a478588c94165df09e62e120", - "sha256:d54a7c37f954fdbb971873c935a77ddc33690cec9b7ac254d9f948c43c32fa83", - "sha256:4d9bf1b23896bcd4d042e823f50ad36fb6d8e1e645a3dfb2fe2f070851489b92", - "sha256:61cf049b1c649d8eec360a1a1d09a61c37b9b2d542364506e8feb4afd232363d", - "sha256:ce3da410ae2ab8709565cc3b18fbe9a0eb96ea7b2189416098c48d839ecced84", - "sha256:e72d8b5056f967ecb57e166537408bc913f2f97dc568027fb6342fcfa9f81d64", - "sha256:11a8ba88ef6ae89110ef029dae7f1a293365e50bdd0c6ca973beed80cec95ae4", - "sha256:974f69112721ba2e8a6acd0f6b68a5e11432710a3eca4e4e6f4d7aaf99214ed1", - "sha256:062c66dabc3faf8e0db1ca09a6b8e308846e5d35f43bed1a68c492b0d96ac171", - "sha256:03a9b9efc280dbe6be149a7fa689f59a822df009eee633fdaf55a6f38795861f", - "sha256:8b3d6dc9981cedfb1ddcd4600ec0c7f5ac2c6ad2dc482011c7eecb4ae9c819e0", - "sha256:09b7d195d163b515ef7c2b2e26a689c9816c83d5319cceac6c36ffdab97ab048", - "sha256:943b94667749d1cfcd964e215a20b9c891deae913202ee8eacaf2b94164b155f", - "sha256:89829f5cfbcb5ad568a3d61bd23a8e33ad69b488d8f6a385e0097a4c20742a9b", - "sha256:ba78da7c940b041cdbb5aaff5afe11e8a8f25fe19564c12eefea5c5bd86930ca", - "sha256:a79b15b9bb4726672865cf5b0f63dee4835974a2b11b49652d70d49003f5d1f4", - "sha256:f6799913eb510b682de971ddef062bbb4a200f190e55cae81c413bc1fd4733c1", - "sha256:e7f5ad6b12f21b77d3a37d5c67260e464f4e9068eb0c0622f61d0e30390b31b6", - "sha256:5f96c92d5f5713ccb71e76dfa14cf819c59ecb9778e94bcb541e13e6d96d1ce5", - "sha256:5357b465e3d6b98972b7810f9969c913d365e75b09b7ba813f5f0577fe1ac9f4", - "sha256:75e1de9ba7c155d89bcf67d149b1c741df553c8158536e8d27e63167403159af", - "sha256:ab87dd91c0c4073758d07334c1e5f712ce8fe48f007b86f8238773963ee700a6" - ], - "markers": "platform_python_implementation != 'PyPy'", - "version": "==1.11.2" - }, - "chardet": { - "hashes": [ - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691", - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae" - ], - "version": "==3.0.4" - }, - "cookies": { - "hashes": [ - "sha256:15bee753002dff684987b8df8c235288eb8d45f8191ae056254812dfd42c81d3", - "sha256:d6b698788cae4cfa4e62ef8643a9ca332b79bd96cb314294b864ae8d7eb3ee8e" - ], - "version": "==2.2.1" - }, - "cryptography": { + "urllib3": { "hashes": [ - "sha256:e130218bfb20d644510f24950cbeee350b15f4b318099b627c29975f12b9b7b3", - "sha256:f2ff1dda46f63b59bf01287c9a5bc8c8278b875a30c0ef26bac807ea4c1632ce", - "sha256:2d51a144f3447d0d87e07a433a11761e6b50c3ed89de6d0406e191d52612150f", - "sha256:4cc18262270dc0266934cfdfea7199dc65b9e3b31c68ead8685eb3649498dbe4", - "sha256:1fc1c6ad9f04871399de407a4f0f555adba5c7ec68068fd27d7ceee9e493755c", - "sha256:317ab5134ea176c03d068de5094e5b6ab580af2ba42ce596536bcc2e694057bc", - "sha256:af5b36499d6790480de0b9876982d027a698149c3f195c888be53fe48faff8e7", - "sha256:58d4c74cd6e6f54a60fd32874c03ba6230c9a1673699ee16811a6b96f91faf56", - "sha256:05cb4130ebe2d591141501ed06b85072cb3be5e5a0e943a5c487bd6858adcf64", - "sha256:791e228b5df8f124bfa33384195864cb9f5420b619580258d9002f14e625312e", - "sha256:b03dc0e2ab4bf02b43cf37ecc994344dc34e90567a8a563fb7538832475974c1", - "sha256:2ec3de13c3b0c5901820a58c337aca0f00be185c49bfc2c07eee0fe0af201c64", - "sha256:af8a9241bc8e1d2c9f10b7f5c3be8540af0c20b8e9af8c8cf4412971b7f78de5", - "sha256:57b7f8be4c817032dcd2c94f4dac6204ec2e85ef1881b4a660e56e7a63529eeb", - "sha256:35eb35340fdc0b772301f9de985db8d732f3c79dbd647d06b9a8e4e111b53950", - "sha256:12a16d4c7324166d78e112892236dd07e9b734cbee267ebf58a66c0f2a6fb3ae", - "sha256:346db72935450d2fb5c807e7f2051830e9bd33ea9471cd14bbf585ea2d5b7c0d", - "sha256:d4dbf045ee55aabdeb1e8e7550783f42c6f51d70a6069bd63669f34a4408b506", - "sha256:3beb79972cc26fa7fb553e59a0e96e476cd73c29c3d80456ac6562e7b217a677", - "sha256:2d72c8cd1e2be9942052b85b1481c74b2eb36780889696ce66afe602c04b9c67", - "sha256:0764c38c8e2e83238be5821757271cd3ef91dc3ee5bd7915c6b8e255bf1ad5c8", - "sha256:06c5a28e12539485c0c9e2e561335b835f5f0fdf2d5700b49835bad8607952ba", - "sha256:68a26c353627163d74ee769d4749f2ee243866e9dac43c93bb33ebd8fbed1199" + "sha256:a68ac5e15e76e7e5dd2b8f94007233e01effe3e50e8daddf69acfd81cb686baf", + "sha256:b5725a0bd4ba422ab0e66e89e030c806576753ea3ee08554382c14e685d117b5" ], - "version": "==2.1.3" - }, - "docker": { + "markers": "python_version != '3.1.*' and python_version < '4' and python_version != '3.2.*' and python_version >= '2.6' and python_version != '3.3.*' and python_version != '3.0.*'", + "version": "==1.23" + } + }, + "develop": { + "atomicwrites": { "hashes": [ - "sha256:11589e3a7742f900978b4d3e3a6910542ea44cc65de82835dc5f25fcdedc2c23", - "sha256:6f417527b3cfd7ba1f5be5fb1d9a2500706b5968f66773131d81c18e19b7a325" + "sha256:0312ad34fcad8fac3704d441f7b317e50af620823353ec657a53e981f92920c0", + "sha256:ec9ae8adaae229e4f8446952d204a3e4b5fdd2d099f9be3aaf556120135fb3ee" ], - "version": "==2.6.1" + "markers": "python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.0.*'", + "version": "==1.2.1" }, - "docker-pycreds": { + "attrs": { "hashes": [ - "sha256:58d2688f92de5d6f1a6ac4fe25da461232f0e0a4c1212b93b256b046b2d714a9", - "sha256:93833a2cf280b7d8abbe1b8121530413250c6cd4ffed2c1cf085f335262f7348" + "sha256:10cbf6e27dbce8c30807caf056c8eb50917e0eaafe86347671b57254006c3e69", + "sha256:ca4be454458f9dec299268d472aaa5a11f67a4ff70093396e1ceae9c76cf4bbb" ], - "version": "==0.2.1" + "version": "==18.2.0" }, - "docutils": { + "bumpversion": { "hashes": [ - "sha256:7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6", - "sha256:02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", - "sha256:51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274" + "sha256:6744c873dd7aafc24453d8b6a1a0d6d109faf63cd0cd19cb78fd46e74932c77e", + "sha256:6753d9ff3552013e2130f7bc03c1007e24473b4835952679653fb132367bdd57" ], - "version": "==0.14" + "index": "pypi", + "version": "==0.5.3" }, "faker": { "hashes": [ - "sha256:f5529ff519a4bed0c0c8ccbbf7ca0d918ed0a9826fe8adc60f58d5b052a946dc", - "sha256:bf7dabcd6807c8829da28a4de491adf7998af506b8571db6a6eb58161157248a" - ], - "version": "==0.8.7" - }, - "idna": { - "hashes": [ - "sha256:8c7309c718f94b3a625cb648ace320157ad16ff131ae0af362c9f21b80ef6ec4", - "sha256:2c6a5de3089009e3da7c5dde64a141dbc8551d5b7f6cf4ed7c2568d0cc520a8f" + "sha256:74b32991f8e08e4f2f84858b919eca253becfaec4b3fa5fcff7fdbd70d5d78b1", + "sha256:c2ce42dd8361e6d392276006d757532562463c8642b1086709584200b7fd7758" ], - "version": "==2.6" + "index": "pypi", + "version": "==0.9.1" }, - "jinja2": { + "flake8": { "hashes": [ - "sha256:74c935a1b8bb9a3947c50a54766a969d4846290e1e788ea44c1392163723c3bd", - "sha256:f84be1bb0040caca4cea721fcbbbbd61f9be9464ca236387158b0feea01914a4" + "sha256:7253265f7abd8b313e3892944044a365e3f4ac3fcdcfb4298f55ee9ddf188ba0", + "sha256:c7841163e2b576d435799169b78703ad6ac1bbb0f199994fc05f700b2a90ea37" ], - "version": "==2.10" + "index": "pypi", + "version": "==3.5.0" }, - "jmespath": { - "hashes": [ - "sha256:f11b4461f425740a1d908e9a3f7365c3d2e569f6ca68a2ff8bc5bcd9676edd63", - "sha256:6a81d4c9aa62caf061cb517b4d9ad1dd300374cd4706997aff9cd6aedd61fc64" - ], - "version": "==0.9.3" - }, - "jsondiff": { - "hashes": [ - "sha256:2d0437782de9418efa34e694aa59f43d7adb1899bd9a793f063867ddba8f7893" - ], - "version": "==1.1.1" - }, - "jsonpickle": { - "hashes": [ - "sha256:cc25dc79571d4ad7db59d05ddb7de0d76a8d598cf6136e1dbeaa9361ebcfe749" - ], - "version": "==0.9.5" - }, - "markupsafe": { + "mccabe": { "hashes": [ - "sha256:a6be69091dac236ea9c6bc7d012beab42010fa914c459791d627dad4910eb665" + "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", + "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f" ], - "version": "==1.0" + "version": "==0.6.1" }, - "mock": { + "more-itertools": { "hashes": [ - "sha256:5ce3c71c5545b472da17b72268978914d0252980348636840bd34a00b5cc96c1", - "sha256:b158b6df76edd239b8208d481dc46b6afd45a846b7812ff0ce58971cf5bc8bba" + "sha256:c187a73da93e7a8acc0001572aebc7e3c69daf7bf6881a2cea10650bd4420092", + "sha256:c476b5d3a34e12d40130bc2f935028b5f636df8f372dc2c1c01dc19681b2039e", + "sha256:fcbfeaea0be121980e15bc97b3817b5202ca73d0eae185b4550cbfce2a3ebb3d" ], - "version": "==2.0.0" + "version": "==4.3.0" }, - "moto": { + "pluggy": { "hashes": [ - "sha256:09580b1be808964a31b99c796e3e802cea619f30c0b023bfe171ea820a332941", - "sha256:d427d6e1a81e926c2b6a071453807b05f4736d65068493e1f3055ac7ee24ea21" + "sha256:6e3836e39f4d36ae72840833db137f7b7d35105079aee6ec4a62d9f80d594dd1", + "sha256:95eb8364a4708392bae89035f45341871286a333f749c3141c20573d2b3876e1" ], - "version": "==1.1.25" - }, - "pbr": { - "hashes": [ - "sha256:60c25b7dfd054ef9bb0ae327af949dd4676aa09ac3a9471cdc871d8a9213f9ac", - "sha256:05f61c71aaefc02d8e37c0a3eeb9815ff526ea28b3b76324769e6158d7f95be1" - ], - "version": "==3.1.1" + "markers": "python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.0.*'", + "version": "==0.7.1" }, "py": { "hashes": [ - "sha256:8cca5c229d225f8c1e3085be4fcf306090b00850fefad892f9d96c7b6e2f310f", - "sha256:ca18943e28235417756316bfada6cd96b23ce60dd532642690dcfdaba988a76d" + "sha256:06a30435d058473046be836d3fc4f27167fd84c45b99704f2fb5509ef61f9af1", + "sha256:50402e9d1c9005d759426988a492e0edaadb7f4e68bcddfea586bc7432d009c6" ], - "version": "==1.5.2" + "markers": "python_version >= '2.7' and python_version != '3.1.*' and python_version != '3.2.*' and python_version != '3.3.*' and python_version != '3.0.*'", + "version": "==1.6.0" }, - "pyaml": { + "pycodestyle": { "hashes": [ - "sha256:d6cf7eb245384dce0920f68b7573978a24520c768a003ed2b7b05bd69ca9d38a", - "sha256:a9a3e83372072fc7dc1aebcab37d6f2e08fb8066f553f31d6fc9cb2ad0b515d3" + "sha256:682256a5b318149ca0d2a9185d365d8864a768a28db66a84a2ea946bcc426766", + "sha256:6c4245ade1edfad79c3446fadfc96b0de2759662dc29d07d80a6f27ad1ca6ba9" ], - "version": "==17.10.0" + "version": "==2.3.1" }, - "pycparser": { + "pyflakes": { "hashes": [ - "sha256:99a8ca03e29851d96616ad0404b4aad7d9ee16f25c9f9708a11faf2810f7b226" + "sha256:08bd6a50edf8cffa9fa09a463063c425ecaaf10d1eb0335a7e8b1401aef89e6f", + "sha256:8d616a382f243dbf19b54743f280b80198be0bca3a5396f1d2e1fca6223e8805" ], - "version": "==2.18" + "version": "==1.6.0" }, "pytest": { "hashes": [ - "sha256:241d7e7798d79192a123ceaf64c602b4d233eacf6d6e42ae27caa97f498b7dc6", - "sha256:6d5bd4f7113b444c55a3bbb5c738a3dd80d43563d063fc42dcb0aaefbdd78b81" + "sha256:453cbbbe5ce6db38717d282b758b917de84802af4288910c12442984bde7b823", + "sha256:a8a07f84e680482eb51e244370aaf2caa6301ef265f37c2bdefb3dd3b663f99d" ], - "version": "==3.2.5" + "index": "pypi", + "version": "==3.8.0" }, "python-dateutil": { "hashes": [ - "sha256:95511bae634d69bc7329ba55e646499a842bc4ec342ad54a8cdb65645a0aad3c", - "sha256:891c38b2a02f5bb1be3e4793866c8df49c7d19baabf9c1bad62547e0b4866aca" - ], - "version": "==2.6.1" - }, - "pytz": { - "hashes": [ - "sha256:80af0f3008046b9975242012a985f04c5df1f01eed4ec1633d56cc47a75a6a48", - "sha256:feb2365914948b8620347784b6b6da356f31c9d03560259070b2f30cff3d469d", - "sha256:59707844a9825589878236ff2f4e0dc9958511b7ffaae94dc615da07d4a68d33", - "sha256:d0ef5ef55ed3d37854320d4926b04a4cb42a2e88f71da9ddfdacfde8e364f027", - "sha256:c41c62827ce9cafacd6f2f7018e4f83a6f1986e87bfd000b8cfbd4ab5da95f1a", - "sha256:8cc90340159b5d7ced6f2ba77694d946fc975b09f1a51d93f3ce3bb399396f94", - "sha256:dd2e4ca6ce3785c8dd342d1853dd9052b19290d5bf66060846e5dc6b8d6667f7", - "sha256:699d18a2a56f19ee5698ab1123bbcc1d269d061996aeb1eda6d89248d3542b82", - "sha256:fae4cffc040921b8a2d60c6cf0b5d662c1190fe54d718271db4eb17d44a185b7" + "sha256:1adb80e7a782c12e52ef9a8182bebeb73f1d7e24e374397af06fb4956c8dc5c0", + "sha256:e27001de32f627c22380a688bcc43ce83504a7bc5da472209b4c70f02829f0b8" ], - "version": "==2017.3" - }, - "pyyaml": { - "hashes": [ - "sha256:3262c96a1ca437e7e4763e2843746588a965426550f3797a79fca9c6199c431f", - "sha256:16b20e970597e051997d90dc2cddc713a2876c47e3d92d59ee198700c5427736", - "sha256:e863072cdf4c72eebf179342c94e6989c67185842d9997960b3e69290b2fa269", - "sha256:bc6bced57f826ca7cb5125a10b23fd0f2fff3b7c4701d64c439a300ce665fff8", - "sha256:c01b880ec30b5a6e6aa67b09a2fe3fb30473008c85cd6a67359a1b15ed6d83a4", - "sha256:827dc04b8fa7d07c44de11fabbc888e627fa8293b695e0f99cb544fdfa1bf0d1", - "sha256:592766c6303207a20efc445587778322d7f73b161bd994f227adaa341ba212ab", - "sha256:5f84523c076ad14ff5e6c037fe1c89a7f73a3e04cf0377cb4d017014976433f3", - "sha256:0c507b7f74b3d2dd4d1322ec8a94794927305ab4cebbe89cc47fe5e81541e6e8", - "sha256:b4c423ab23291d3945ac61346feeb9a0dc4184999ede5e7c43e1ffb975130ae6", - "sha256:ca233c64c6e40eaa6c66ef97058cdc80e8d0157a443655baa1b2966e812807ca", - "sha256:4474f8ea030b5127225b8894d626bb66c01cda098d47a2b0d3429b6700af9fd8", - "sha256:326420cbb492172dec84b0f65c80942de6cedb5233c413dd824483989c000608", - "sha256:5ac82e411044fb129bae5cfbeb3ba626acb2af31a8d17d175004b70862a741a7" - ], - "version": "==3.12" - }, - "requests": { - "hashes": [ - "sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b", - "sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e" - ], - "version": "==2.18.4" - }, - "s3transfer": { - "hashes": [ - "sha256:c7b16f4cca5acd2bd57ac9623bfba3fece047247392893506d0d2e6f25620eb3", - "sha256:76f1f58f4a47e2c8afa135e2c76958806a3abbc42b721d87fd9d11409c75d979" - ], - "version": "==0.1.11" + "markers": "python_version >= '2.7'", + "version": "==2.7.3" }, "six": { "hashes": [ - "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb", - "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9" + "sha256:70e8a77beed4562e7f14fe23a786b54f6296e34344c23bc42f07b15018ff98e9", + "sha256:832dc0e10feb1aa2c68dcc57dbb658f1c7e65b9b61af69048abc87a2db00a0eb" ], "version": "==1.11.0" }, "text-unidecode": { "hashes": [ - "sha256:02efd86b9c0f489f858d8cead62e94d3760dab444054b258734716f7602330a3", - "sha256:d0afd5e8a7ac69bfb1372e1bbfa3c63c22e3db8ae1284690e96b45c4430d08d0" - ], - "version": "==1.1" - }, - "urllib3": { - "hashes": [ - "sha256:06330f386d6e4b195fbfc736b297f58c5a892e4440e54d294d7004e3a9bbea1b", - "sha256:cc44da8e1145637334317feebd728bd869a35285b93cbb4cca2577da7e62db4f" - ], - "version": "==1.22" - }, - "websocket-client": { - "hashes": [ - "sha256:91222bb3a22ba989ac87eec9121655f295dcb746b6207c5576ffa549ab69302c", - "sha256:15f585566e2ea7459136a632b9785aa081093064391878a448c382415e948d72" - ], - "version": "==0.44.0" - }, - "werkzeug": { - "hashes": [ - "sha256:e8549c143af3ce6559699a01e26fa4174f4c591dbee0a499f3cd4c3781cdec3d", - "sha256:903a7b87b74635244548b30d30db4c8947fe64c5198f58899ddcd3a13c23bb26" - ], - "version": "==0.12.2" - }, - "wrapt": { - "hashes": [ - "sha256:d4d560d479f2c21e1b5443bbd15fe7ec4b37fe7e53d335d3b9b0a7b1226fe3c6" - ], - "version": "==1.10.11" - }, - "xmltodict": { - "hashes": [ - "sha256:add07d92089ff611badec526912747cf87afd4f9447af6661aca074eeaf32615", - "sha256:8f8d7d40aa28d83f4109a7e8aa86e67a4df202d9538be40c0cb1d70da527b0df" + "sha256:5a1375bb2ba7968740508ae38d92e1f889a0832913cb1c447d5e2046061a396d", + "sha256:801e38bd550b943563660a91de8d4b6fa5df60a542be9093f7abf819f86050cc" ], - "version": "==0.11.0" + "version": "==1.2" } } } diff --git a/README.md b/README.md index 8eee425..0543a9d 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,19 @@ A kinesis consumer is purely written in python. -# Features +## Features * Read records from a stream with multiple shards -# Todo +## Todo * Open a consumer when adding a new shard * Close a consumer when shutting down an existing shard * Save checkpoint for each shard * Allow kcpy to run on multiple machines + +## Changelog + +### 0.1.0 + +* First version of kcpy. diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..6c6aa7c --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.1.0 \ No newline at end of file diff --git a/kcpy/__init__.py b/kcpy/__init__.py new file mode 100644 index 0000000..3da179f --- /dev/null +++ b/kcpy/__init__.py @@ -0,0 +1,6 @@ +__title__ = 'kcpy' +__version__ = '0.1.0' +__author__ = 'Hengfeng Li' +__license__ = 'MIT 2018' + +from .core import * diff --git a/kcpy.py b/kcpy/core.py similarity index 100% rename from kcpy.py rename to kcpy/core.py diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 0000000..a714bf9 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,8 @@ +[bdist_wheel] +universal = 1 + +[flake8] +ignore = E226,E302,E41,F401,E402,F403 +max-line-length = 120 +exclude = tests/*,.eggs/* +max-complexity = 10 diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..e3de1f7 --- /dev/null +++ b/setup.py @@ -0,0 +1,37 @@ +#!/usr/bin/env python + +import kcpy + +from setuptools import setup, find_packages + +setup( + name='kcpy', + version=kcpy.__version__, + description='A kinesis consumer is purely written in python.', + author='Hengfeng Li', + author_email='hengf.li@gmail.com', + license='MIT License', + + packages=find_packages(), + package_dir={'kcpy': 'kcpy'}, + include_package_data=True, + python_requires='>=3.5.0', + keywords=[ + 'kinesis', + 'consumer', + 'stream', + 'processing', + 'queue', + ], + scripts=[], + install_requires=[ + 'boto3', + ], + dependency_links=[], + tests_require=[ + 'pytest', + 'moto', + 'faker', + ], + zip_safe=False, +) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test.py b/tests/tests.py similarity index 100% rename from test.py rename to tests/tests.py