Skip to content

Commit df9767c

Browse files
authored
πŸ“ Release: 0.15.1 (#233)
2 parents c5dbdd6 + 0ba3988 commit df9767c

10 files changed

Lines changed: 80 additions & 13 deletions

File tree

β€Ž.github/workflows/test.ymlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,6 @@ jobs:
120120
docker compose down
121121
rm docker-compose.yml
122122
wget "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/docker-compose.yml"
123-
docker compose pull
123+
docker compose pull --quiet
124124
docker compose up --detach
125125
docker network connect nginx_default tubee_beta_app

β€Ž.pre-commit-config.yamlβ€Ž

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
ci:
2+
autoupdate_branch: "develop"
3+
autoupdate_commit_msg: "πŸ—„ chore: pre-commit autoupdate"
4+
15
repos:
26
- repo: https://github.com/pre-commit/pre-commit-hooks
37
rev: "v4.4.0"

β€Ž.vscode/extensions.jsonβ€Ž

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"recommendations": [
3+
"bungcip.better-toml",
4+
"ryanluker.vscode-coverage-gutters",
5+
"whatwedo.twig",
6+
"donjayamanne.jquerysnippets",
7+
"cschleiden.vscode-github-actions"
8+
]
9+
}

β€ŽMakefileβ€Ž

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
define USAGE
2+
Tubee, the YouTube subscription dashboard
3+
4+
Commands:
5+
install Install dependencies for local development
6+
build Build docker images
7+
start Start the application for development
8+
test Run coverage unit tests
9+
shell Enter interactive shell for debug
10+
db_migrate Create a new database migration (Run with make db_migrate MESSAGE="message")
11+
db_upgrade Upgrade the database to the latest migration
12+
uninstall Uninstall environment
13+
reinstall Reinstall environment (when Python version is bumped)
14+
15+
endef
16+
17+
export USAGE
18+
19+
help:
20+
@echo "$$USAGE"
21+
22+
install:
23+
pyenv install -s $(shell cat .python-version)
24+
poetry env use $(shell echo $(shell pyenv shell $(shell cat .python-version); pyenv which python))
25+
poetry install
26+
27+
build:
28+
docker compose --file docker-compose.dev.yml build
29+
30+
start:
31+
docker compose --file docker-compose.dev.yml up
32+
33+
test:
34+
poetry run flask test --coverage
35+
36+
shell:
37+
poetry run flask shell
38+
39+
db_migrate:
40+
docker compose --file docker-compose.dev.yml exec tubee flask db migrate -m $(MESSAGE)
41+
42+
db_upgrade:
43+
docker compose --file docker-compose.dev.yml exec tubee flask db upgrade
44+
45+
uninstall:
46+
poetry env remove --all
47+
48+
reinstall: uninstall install build

β€Ždocker-compose.dev.ymlβ€Ž

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ services:
3838
celery:
3939
build: .
4040
command:
41-
- "watchmedo"
42-
- "auto-restart"
43-
- "--directory=./"
44-
- "--pattern=*.py"
45-
- "--recursive"
46-
- "--"
4741
- "celery"
4842
- "--app=celery_worker.celery"
4943
- "worker"

β€Žpyproject.tomlβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name = "tubee"
1111
version = "0.15.0"
1212
description = "A Web Application for Monitoring New YouTube Videos"
1313
license = "MIT License"
14-
authors = ["Tomy Hsieh <tomy0000000@gmail.com>"]
14+
authors = ["Tomy Hsieh <pypi@tomy.me>"]
1515
readme = "README.md"
1616
homepage = "https://github.com/tomy0000000/Tubee"
1717
repository = "https://github.com/tomy0000000/Tubee"

β€Žtubee/models/action.pyβ€Ž

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ class Action(db.Model): # type: ignore
4242
),
4343
{},
4444
)
45-
channel = db.relationship("Channel", back_populates="actions")
46-
subscription = db.relationship("Subscription", back_populates="_actions")
45+
channel = db.relationship(
46+
"Channel", back_populates="actions", overlaps="subscription"
47+
)
48+
subscription = db.relationship(
49+
"Subscription", back_populates="_actions", overlaps="channel"
50+
)
4751
tag = db.relationship("Tag", back_populates="actions")
48-
user = db.relationship("User", back_populates="actions")
52+
user = db.relationship("User", back_populates="actions", overlaps="subscription")
4953

5054
def __init__(self, username: str, params: Union[dict[str, str], None] = None):
5155
from .subscription import Subscription

β€Žtubee/models/channel.pyβ€Ž

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ class Channel(db.Model): # type: ignore
3636
hub_infos = db.Column(db.JSON, nullable=False, default={})
3737
subscribe_timestamp = db.Column(db.DateTime, default=datetime.utcnow)
3838
unsubscribe_timestamp = db.Column(db.DateTime)
39-
actions = db.relationship("Action", back_populates="channel")
39+
actions = db.relationship(
40+
"Action", back_populates="channel", overlaps="subscription"
41+
)
4042
videos = db.relationship(
4143
"Video", back_populates="channel", lazy="dynamic", cascade="all, delete-orphan"
4244
)

β€Žtubee/models/subscription.pyβ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Subscription(db.Model): # type: ignore
3131
back_populates="subscription",
3232
lazy="dynamic",
3333
cascade="all, delete-orphan",
34+
overlaps="actions,channel,user",
3435
)
3536
_subscription_tags = db.relationship(
3637
"SubscriptionTag",

β€Žtubee/models/user.pyβ€Ž

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ class User(UserMixin, db.Model): # type: ignore
6060
tags = db.relationship(
6161
"Tag", back_populates="user", lazy="dynamic", cascade="all, delete-orphan"
6262
)
63-
actions = db.relationship("Action", back_populates="user", lazy="dynamic")
63+
actions = db.relationship(
64+
"Action",
65+
back_populates="user",
66+
lazy="dynamic",
67+
overlaps="_actions,subscription",
68+
)
6469

6570
def __init__(self, username, password, admin=False, **kwargs):
6671
self.username = username

0 commit comments

Comments
Β (0)