Version file for client and isort

pull/457/head
kompotkot 2021-11-24 09:42:59 +00:00
rodzic 42025382e7
commit 45032157dd
5 zmienionych plików z 15 dodań i 7 usunięć

Wyświetl plik

@ -0,0 +1,3 @@
[settings]
profile = black
multi_line_output = 3

Wyświetl plik

@ -0,0 +1,3 @@
[settings]
profile = black
multi_line_output = 3

Wyświetl plik

@ -1,20 +1,18 @@
from dataclasses import dataclass, field
import logging import logging
import os import os
from dataclasses import dataclass, field
from typing import Any, Dict, List, Optional from typing import Any, Dict, List, Optional
import requests import requests
from .version import MOONSTREAM_CLIENT_VERSION
logger = logging.getLogger(__name__) logger = logging.getLogger(__name__)
log_level = logging.INFO log_level = logging.INFO
if os.environ.get("DEBUG", "").lower() in ["true", "1"]: if os.environ.get("DEBUG", "").lower() in ["true", "1"]:
log_level = logging.DEBUG log_level = logging.DEBUG
logger.setLevel(log_level) logger.setLevel(log_level)
# Keep this synchronized with the version in setup.py
CLIENT_VERSION = "0.0.2"
ENDPOINT_PING = "/ping" ENDPOINT_PING = "/ping"
ENDPOINT_VERSION = "/version" ENDPOINT_VERSION = "/version"
ENDPOINT_NOW = "/now" ENDPOINT_NOW = "/now"
@ -100,7 +98,7 @@ class Moonstream:
self.timeout = timeout self.timeout = timeout
self._session = requests.Session() self._session = requests.Session()
self._session.headers.update( self._session.headers.update(
{"User-Agent": f"Moonstream Python client (version {CLIENT_VERSION})"} {"User-Agent": f"Moonstream Python client (version {MOONSTREAM_CLIENT_VERSION})"}
) )
def ping(self) -> Dict[str, Any]: def ping(self) -> Dict[str, Any]:

Wyświetl plik

@ -0,0 +1 @@
MOONSTREAM_CLIENT_VERSION = "0.0.3"

Wyświetl plik

@ -1,12 +1,14 @@
from setuptools import find_packages, setup from setuptools import find_packages, setup
from moonstream.version import MOONSTREAM_CLIENT_VERSION
long_description = "" long_description = ""
with open("README.md") as ifp: with open("README.md") as ifp:
long_description = ifp.read() long_description = ifp.read()
setup( setup(
name="moonstream", name="moonstream",
version="0.0.2", version=MOONSTREAM_CLIENT_VERSION,
packages=find_packages(), packages=find_packages(),
package_data={"moonstream": ["py.typed"]}, package_data={"moonstream": ["py.typed"]},
install_requires=["requests", "dataclasses; python_version=='3.6'"], install_requires=["requests", "dataclasses; python_version=='3.6'"],
@ -14,6 +16,7 @@ setup(
"dev": [ "dev": [
"black", "black",
"mypy", "mypy",
"isort",
"wheel", "wheel",
"types-requests", "types-requests",
"types-dataclasses", "types-dataclasses",