1
0

Fixed setup
Some checks failed
Build container / Python-Test (push) Failing after 22s
Build container / Python-Package (push) Failing after 21s
Build container / Container-Package (push) Failing after 17s

This commit is contained in:
Jon Michael Aanes 2024-05-22 23:21:29 +02:00
parent 7cfd5ed51b
commit bb4a1c0cf0
Signed by: Jmaa
SSH Key Fingerprint: SHA256:Ab0GfHGCblESJx7JRE4fj4bFy/KRpeLhi41y4pF3sNA
3 changed files with 39 additions and 14 deletions

View File

@ -53,7 +53,10 @@ class PbcClient:
session: requests.Session
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]:
headers = {
'Content-Type': 'application/json',
@ -61,7 +64,10 @@ class PbcClient:
}
response = self.session.request(
method, url, headers=headers, data=json.dumps(data),
method,
url,
headers=headers,
data=json.dumps(data),
)
response.raise_for_status()
date_text = response.headers.get('last-modified') or response.headers.get(

View File

@ -1,9 +0,0 @@
beautifulsoup4
lxml
requests
requests_cache
browsercookie
cfscrape
frozendict
python-kucoin
krakenex

View File

@ -5,6 +5,7 @@ from setuptools import setup
PACKAGE_NAME = 'personal_data'
with open('README.md') as f:
readme = f.read()
@ -14,8 +15,14 @@ with open(PACKAGE_NAME + '/_version.py') as f:
version = match.group(2)
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):
@ -28,6 +35,23 @@ def get_short_description(readme: str):
raise Exception(msg) from err
REQUIREMENTS_MAIN = """
beautifulsoup4
lxml
requests
requests_cache
browsercookie
cfscrape
frozendict
python-kucoin
krakenex
"""
REQUIREMENTS_TEST = """
pytest
"""
setup(
name=PACKAGE_NAME,
version=version,
@ -38,5 +62,9 @@ setup(
author_email='jonjmaa@gmail.com',
url='https://gitfub.space/Jmaa/' + 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',
)