Skip to content

Commit

Permalink
Merge pull request #97 from TogetherCrew/feat/make-analyzer-library
Browse files Browse the repository at this point in the history
Feat: make analyzer library
  • Loading branch information
cyri113 authored Jul 4, 2024
2 parents 5842533 + 652fc02 commit 5c3c870
Show file tree
Hide file tree
Showing 210 changed files with 1,348 additions and 1,273 deletions.
27 changes: 26 additions & 1 deletion .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,29 @@ jobs:
ci:
uses: TogetherCrew/operations/.github/workflows/ci.yml@main
secrets:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
package_publish:
needs: ci
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python -m twine upload dist/*
34 changes: 0 additions & 34 deletions analyzer_init.py

This file was deleted.

117 changes: 0 additions & 117 deletions discord_utils.py

This file was deleted.

3 changes: 3 additions & 0 deletions docker-compose.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ services:
condition: service_healthy
mongo:
image: "mongo:6.0.8"
restart: always
attach: false
environment:
- MONGO_INITDB_ROOT_USERNAME=root
Expand All @@ -54,6 +55,7 @@ services:
start_period: 40s
neo4j:
image: "neo4j:5.9.0"
restart: always
attach: false
environment:
- NEO4J_AUTH=neo4j/password
Expand All @@ -67,6 +69,7 @@ services:
start_period: 40s
rabbitmq:
image: "rabbitmq:3-management-alpine"
restart: always
environment:
- RABBITMQ_DEFAULT_USER=root
- RABBITMQ_DEFAULT_PASS=pass
Expand Down
6 changes: 1 addition & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,23 @@ attrs==22.2.0
dnspython==2.2.1
exceptiongroup==1.1.0
iniconfig==2.0.0
numpy==1.24.1
packaging==23.0
pluggy==1.0.0
pymongo==4.3.3
pytest==7.2.0
python-dateutil==2.8.2
pytz==2022.7.1
python-dotenv>=1.0.0
six==1.16.0
tomli==2.0.1
networkx==3.1
requests==2.29.0
pytest-cov==4.0.0
coverage==7.2.5
python-dateutil==2.8.2
tqdm
tc-messageBroker==1.6.7
sentry-sdk
rq
redis
tc-core-analyzer-lib==1.3.1
tc-neo4j-lib==2.0.0
tc-neo4j-lib==2.0.1
pybars3
backoff==2.2.1
74 changes: 0 additions & 74 deletions server.py

This file was deleted.

17 changes: 17 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from setuptools import find_packages, setup

with open("requirements.txt") as f:
requirements = f.read().splitlines()


setup(
name="tc-analyzer-lib",
version="1.0.0",
author="Mohammad Amin Dadgar, TogetherCrew",
maintainer="Mohammad Amin Dadgar",
maintainer_email="[email protected]",
packages=find_packages(),
description="A platform agnostic analyzer, computing the TogetherCrew dashboard metrics.",
long_description=open("README.md").read(),
install_requires=requirements,
)
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import logging

from discord_analyzer.DB_operations.mongodb_interaction import MongoDBOps
from discord_analyzer.DB_operations.network_graph import NetworkGraph
from tc_analyzer_lib.DB_operations.mongodb_interaction import MongoDBOps
from tc_analyzer_lib.DB_operations.network_graph import NetworkGraph
from tc_analyzer_lib.schemas import GraphSchema
from tc_neo4j_lib.neo4j_ops import Neo4jOps, Query
from discord_analyzer.schemas import GraphSchema


class MongoNeo4jDB:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from utils.mongo import MongoSingleton
from tc_analyzer_lib.utils.mongo import MongoSingleton


class DB_access:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import logging

from discord_analyzer.DB_operations.mongodb_access import DB_access
from pymongo.read_concern import ReadConcern
from pymongo.write_concern import WriteConcern
from tc_analyzer_lib.DB_operations.mongodb_access import DB_access


class MongoDBOps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import datetime

import networkx
from tc_analyzer_lib.schemas import GraphSchema
from tc_neo4j_lib import Query
from discord_analyzer.schemas import GraphSchema


class NetworkGraph:
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import copy
from typing import Any
from datetime import datetime
from typing import Any

from numpy import diag_indices_from, ndarray
from tc_analyzer_lib.utils.mongo import MongoSingleton

from utils.mongo import MongoSingleton
from .utils.compute_interaction_mtx_utils import (
generate_interaction_matrix,
prepare_per_account,
Expand Down
Loading

0 comments on commit 5c3c870

Please sign in to comment.