Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: make analyzer library #97

Merged
merged 23 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
de304a3
feat: wrapping analyzer in one unit!
amindadgar Jul 1, 2024
a98e658
fix: removed unused files!
amindadgar Jul 1, 2024
58b4416
fix: removing unused functions!
amindadgar Jul 1, 2024
9717d8b
fix: remove wrong imports!
amindadgar Jul 1, 2024
d40441b
feat: update publish on success to handle different cases!
amindadgar Jul 2, 2024
43cf727
feat: getting the owner discord id for finish job discord message!
amindadgar Jul 2, 2024
aaec027
feat: update package locations!
amindadgar Jul 2, 2024
5cb3fa7
feat: Added restart option!
amindadgar Jul 2, 2024
917ffbc
feat: moved utility package to discord_analyzer!
amindadgar Jul 2, 2024
007acca
feat: trying to run the publish_on_success test case first!
amindadgar Jul 2, 2024
f41a752
fix: disabling test cases for testing purposes!
amindadgar Jul 2, 2024
523518a
fix: rabbitMQ stay alive was 60s, singleton class is not required!
amindadgar Jul 2, 2024
95726ba
feat: updating rabbitmq as it is no longer singleton!
amindadgar Jul 2, 2024
af72605
feat: adding library publishing workflow!
amindadgar Jul 2, 2024
2c367cb
feat: moved automation into discord_analyzer package!
amindadgar Jul 2, 2024
a5713de
feat: update discord_analyzer package name to tc_analyzer_lib!
amindadgar Jul 2, 2024
83a1670
fix: black linter issues!
amindadgar Jul 2, 2024
6c1fa07
fix: lint issues!
amindadgar Jul 2, 2024
f2430a5
fix: the test case is for mock graph genertion part!
amindadgar Jul 2, 2024
4dfb41e
fix: isort linter issue!
amindadgar Jul 2, 2024
549f834
fix: trying to skip black linter!
amindadgar Jul 2, 2024
ad088ee
fix: deleting the case was for mock graph generation!
amindadgar Jul 3, 2024
652fc02
Update requirements.txt
amindadgar Jul 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
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
Loading