Hotfix/urllib to dev group (#5732)

* use the urllib3 dependency on the dev group instead

* adapt the version script for the nightlies - if it's a nightly the package distribution name will have a different name

* add dev dependencies to the dev installation bc of the ci

* updating the import on validate_call according to: https://docs.pydantic.dev/latest/concepts/validation_decorator/
the way we were importing it breaks if pydantic=2.5
@montezdesousa

* loosing urllib3 version specification on the provider and adding it to platform dev deps

* rmeoving urllib from top level deps; and removing --with dev flag

* changing to ^ instead

* Revert "changing to ^ instead"

This reverts commit 7300904e9f.

* unnecessary dep

---------

Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
Co-authored-by: James Maslek <jmaslek11@gmail.com>
This commit is contained in:
Henrique Joaquim
2023-11-17 11:43:45 +00:00
committed by GitHub
parent 63fe4422fe
commit 8467ac5acc
3 changed files with 12 additions and 4 deletions

View File

@@ -1,7 +1,8 @@
"""Decorators for the OpenBB Platform static assets."""
from functools import wraps
from typing import Any, Callable, Optional, TypeVar, overload
from pydantic.validate_call import validate_call
from pydantic import validate_call
from typing_extensions import ParamSpec
P = ParamSpec("P")

View File

@@ -10,9 +10,15 @@ PACKAGE = "openbb"
def get_package_version(package: str):
"""Retrieve the version of a package from installed pip packages."""
version = pkg_resources.get_distribution(package).version
is_nightly = False
try:
version = pkg_resources.get_distribution(package).version
except pkg_resources.DistributionNotFound:
package += "-nightly"
is_nightly = True
version = pkg_resources.get_distribution(package).version
if is_git_repo(Path(__file__).parent.resolve()):
if is_git_repo(Path(__file__).parent.resolve()) and not is_nightly:
version += "dev"
return version

View File

@@ -11,9 +11,10 @@ python = "^3.8"
importlib_metadata = "^6.8.0"
pydantic = "^2.4.2"
requests = "^2.31.0"
urllib3 = "<2.0.0"
importlib-metadata = "^6.8.0"
python-dotenv = "^1.0.0"
[tool.poetry.group.dev.dependencies]
pytest-recorder = "^0.2.3"
[build-system]