Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions lixinger_openapi/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# -*- coding: utf-8 -*-
'''
"""
理杏仁开放平台API,非官方
'''
"""
from lixinger_openapi.query import query_json, query_dataframe
from lixinger_openapi.token import set_token
from ._version import __version__

__version__ = '1.0.2'

__author__ = 'sheki lyu'
__author__ = "sheki lyu"

name = "lixinger_openapi"
1 change: 1 addition & 0 deletions lixinger_openapi/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.0.3'
2 changes: 1 addition & 1 deletion lixinger_openapi/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
import json
import requests
from pandas.io.json import json_normalize
from pandas import json_normalize
from lixinger_openapi.token import get_token

BASEURL = "https://open.lixinger.com/api/"
Expand Down
4 changes: 4 additions & 0 deletions requirement.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pandas
requests
setuptools
tox
61 changes: 41 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
# -*- coding: utf-8 -*-
'''
"""
理杏仁开放平台API包安装
'''
import lixinger_openapi as lo
from setuptools import (
find_packages,
setup,
)
"""

import importlib.util
from pathlib import Path
from types import ModuleType

from setuptools import find_packages, setup


def get_version() -> str:
"""
获取 _version.py 文件里的版本号
"""
version_file: Path = Path(__file__).parent / "lixinger_openapi" / "_version.py"
assert version_file is not None, "版本文件不存在"
spec = importlib.util.spec_from_file_location("_version", version_file)
if spec is None or spec.loader is None:
print(f"Warning: Could not load version from {version_file}")
return ""

# 使用 importlib.util.module_from_spec 创建一个新的模块对象,并执行
version_module: ModuleType = importlib.util.module_from_spec(spec)
spec.loader.exec_module(version_module)
return version_module.__version__

version = lo.__version__

with open("README.md", "r") as fh:
# 读取README.md内容作为长描述
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()

setup(
name='lixinger_openapi',
version=version,
description='lixinger openapi',
name="lixinger_openapi",
version=get_version(),
description="lixinger openapi",
long_description=long_description,
long_description_content_type="text/markdown",
packages=find_packages(),
author='sheki lyu',
author_email='lvxueji@gmail.com',
license='Apache License v2',
author="sheki lyu",
author_email="lvxueji@gmail.com",
license="Apache License v2",
install_requires=[
"requests",
"pandas",
"numpy",
],
url='https://github.com/ShekiLyu/lixinger-openapi',
url="https://github.com/ShekiLyu/lixinger-openapi",
classifiers=[
'Operating System :: OS Independent',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
"Operating System :: OS Independent",
"Programming Language :: Python :: 3", # 移除对Python 2.7的支持
"License :: OSI Approved :: Apache Software License",
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries :: Python Modules",
],
python_requires=">=3.6", # 指定最低Python版本要求
)
10 changes: 10 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[tox]
envlist = py36, py37, py38, py39, py310, py311, py312, py313

[testenv]
deps =
pandas
requests
setuptools
commands =
pytest