Skip to content

Commit

Permalink
Merge pull request #24 from SumoLogic/mongo_enhancements
Browse files Browse the repository at this point in the history
Mongo enhancements
  • Loading branch information
himanshu219 authored Oct 21, 2024
2 parents 7a74be9 + 7fdd419 commit 60b82a8
Show file tree
Hide file tree
Showing 15 changed files with 2,636 additions and 393 deletions.
10 changes: 10 additions & 0 deletions .bandit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
skips: [B101,B105,B108,B113,B311,B314,B405,B404,B501,B506,B602,B604,B605,B607,B608]

assert_used:
skips: ['*_test.py', '*test_*.py']

B311:
skips: ['*_test.py', '*test_*.py', '*mock*.py', '*mock_*.py']

B105:
skips: ['*_test.py', '*test_*.py']
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
exclude =
"sumomongodbatlascollector/test_mock.py"
57 changes: 57 additions & 0 deletions .github/workflows/runtest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: "Run Static tests"
on: [workflow_dispatch, pull_request]

jobs:
lint-test:
name: "Run Security & Linting Tests"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install dev dependencies
run: python -m pip install -U pip flake8 bandit mypy

- name: Run Security Tests
run: |
bandit -c .bandit -r sumomongodbatlascollector/ -f custom
- name: Run Linting Tests
run: |
flake8 --max-line-length=120 --ignore=E231,E225,F541,E501,E402,F841,W605,E731,E722,C901,F821 sumomongodbatlascollector/
# - name: Static Type Checks
# continue-on-error: true
# run: |
# cd sumomongodbatlascollector/
# mypy --install-types ./main.py
# mypy ./main.py --disable-error-code=import-untyped
# mypy --install-types ./api.py
# mypy ./api.py --disable-error-code=import-untyped

run-test:
name: "Run Build and Install Tests"
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'

- name: Install build and test dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest
- name: "Run Pytest"
run: |
pytest -vvv sumomongodbatlascollector/test_mongo_collector.py
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
sumologic-appclient-sdk==1.0.17
sumologic-appclient-sdk==2.0.10
requests>=2.32.3
future-fstrings
43 changes: 24 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,57 @@

here = abspath(dirname(__file__))

with open(join(here, 'VERSION')) as VERSION_FILE:
with open(join(here, "VERSION")) as VERSION_FILE:
__versionstr__ = VERSION_FILE.read().strip()


with open(join(here, 'requirements.txt')) as REQUIREMENTS:
INSTALL_REQUIRES = REQUIREMENTS.read().split('\n')
with open(join(here, "requirements.txt")) as REQUIREMENTS:
INSTALL_REQUIRES = REQUIREMENTS.read().split("\n")


with io.open(join(here, 'README.md'), encoding='utf-8') as f:
with io.open(join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()


CONSOLE_SCRIPTS = [
'sumomongodbatlascollector=sumomongodbatlascollector.main:main'
]
CONSOLE_SCRIPTS = ["sumomongodbatlascollector=sumomongodbatlascollector.main:main"]

setup(
name="sumologic-mongodb-atlas",
version=__versionstr__,
packages=find_packages(),
install_requires=INSTALL_REQUIRES,
extras_require={
'aws': ["boto3>=1.9.66", "botocore>=1.12.66"],
"gcp": ["google-api-python-client>=1.7.8", "oauth2client>=4.1.3", "google-cloud-datastore>=1.7.3"],
"azure": ["azure-cosmosdb-table>=1.0.5", "bson>=0.5.8"]
"aws": ["boto3>=1.34.149", "botocore>=1.34.149"],
"gcp": [
"google-api-python-client>=2.129.0",
"oauth2client>=4.1.3",
"google-cloud-datastore>=2.19.0",
],
"azure": ["azure-cosmosdb-table>=1.0.6", "bson>=0.5.10"],
},
# PyPI metadata
author="SumoLogic",
author_email="[email protected]",
description="Sumo Logic collection solution for mongodb atlas",
license="PSF",
long_description=long_description,
long_description_content_type='text/markdown',
long_description_content_type="text/markdown",
keywords="sumologic python rest api log management analytics logreduce mongodb atlas agent security siem collector forwarder",
url="https://github.com/SumoLogic/sumologic-mongodb-atlas",
zip_safe=True,
include_package_data=True,
classifiers=[
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.7',
'Operating System :: OS Independent'
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: OS Independent",
],
entry_points={
'console_scripts': CONSOLE_SCRIPTS,
}

"console_scripts": CONSOLE_SCRIPTS,
},
)
Loading

0 comments on commit 60b82a8

Please sign in to comment.