Skip to content

Commit

Permalink
fixed poetry project
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Apr 17, 2024
1 parent ffb6990 commit 20e0202
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 14 deletions.
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ runtimeInputs = [
runtimeInputs = [mantis-blackbox-package];
text = ''
# shellcheck disable=SC2068
mantis-blackbox $@
blackbox $@
'';
};

Expand Down Expand Up @@ -473,6 +473,7 @@ runtimeInputs = [
datamodel-code-generator
cosmwasm-json-schema-ts
mantis-blackbox
mantis-blackbox-package
# pyscipopt-latest

# maturin-latest
Expand Down
10 changes: 5 additions & 5 deletions mantis/blackbox/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from cachetools import TTLCache
from cosmpy.aerial.config import NetworkConfig
from cosmpy.aerial.contract import LedgerClient, LedgerContract
from cvm_indexer import ExtendedCvmRegistry, for_simulation
from blackbox.cvm_indexer import ExtendedCvmRegistry, for_simulation
from fastapi import Depends, FastAPI
from loguru import logger
from shelved_cache import PersistentCache
Expand All @@ -23,8 +23,8 @@
OsmosisPoolsResponse,
)
from blackbox.settings import settings
from simulation.routers import generic_linear, test_generic_linear
from simulation.routers.angeris_cvxpy import cvxpy_to_data
# from simulation.routers import generic_linear, test_generic_linear
# from simulation.routers.angeris_cvxpy import cvxpy_to_data
from simulation.routers.data import (
AllData as SimulationData,
)
Expand Down Expand Up @@ -55,7 +55,7 @@ def create_app() -> FastAPI:
"""
app = FastAPI()

cache = PersistentCache(TTLCache, filename="get_remote_data.cache", ttl=12 * 1000, maxsize=2)
cache = PersistentCache(TTLCache, filename="$TEMP/get_remote_data.cache", ttl=12 * 1000, maxsize=2)


@app.get("/simulator/router")
Expand Down Expand Up @@ -245,7 +245,7 @@ def start():
logger.info(sys.path)
logger.info(os.environ)
uvicorn.run(
"main:app",
"blackbox.main:app",
host="0.0.0.0",
port=settings.port,
reload=True,
Expand Down
4 changes: 2 additions & 2 deletions mantis/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions mantis/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
[tool.poetry]
name = "mantis"
version = "0.0.2"
name = "blackbox"
version = "0.0.3"
description = "Python server which solves problems from provided input and additional data obtained from chains/indexers and outputs single route solution."
authors = []
package-mode = true
packages = [
{ include = "simulation" },
{ include = "blackbox" },
{ include = "cvm_runtime", from = "blackbox" },
{ include = "main.py", from = "blackbox" },

# { include = "cvm_runtime", from = "blackbox" },
# { include = "main.py", from = "blackbox" },
]

[tool.poetry.dependencies]
python = ">=3.11.6, <=3.11.7"
python = ">=3.11.6, <=3.11.8"

#fastapi-cache2 = "^0.2.1" # no needed now, too many things
bech32 = "1.2.0"
Expand Down Expand Up @@ -81,7 +83,6 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry.scripts]
blackbox = 'blackbox.main:start'
dzmitry_solver = 'simulation.routers.test_dzmitry:simulate'

[tool.ruff]
unsafe-fixes = true
Expand Down
File renamed without changes.

0 comments on commit 20e0202

Please sign in to comment.