Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
39 changes: 39 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python

name: Python application

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install uv
uses: astral-sh/setup-uv@v3
- name: Check lockfile consistency
run: |
uv lock --check
- name: Setup config file
run: |
cp config_template.json config.json
- name: Install dependencies
run: |
uv sync --frozen --extra dev
- name: Test with pytest
run: |
uv run pytest --cov=app
3 changes: 2 additions & 1 deletion .gitignore
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,5 @@ docs/_build/
target/

.DS_Store
newrelic.ini
newrelic.ini
.venv/
7 changes: 3 additions & 4 deletions Dockerfile
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ RUN apt-get update && \

RUN echo "Y" | apt-get install procps

RUN pip install --user pipenv
RUN pip install --upgrade pip
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/

# Create home ubuntu service
RUN mkdir -p /home/ubuntu/apps/$SERVICE_NAME/logs
Expand All @@ -30,8 +29,8 @@ RUN mkdir -p /home/ubuntu/apps/$SERVICE_NAME/logs
WORKDIR /home/ubuntu/apps/$SERVICE_NAME

# Copy and install requirements
COPY Pipfile Pipfile.lock /home/ubuntu/apps/$SERVICE_NAME/
RUN /root/.local/bin/pipenv sync --system
COPY pyproject.toml uv.lock /home/ubuntu/apps/$SERVICE_NAME/
RUN uv sync --frozen --no-dev

# Copy code folder
COPY . .
Expand Down
14 changes: 0 additions & 14 deletions Pipfile

This file was deleted.

1,481 changes: 0 additions & 1,481 deletions Pipfile.lock

This file was deleted.

7 changes: 3 additions & 4 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,9 @@ Based on your use case and expected load for a channel (number of notification r
2. cd notifyone-handler
3. touch config.json
4. Generate actual keys and values for config.json file. Refer to config_template.json for keys.
5. pip isntall pipenv (if not alread installed)
6. python3 -m pipenv shell
7. python3 -m pipenv install
8. python3 -m app.service
5. pip install uv
6. uv sync
7. python3 -m app.service
#### Docker container based deployment
###### Here, we pre-assume that you have got docker installed on you system, and it's up and running
1. git clone https://github.com/tata1mg/notifyone-handler.git
Expand Down
80 changes: 80 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
[project]
name = "notifyone-handler"
version = "0.1.0"
requires-python = ">=3.9"
dependencies = [
"httpx[http2]==0.23.3",
"aiokafka==0.10.0",
"torpedo",
"commonutils",
]

[project.optional-dependencies]
dev = []

[tool.uv.sources]
torpedo = { git = "https://github.com/tata1mg/torpedo.git", tag = "1.0.0" }
commonutils = { git = "https://github.com/tata1mg/commonutils.git", tag = "1.0.0" }

[tool.uv]
constraint-dependencies = [
# Pinned to match original Pipfile.lock transitive resolutions
"aiobotocore==2.6.0",
"aiofiles==23.2.1",
"aioitertools==0.11.0",
"aiosqlite==0.17.0",
"anyio==4.0.0",
"asyncpg==0.28.0",
"attrs==23.1.0",
"botocore==1.31.17",
"certifi==2023.7.22",
"cffi==1.16.0",
"cloudinary==1.36.0",
"coverage==7.3.2",
"cryptography==41.0.4",
"dill==0.3.7",
"ecdsa==0.18.0",
"ecs-logging==2.1.0",
"elastic-apm==6.18.0",
"exceptiongroup==1.1.3",
"formencode==2.0.1",
"gitdb==4.0.10",
"gitpython==3.1.37",
"h2==4.1.0",
"hpack==4.0.0",
"httptools==0.6.0",
"hyperframe==6.0.1",
"idna==3.4",
"iniconfig==2.0.0",
"iso8601==1.1.0",
"isort==5.12.0",
"jmespath==1.0.1",
"lazy-object-proxy==1.9.0",
"mmh3==4.0.1",
"packaging==23.2",
"platformdirs==3.11.0",
"pluggy==1.3.0",
"psutil==5.9.5",
"pyasn1==0.5.0",
"pycparser==2.21",
"pydantic==1.10.13",
"pypika-tortoise==0.1.6",
"python-dateutil==2.8.2",
"python-jose==3.3.0",
"pytz==2023.3.post1",
"pyyaml==6.0.1",
"rsa==4.9",
"sentry-sdk==1.31.0",
"six==1.16.0",
"smmap==5.0.1",
"sniffio==1.3.0",
"tomli==2.0.1",
"tomlkit==0.12.1",
"tortoise-orm==0.20.0",
"typing-extensions==4.8.0",
"ujson==5.8.0",
"urllib3==1.26.17",
"uvloop==0.17.0",
"wrapt==1.15.0",
"yarl==1.9.2",
]
Loading
Loading