improvement: maintain project meta data all in pyproject.toml

1, remove __about__.py
2, project version and description are all configured in pyproject.toml
This commit is contained in:
debugtalk
2019-07-16 18:56:52 +08:00
parent b60abd4321
commit a039b80fa7
5 changed files with 12 additions and 13 deletions

View File

@@ -1,9 +0,0 @@
__title__ = 'HttpRunner'
__description__ = 'One-stop solution for HTTP(S) testing.'
__url__ = 'https://github.com/HttpRunner/HttpRunner'
__version__ = '2.2.4'
__author__ = 'debugtalk'
__author_email__ = 'mail@debugtalk.com'
__license__ = 'Apache-2.0'
__copyright__ = 'Copyright 2017 debugtalk'
__cake__ = u'\u2728 \U0001f370 \u2728'

View File

@@ -0,0 +1,9 @@
import configparser
import json
cf_parser = configparser.ConfigParser(allow_no_value=True)
cf_parser.read("pyproject.toml")
__version__ = json.loads(cf_parser["tool.poetry"]["version"])
__description__ = json.loads(cf_parser["tool.poetry"]["description"])
__all__ = ["__version__", "__description__"]

View File

@@ -5,7 +5,7 @@ def main_hrun():
"""
import argparse
from httprunner import logger
from httprunner.__about__ import __description__, __version__
from httprunner import __description__, __version__
from httprunner.api import HttpRunner
from httprunner.compat import is_py2
from httprunner.validator import validate_json_file

View File

@@ -10,8 +10,7 @@ from collections import Iterable
from datetime import datetime
import requests
from httprunner import loader, logger
from httprunner.__about__ import __version__
from httprunner import __version__, loader, logger
from httprunner.compat import basestring, bytes, json, numeric_types
from jinja2 import Template, escape

View File

@@ -4,7 +4,7 @@ version = "2.2.4"
description = "One-stop solution for HTTP(S) testing."
license = "Apache-2.0"
readme = "README.md"
authors = ["debugtalk <mail@debugtalk.com>"]
authors = ["debugtalk <debugtalk@gmail.com>"]
homepage = "https://github.com/HttpRunner/HttpRunner"
repository = "https://github.com/HttpRunner/HttpRunner"