Fixed setup
This commit is contained in:
parent
7cfd5ed51b
commit
bb4a1c0cf0
|
@ -53,7 +53,10 @@ class PbcClient:
|
||||||
session: requests.Session
|
session: requests.Session
|
||||||
|
|
||||||
def get_json(
|
def get_json(
|
||||||
self, url: str, data: Mapping[str, str] = frozendict(), method='POST',
|
self,
|
||||||
|
url: str,
|
||||||
|
data: Mapping[str, str] = frozendict(),
|
||||||
|
method='POST',
|
||||||
) -> tuple[dict, datetime.datetime]:
|
) -> tuple[dict, datetime.datetime]:
|
||||||
headers = {
|
headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
@ -61,7 +64,10 @@ class PbcClient:
|
||||||
}
|
}
|
||||||
|
|
||||||
response = self.session.request(
|
response = self.session.request(
|
||||||
method, url, headers=headers, data=json.dumps(data),
|
method,
|
||||||
|
url,
|
||||||
|
headers=headers,
|
||||||
|
data=json.dumps(data),
|
||||||
)
|
)
|
||||||
response.raise_for_status()
|
response.raise_for_status()
|
||||||
date_text = response.headers.get('last-modified') or response.headers.get(
|
date_text = response.headers.get('last-modified') or response.headers.get(
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
beautifulsoup4
|
|
||||||
lxml
|
|
||||||
requests
|
|
||||||
requests_cache
|
|
||||||
browsercookie
|
|
||||||
cfscrape
|
|
||||||
frozendict
|
|
||||||
python-kucoin
|
|
||||||
krakenex
|
|
34
setup.py
34
setup.py
|
@ -5,6 +5,7 @@ from setuptools import setup
|
||||||
|
|
||||||
PACKAGE_NAME = 'personal_data'
|
PACKAGE_NAME = 'personal_data'
|
||||||
|
|
||||||
|
|
||||||
with open('README.md') as f:
|
with open('README.md') as f:
|
||||||
readme = f.read()
|
readme = f.read()
|
||||||
|
|
||||||
|
@ -14,8 +15,14 @@ with open(PACKAGE_NAME + '/_version.py') as f:
|
||||||
version = match.group(2)
|
version = match.group(2)
|
||||||
del match, text
|
del match, text
|
||||||
|
|
||||||
with open('requirements.txt') as f:
|
|
||||||
install_requires = f.read().strip().split('\n')
|
def parse_requirements(text: str) -> list[str]:
|
||||||
|
return text.strip().split('\n')
|
||||||
|
|
||||||
|
|
||||||
|
def read_requirements(path: str):
|
||||||
|
with open(path) as f:
|
||||||
|
return parse_requirements(f.read())
|
||||||
|
|
||||||
|
|
||||||
def get_short_description(readme: str):
|
def get_short_description(readme: str):
|
||||||
|
@ -28,6 +35,23 @@ def get_short_description(readme: str):
|
||||||
raise Exception(msg) from err
|
raise Exception(msg) from err
|
||||||
|
|
||||||
|
|
||||||
|
REQUIREMENTS_MAIN = """
|
||||||
|
beautifulsoup4
|
||||||
|
lxml
|
||||||
|
requests
|
||||||
|
requests_cache
|
||||||
|
browsercookie
|
||||||
|
cfscrape
|
||||||
|
frozendict
|
||||||
|
python-kucoin
|
||||||
|
krakenex
|
||||||
|
"""
|
||||||
|
|
||||||
|
REQUIREMENTS_TEST = """
|
||||||
|
pytest
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name=PACKAGE_NAME,
|
name=PACKAGE_NAME,
|
||||||
version=version,
|
version=version,
|
||||||
|
@ -38,5 +62,9 @@ setup(
|
||||||
author_email='jonjmaa@gmail.com',
|
author_email='jonjmaa@gmail.com',
|
||||||
url='https://gitfub.space/Jmaa/' + PACKAGE_NAME,
|
url='https://gitfub.space/Jmaa/' + PACKAGE_NAME,
|
||||||
packages=[PACKAGE_NAME],
|
packages=[PACKAGE_NAME],
|
||||||
install_requires=install_requires,
|
install_requires=parse_requirements(REQUIREMENTS_MAIN),
|
||||||
|
extras_require={
|
||||||
|
'test': parse_requirements(REQUIREMENTS_TEST),
|
||||||
|
},
|
||||||
|
python_requires='>=3.9',
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user