Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ updates:
directory: "/"
schedule:
interval: "daily"
- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "daily"
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/app-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,19 +51,18 @@ jobs:
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
uv sync --locked --all-extras --dev
playwright install

- name: Ruff
run: |
ruff check src
uv run ruff check src

- name: Set environment variables from secrets
run: |
Expand All @@ -77,13 +76,13 @@ jobs:

- name: Run Tests
run: |
coverage run src/manage.py test app users integrations lists events --parallel
uv run coverage run src/manage.py test app users integrations lists events --parallel

- name: Build Coverage Report
run: |
coverage combine
coverage report
coverage xml
uv run coverage combine
uv run coverage report
uv run coverage xml

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
Expand Down
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12-alpine3.21
FROM ghcr.io/astral-sh/uv:python3.12-alpine

# https://stackoverflow.com/questions/58701233/docker-logs-erroneously-appears-empty-until-container-stops
ENV PYTHONUNBUFFERED=1
Expand All @@ -7,8 +7,11 @@ ENV PYTHONUNBUFFERED=1
ARG VERSION=dev
# Set it as an environment variable
ENV VERSION=$VERSION
# Disable development dependencies
ENV UV_NO_DEV=1

COPY ./requirements.txt /requirements.txt
COPY ./pyproject.toml /pyproject.toml
COPY ./uv.lock /uv.lock
COPY ./entrypoint.sh /entrypoint.sh
COPY ./supervisord.conf /etc/supervisord.conf
COPY ./nginx.conf /etc/nginx/nginx.conf
Expand All @@ -18,8 +21,7 @@ RUN sed 's/listen 8000;/listen 8000; listen [::]:8000;/' /etc/nginx/nginx.conf >
WORKDIR /yamtrack

RUN apk add --no-cache nginx shadow \
&& pip install --no-cache-dir -r /requirements.txt \
&& pip install --no-cache-dir supervisor==4.3.0 \
&& uv sync --locked \
&& rm -rf /root/.cache /tmp/* \
&& find /usr/local -type d -name __pycache__ -exec rm -rf {} + \
&& chmod +x /entrypoint.sh \
Expand All @@ -31,11 +33,11 @@ RUN apk add --no-cache nginx shadow \

# Django app
COPY src ./
RUN python manage.py collectstatic --noinput
RUN uv run manage.py collectstatic --noinput

EXPOSE 8000

CMD ["/entrypoint.sh"]

HEALTHCHECK --interval=45s --timeout=15s --start-period=30s --retries=5 \
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8000/health/ || exit 1
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:8000/health/ || exit 1
21 changes: 15 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,17 +114,26 @@ SECRET=SECRET
DEBUG=True
```

Then run the following commands.
Install [uv](https://docs.astral.sh/uv/getting-started/installation/) to manage the Python environment and dependencies.

Install [tailwindcss CLI](https://tailwindcss.com/docs/installation/tailwind-cli) with `npm install -g tailwindcss @tailwindcss/cli`.

Then run the following commands to setup the environment.

```bash
uv sync --all-extras
uv run pre-commit install
```

To run the development server with hot reload for both Django and Tailwind CSS, run:

```bash
python -m pip install -U -r requirements-dev.txt
pre-commit install
cd src
python manage.py migrate
python manage.py runserver & celery -A config worker --beat --scheduler django --loglevel DEBUG & tailwindcss -i ./static/css/input.css -o ./static/css/tailwind.css --watch
uv run manage.py migrate
uv run manage.py runserver & uv run celery -A config worker --beat --scheduler django --loglevel DEBUG & tailwindcss -i ./static/css/input.css -o ./static/css/tailwind.css --watch
```

Go to: http://localhost:8000
Go to: <http://localhost:8000>

## 💪 Support the Project

Expand Down
89 changes: 88 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,58 @@
[project]
name = "yamtrack"
version = "0.25.0"
description = "A self hosted media tracker."
readme = "README.md"
requires-python = "==3.12.*"
Comment thread
minerop5000 marked this conversation as resolved.
Outdated
dependencies = [
Comment thread
minerop5000 marked this conversation as resolved.
"aiohttp==3.13.3",
"apprise==1.9.7",
"beautifulsoup4==4.14.3",
"celery==5.6.2",
"croniter==6.0.0",
"defusedxml==0.7.1",
"django==5.2.11",
"django-allauth[socialaccount]==65.14.0",
"django-celery-beat==2.8.1",
"django-celery-results==2.6.0",
"django-debug-toolbar==6.2.0",
"django-decorator-include==3.3",
"django-health-check==3.23.3",
"django-model-utils==5.0.0",
"django-redis==6.0.0",
"django-select2==8.4.8",
"django-simple-history==3.11.0",
"django-widget-tweaks==1.5.1",
"gunicorn==25.0.1",
"icalendar==6.3.2",
"pillow==12.1.0",
"psycopg[binary,pool]==3.3.2",
"python-decouple==3.8",
"redis[hiredis]==7.1.0",
"requests==2.32.5",
"requests-ratelimiter==0.8.0",
"supervisor==4.3.0",
"unidecode==1.4.0",
]

[tool.ruff]
target-version = "py312"
extend-exclude = ["migrations"]
force-exclude = true

[tool.ruff.lint]
select = ["ALL"]
ignore = ["ANN", "PT", "PD", "D100", "D104", "RUF012", "PLR0913", "SLF001", "COM812"]
ignore = [
Comment thread
minerop5000 marked this conversation as resolved.
"ANN",
"PT",
"PD",
"D100",
"D104",
"RUF012",
"PLR0913",
"SLF001",
"COM812",
]

[tool.ruff.lint.pycodestyle]
max-doc-length = 88
Expand All @@ -22,3 +69,43 @@ indent = 2
[tool.coverage.run]
concurrency = ["multiprocessing"]
omit = ["*/migrations/*", "*/tests/*", "*/__init__.py", "*/admin.py"]

[dependency-groups]
dev = [
Comment thread
minerop5000 marked this conversation as resolved.
"aiohttp==3.13.3",
"apprise==1.9.7",
"beautifulsoup4==4.14.3",
"celery==5.6.2",
"coverage==7.13.3",
"croniter==6.0.0",
"defusedxml==0.7.1",
"django==5.2.11",
"django-allauth[socialaccount]==65.14.0",
"django-celery-beat==2.8.1",
"django-celery-results==2.6.0",
"django-debug-toolbar==6.2.0",
"django-decorator-include==3.3",
"django-health-check==3.23.3",
"django-model-utils==5.0.0",
"django-redis==6.0.0",
"django-select2==8.4.8",
"django-simple-history==3.11.0",
"django-upgrade==1.30.0",
"django-widget-tweaks==1.5.1",
"djlint==1.36.4",
"fakeredis==2.33.0",
"gunicorn==25.0.1",
"icalendar==6.3.2",
"pillow==12.1.0",
"pre-commit==4.5.1",
"psycopg[binary,pool]==3.3.2",
"pytest-django==4.11.1",
"pytest-playwright==0.7.2",
"python-decouple==3.8",
"redis[hiredis]==7.1.0",
"requests==2.32.5",
"requests-ratelimiter==0.8.0",
"ruff==0.15.0",
"tblib==3.2.2",
"unidecode==1.4.0",
]
11 changes: 0 additions & 11 deletions requirements-dev.txt

This file was deleted.

27 changes: 0 additions & 27 deletions requirements.txt

This file was deleted.

Loading