Skip to content

Commit

Permalink
Update development dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
treiher committed Dec 20, 2023
1 parent cf14ed5 commit cf58006
Show file tree
Hide file tree
Showing 8 changed files with 165 additions and 182 deletions.
7 changes: 4 additions & 3 deletions fabfile.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import subprocess
import sys
from pathlib import Path
from typing import Optional

from fabric import Connection, task # type: ignore[import]
from setuptools_scm import get_version # type: ignore[import]
from fabric import Connection, task # type: ignore[import-untyped]


@task
Expand All @@ -17,8 +17,9 @@ def deploy(
directory = str(Path(package).parent)
filename = Path(package).name
else:
version = subprocess.check_output(["poetry", "version", "-s"]).decode("utf-8").strip()
directory = "dist"
filename = f"valens-{get_version()}-py3-none-any.whl"
filename = f"valens-{version}-py3-none-any.whl"

if not target_directory:
target_directory = "/srv/http/valens"
Expand Down
295 changes: 141 additions & 154 deletions poetry.lock

Large diffs are not rendered by default.

16 changes: 7 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@ flask = ">=2.0.2, <3"
sqlalchemy = ">=2, <3"

[tool.poetry.group.dev.dependencies]
black = "==23.1.0"
build = ">=0.7.0"
fabric = ">=3, <4"
mypy = "==1.0.0"
py = "==1.11.0" # https://github.com/pytest-dev/pytest-selenium/issues/313
black = ">=23.1"
build = ">=0.7"
fabric = ">=3"
mypy = ">=1"
pytest = ">=5"
pytest-alembic = ">=0.3.1"
pytest-cov = ">=2.10.0"
pytest-selenium = ">=3"
pytest-cov = ">=2.10"
pytest-selenium = ">=4.0.2"
pytest-xdist = ">=1.32.0"
ruff = "==0.0.260"
selenium = ">=3, <4.10"
ruff = ">=0.0.260"
sqlalchemy = {extras = ["mypy"], version = ">=2, <3"}
types-selenium = ">=3"

Expand Down
1 change: 0 additions & 1 deletion tests/backend/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def test_json_required(client: Client, method: str, route: str) -> None:
("post", "/api/exercises", {"invalid": "data"}),
("put", "/api/exercises/1", {"invalid": "data"}),
("post", "/api/routines", {"invalid": "data"}),
("post", "/api/routines", {"invalid": "data"}),
("put", "/api/routines/1", {"invalid": "data"}),
("patch", "/api/routines/1", {"sections": [{"invalid": "data"}]}),
("post", "/api/workouts", {"invalid": "data"}),
Expand Down
12 changes: 5 additions & 7 deletions tests/e2e/web_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ def fixture_driver_args() -> list[str]:
return ["--log-level=ALL"]


@pytest.fixture(name="session_capabilities", scope="session")
def fixture_session_capabilities(
session_capabilities: webdriver.DesiredCapabilities.CHROME,
) -> Generator[webdriver.DesiredCapabilities.CHROME, None, None]:
session_capabilities["loggingPrefs"] = {"browser": "ALL"}
return session_capabilities
@pytest.fixture(name="chrome_options")
def fixture_chrome_options(chrome_options: webdriver.ChromeOptions) -> webdriver.ChromeOptions:
chrome_options.set_capability("goog:loggingPrefs", {"performance": "ALL"})
return chrome_options


def login(driver: webdriver.Chrome) -> None:
Expand Down Expand Up @@ -437,7 +435,7 @@ def test_training_delete(driver: webdriver.Chrome) -> None:
workout = USER.workouts[-1]
date_1 = str(workout.date)
routine = (
[r.name for r in USER.routines if r.id == workout.routine_id][0]
next(r.name for r in USER.routines if r.id == workout.routine_id)
if workout.routine_id
else "-"
)
Expand Down
2 changes: 1 addition & 1 deletion valens/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def main() -> int:
"-d",
dest="directory",
type=Path,
default=Path("."),
default=Path(),
help="target directory for the to be created config file",
)

Expand Down
2 changes: 1 addition & 1 deletion valens/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def _upgrade(connection: Connection) -> None:

@event.listens_for(Engine, "connect")
def _set_sqlite_pragma(
dbapi_connection: sqlite3.Connection, _: pool.base._ConnectionRecord # noqa: SLF001
dbapi_connection: sqlite3.Connection, _: pool.base._ConnectionRecord
) -> None:
if current_app.config["SQLITE_FOREIGN_KEY_SUPPORT"]:
cursor = dbapi_connection.cursor()
Expand Down
12 changes: 6 additions & 6 deletions valens/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ class RoutinePart(Base):
foreign_keys=[routine_section_id],
)

__mapper_args__ = {
__mapper_args__ = { # noqa: RUF012
"polymorphic_identity": "routine_part",
"polymorphic_on": type,
}
Expand All @@ -230,7 +230,7 @@ class RoutineSection(RoutinePart):
)
routine: Mapped[Routine] = relationship("Routine", back_populates="sections")

__mapper_args__ = {
__mapper_args__ = { # noqa: RUF012
"polymorphic_identity": "routine_section",
"polymorphic_load": "selectin",
"inherit_condition": id == RoutinePart.id,
Expand Down Expand Up @@ -263,7 +263,7 @@ class RoutineActivity(RoutinePart):

exercise: Mapped[Exercise] = relationship("Exercise", back_populates="routine_activities")

__mapper_args__ = {
__mapper_args__ = { # noqa: RUF012
"polymorphic_identity": "routine_activity",
"polymorphic_load": "selectin",
"inherit_condition": id == RoutinePart.id,
Expand Down Expand Up @@ -311,7 +311,7 @@ class WorkoutElement(Base):

workout: Mapped[Workout] = relationship("Workout", back_populates="elements")

__mapper_args__ = {
__mapper_args__ = { # noqa: RUF012
"polymorphic_identity": "activity",
"polymorphic_on": "type",
}
Expand Down Expand Up @@ -390,7 +390,7 @@ class WorkoutSet(WorkoutElement):

exercise: Mapped[Exercise] = relationship("Exercise", back_populates="sets")

__mapper_args__ = {
__mapper_args__ = { # noqa: RUF012
"polymorphic_identity": "set",
"polymorphic_load": "selectin",
}
Expand Down Expand Up @@ -420,7 +420,7 @@ class WorkoutRest(WorkoutElement):
position: Mapped[int] = mapped_column(primary_key=True)
target_time: Mapped[Optional[int]]

__mapper_args__ = {
__mapper_args__ = { # noqa: RUF012
"polymorphic_identity": "rest",
"polymorphic_load": "selectin",
}

0 comments on commit cf58006

Please sign in to comment.