Skip to content

Commit

Permalink
Feature/conf (#3)
Browse files Browse the repository at this point in the history
* add travis

* update Travis

* add travis

* change readme

* add deploy pypi

* release 0.2.2

* change conf base path & change get_logger import method

* add travis secure

* change travis secure
  • Loading branch information
AddisonGao authored Aug 28, 2018
1 parent 08b2ed5 commit 689970d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,21 @@ jobs:
- pip install .
# command to run tests
script: pytest

- stage: release to pypi
if: type = push
language: python
catch: pip
python:
- "3.6"
script:
- echo "Skipping tests"
deploy:
provider: pypi
user: Addison_Gao
password:
secure: "iGWxolH0FRgklyoN4W75oIhDbv5iBDSqU89dt9gA2abvZR4yPmcJ/LavGLVSt0YtT84uDaRpyRvk+VANfT0viJiRhDIBUpMloUPAaj4oBTS+Pa7x7LSWUQMLy3DvVUPzSejJ5bZ34fhJXejwm+shmLKf9vS1Vw0GNl69tFyr73DalixyF9Rkvoi2qFmXQnN1tP2WN1MeD6FbITibx2h0vwutWJFoHslh+Q3zKt+C0MJ6zcCi40YhEkAsbGYMpDU+08WSqUgfYPA+x3htXF4MoJ01AwaT1lj9zC2T0eAPloZxqRCCJ2Lc12pBLsxH3VoDsjqk43RGUbBmon2dr1WZVKh9KHElsa/ZBWiXycQO4w02tRWnd2olyRehwGZSX5Xyl4Rln9JZTomAGscPkNVCBQSH0Kjw/HBEF9Dg2jtuB6xuDYdaLJhzROMpsIKZ3CPLpoYySeHyfocDG4VMffVzB+JSD4V9aAwOhWKoSJCYt/X9vepM+iYNSOHTPXJ1NcSChSFpXarXq+Pblh9t7Db0BU1yOLzOZRWB5PuZm0a01R/ie8/0reF2Z/6SICrhl5fkNgM5xVWO/vM0hLvbJeEwykBixXRUw4m/8QekeIMj48C6KcgCjBtcAJ26VreFCIgDNsckU0w+0vBzFhM4aBiixgMZ0nS5M7h9uMBKzRpa5fU="
on:
tags: true
server: https://test.pypi.org/legacy/

5 changes: 3 additions & 2 deletions lyrebird_api_coverage/client/load_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import hashlib
import json
import lyrebird
from lyrebird.log import get_logger
import os

from lyrebird_api_coverage.client.context import app_context
Expand All @@ -24,7 +25,7 @@ def auto_load_base():
# 读取指定base文件,写入到base.json
if lyrebird_conf.get('hunter.base'):
base_path = lyrebird_conf.get('hunter.base')
base = codecs.open(os.path.join(PLUGINS_CONF_DIR, base_path), 'r', 'utf-8').read()
base = codecs.open(base_path, 'r', 'utf-8').read()
f = codecs.open(DEFAULT_BASE, 'w', 'utf-8')
f.write(base)
f.close()
Expand All @@ -34,7 +35,7 @@ def auto_load_base():
elif not os.path.exists(DEFAULT_BASE):
copy_file(DEFAULT_BASE)
if not codecs.open(DEFAULT_BASE, 'r', 'utf-8').read():
lyrebird.get_logger().error('Base is None.Please check your base file of API-Coverage.')
get_logger().error('Base is None.Please check your base file of API-Coverage.')
else:
json_obj = json.loads(codecs.open(DEFAULT_BASE, 'r', 'utf-8').read())
app_context.base_sha1 = get_file_sha1(DEFAULT_BASE)
Expand Down
3 changes: 2 additions & 1 deletion lyrebird_api_coverage/proxy/proxy_handler.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import lyrebird
from lyrebird.log import get_logger
from flask import Response
from lyrebird import HandlerContext

Expand Down Expand Up @@ -37,7 +38,7 @@ def handle(self, handler_context: HandlerContext):
if not app_context.base_list:
base_dict = BaseDataHandler().get_base_source()
if isinstance(base_dict, Response):
lyrebird.get_logger().error('API-Coverage base file is None.')
get_logger().error('API-Coverage base file is None.')
else:
mergeAlgorithm.first_result_handler(base_dict)

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='lyrebird-api-coverage',
version='0.2.1',
version='0.2.2',
packages=['lyrebird_api_coverage'],
url='https://github.com/meituan/lyrebird-api-coverage',
author='HBQA',
Expand Down

0 comments on commit 689970d

Please sign in to comment.