Merge pull request #22 from bugout-dev/fix-requirements-setup

Fix requirements and setup.py
pull/26/head
Sergei Sumarokov 2021-07-28 13:20:11 +03:00 zatwierdzone przez GitHub
commit 876c23aac1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
10 zmienionych plików z 30 dodań i 17 usunięć

Wyświetl plik

@ -8,6 +8,7 @@ certifi==2021.5.30
charset-normalizer==2.0.3
click==8.0.1
fastapi==0.66.0
-e git+https://git@github.com/bugout-dev/moonstream.git@60e90219a8e24077a1ab046463775f837df5f03e#egg=moonstreamdb&subdirectory=db
h11==0.12.0
idna==3.2
jmespath==0.10.0

Wyświetl plik

@ -29,5 +29,4 @@ setup(
"Topic :: Software Development :: Libraries",
],
url="https://github.com/bugout-dev/moonstream",
entry_points={"console_scripts": ["moonstream=moonstream.cli:main"]},
)

Wyświetl plik

@ -0,0 +1,5 @@
"""
Moonstream crawlers version.
"""
MOONSTREAMCRAWLERS_VERSION = "0.0.1"

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -1,3 +1,3 @@
export MOONSTREAM_IPC_PATH=null
export MOONSTREAM_CRAWL_WORKERS=4
export EXPLORATION_DB_URI="<moonstream_database_uri>"
export MOONSTREAM_DB_URI="<moonstream_database_uri>"

Wyświetl plik

@ -1,12 +1,14 @@
from setuptools import find_packages, setup
from moonstreamcrawlers.version import MOONSTREAMCRAWLERS_VERSION
long_description = ""
with open("README.md") as ifp:
long_description = ifp.read()
setup(
name="moonstreamcrawlers",
version="0.0.1",
version=MOONSTREAMCRAWLERS_VERSION,
author="Bugout.dev",
author_email="engineers@bugout.dev",
license="Apache License 2.0",
@ -28,7 +30,7 @@ setup(
],
python_requires=">=3.6",
packages=find_packages(),
package_data={"bugout": ["py.typed"]},
package_data={"moonstreamcrawlers": ["py.typed"]},
zip_safe=False,
install_requires=["web3"],
extras_require={"dev": ["black", "mypy"]},

Wyświetl plik

@ -1,5 +1,5 @@
"""
Exploration database connection.
Moonstream database connection.
"""
from contextlib import contextmanager
import os
@ -7,20 +7,20 @@ import os
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker, Session
EXPLORATION_DB_URI = os.environ.get("EXPLORATION_DB_URI")
if EXPLORATION_DB_URI is None:
raise ValueError("EXPLORATION_DB_URI environment variable must be set")
EXPLORATION_POOL_SIZE_RAW = os.environ.get("EXPLORATION_POOL_SIZE", 0)
MOONSTREAM_DB_URI = os.environ.get("MOONSTREAM_DB_URI")
if MOONSTREAM_DB_URI is None:
raise ValueError("MOONSTREAM_DB_URI environment variable must be set")
MOONSTREAM_POOL_SIZE_RAW = os.environ.get("MOONSTREAM_POOL_SIZE", 0)
try:
if EXPLORATION_POOL_SIZE_RAW is not None:
EXPLORATION_POOL_SIZE = int(EXPLORATION_POOL_SIZE_RAW)
if MOONSTREAM_POOL_SIZE_RAW is not None:
MOONSTREAM_POOL_SIZE = int(MOONSTREAM_POOL_SIZE_RAW)
except:
raise Exception(
f"Could not parse EXPLORATION_POOL_SIZE as int: {EXPLORATION_POOL_SIZE_RAW}"
f"Could not parse MOONSTREAM_POOL_SIZE as int: {MOONSTREAM_POOL_SIZE_RAW}"
)
# https://docs.sqlalchemy.org/en/14/core/pooling.html#sqlalchemy.pool.QueuePool
engine = create_engine(EXPLORATION_DB_URI, pool_size=EXPLORATION_POOL_SIZE)
engine = create_engine(MOONSTREAM_DB_URI, pool_size=MOONSTREAM_POOL_SIZE)
SessionLocal = sessionmaker(bind=engine)

Wyświetl plik

@ -0,0 +1,5 @@
"""
Moonstream database version.
"""
MOONSTREAMDB_VERSION = "0.0.1"

Wyświetl plik

@ -1,2 +1 @@
export EXPLORATION_DB_URI="<database_uri>"
export MOONSTREAM_DB_URI="<database_uri>"

Wyświetl plik

@ -1,12 +1,14 @@
from setuptools import find_packages, setup
from moonstreamdb.version import MOONSTREAMDB_VERSION
long_description = ""
with open("README.md") as ifp:
long_description = ifp.read()
setup(
name="moonstreamdb",
version="0.0.1",
version=MOONSTREAMDB_VERSION,
author="Bugout.dev",
author_email="engineers@bugout.dev",
license="Apache License 2.0",
@ -28,7 +30,7 @@ setup(
],
python_requires=">=3.6",
packages=find_packages(),
package_data={"bugout": ["py.typed"]},
package_data={"moonstreamdb": ["py.typed"]},
zip_safe=False,
install_requires=["alembic", "psycopg2-binary", "sqlalchemy"],
extras_require={"dev": ["black", "mypy"]},