diff --git a/bin/DBConfig.py b/bin/DBConfig.py index c65656f..0ae47c6 100644 --- a/bin/DBConfig.py +++ b/bin/DBConfig.py @@ -10,7 +10,7 @@ from datetime import datetime # 定义公共的部分 path = Path(__file__) etc_dir = path.parent.parent / "etc" -config_file_patch = path.parent.parent / "test_config.yml" +config_file_patch = etc_dir / "test_config.yml" # 获取配置文件 diff --git a/bin/SQLDataCreating.py b/bin/SQLDataCreating.py index bbce3a8..b9c59fe 100644 --- a/bin/SQLDataCreating.py +++ b/bin/SQLDataCreating.py @@ -19,15 +19,15 @@ from schedule import every, repeat, run_pending """ # 目前支持 MySQL和Oracle两种数据库,其他的数据库需要做适配 -DBType = "mysql" +DBType = DBConfig.config['DBType'] #获取连接信息 def get_db_info(dbtype=DBType): db_config = {} - if dbtype == "mysql": + if dbtype == "MySQL": db_config = DBConfig.mysql_config() - elif dbtype == "oracle": + elif dbtype == "Oracle": db_config = DBConfig.oracle_config() else: assert False ,"DBType is not support." diff --git a/requirements.txt b/requirements.txt index 5457dd0..18cfead 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -#faker==4.18.0 py36 +PyYAML==6.0.1 faker==19.12.0 schedule==1.2.1 JayDeBeApi==1.2.3 diff --git a/tox.ini b/tox.ini index 70f8d89..266d211 100644 --- a/tox.ini +++ b/tox.ini @@ -19,35 +19,10 @@ usedevelop = True -[testenv:devenv2] -envdir = devenv2 -basepython = python2.7 -usedevelop = True - - [testenv:py38-release] basepython = python3.8 deps = -r{toxinidir}/requirements.txt commands = - {envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/dataCreating_v1.0.1 {toxinidir} - - -[testenv:py310-release] -basepython = python3.10 -deps = - -r{toxinidir}/requirements.txt - -commands = - {envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/dataCreating_v1.0.1 {toxinidir} - - -[testenv:py27-release] -basepython = python2.7 -deps = - -r{toxinidir}/requirements.txt - -commands = - {envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/dataCreating_v1.0.1 {toxinidir} - + {envpython} {toxinidir}/release.py {envdir} {envsitepackagesdir} {toxinidir}/build/dataCreating_v1.0.2 {toxinidir}