From a16d05931dbdad7245e45674906c4a16d3e7b8af Mon Sep 17 00:00:00 2001 From: Chris Moultrie <821688+tebriel@users.noreply.github.com> Date: Mon, 2 Mar 2026 10:38:47 -0500 Subject: [PATCH] fittrackee: 0.11.2 -> 1.3.3 --- doc/release-notes/rl-2611.section.md | 3 +- pkgs/by-name/fi/fittrackee/package.nix | 77 +++++++++++++++----------- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/doc/release-notes/rl-2611.section.md b/doc/release-notes/rl-2611.section.md index 2d03b3d265fd..092c950e980f 100644 --- a/doc/release-notes/rl-2611.section.md +++ b/doc/release-notes/rl-2611.section.md @@ -80,8 +80,7 @@ ### Breaking changes {#sec-nixpkgs-release-26.11-lib-breaking} -- Create the first release note entry in this section! - +- `fittrackee` 1.0.0 now requires postgres with postgis. The [upgrade guide](https://docs.fittrackee.org/en/upgrading-to-1.0.0.html) has steps to prepare for this upgrade. ### Deprecations {#sec-nixpkgs-release-26.11-lib-deprecations} diff --git a/pkgs/by-name/fi/fittrackee/package.nix b/pkgs/by-name/fi/fittrackee/package.nix index f261ac07eae6..ed8611772707 100644 --- a/pkgs/by-name/fi/fittrackee/package.nix +++ b/pkgs/by-name/fi/fittrackee/package.nix @@ -1,49 +1,51 @@ { - fetchFromGitHub, + fetchFromCodeberg, + fetchNpmDeps, lib, stdenv, + nodejs_24, + npmHooks, postgresql, postgresqlTestHook, python3Packages, }: python3Packages.buildPythonApplication (finalAttrs: { pname = "fittrackee"; - version = "0.11.2"; + version = "1.3.3"; pyproject = true; - src = fetchFromGitHub { - owner = "SamR1"; + src = fetchFromCodeberg { + owner = "FitTrackee"; repo = "FitTrackee"; tag = "v${finalAttrs.version}"; - hash = "sha256-A9gebHxNCpYUUIm7IjyySojIIyuTxfYCUeUufpUM1iA="; + hash = "sha256-XWR9gg52pfg0lHoFikQ2wVhvkPCTjTTndBYqBzYPB8s="; }; + makeCacheWritable = true; + npmRoot = "fittrackee_client"; + + npmDeps = fetchNpmDeps { + inherit (finalAttrs) pname version src; + hash = "sha256-HEgof2ln+mBxM63Dv8Lc/bfx3ozoJCRYYyJOz6jh+Vs="; + sourceRoot = "${finalAttrs.src.name}/fittrackee_client"; + }; + + nativeBuildInputs = [ + nodejs_24 + npmHooks.npmConfigHook + ]; + + preBuild = '' + pushd fittrackee_client + npm run build-only + popd + ''; + build-system = [ python3Packages.poetry-core ]; - # The upstream project changed the behavior of the CLI when --set-admin and --set-role are used together. - # Previously, it would raise an error, but now it issues a deprecation warning. - # This patch updates the test assertion to expect the new deprecation warning message. - # See upstream commit 6eda1b6119b3e41bdf8896e74b4a07d3c9e97609. - postPatch = '' - substituteInPlace fittrackee/tests/users/test_users_commands.py \ - --replace '"--set-admin and --set-role can not be used together."' '"WARNING: --set-admin is deprecated. Please use --set-role option instead."' - ''; - - pythonRelaxDeps = [ - "authlib" - "fitdecode" - "flask" - "flask-limiter" - "flask-migrate" - "nh3" - "lxml" - "pyopenssl" - "pytz" - "sqlalchemy" - "xmltodict" - ]; + pythonRelaxDeps = true; dependencies = with python3Packages; @@ -53,21 +55,31 @@ python3Packages.buildPythonApplication (finalAttrs: { click dramatiq dramatiq-abort + feedgenerator fitdecode flask + flask-babel flask-bcrypt flask-dramatiq flask-limiter flask-migrate flask-sqlalchemy + geoalchemy2 + geopandas gpxpy gunicorn humanize jsonschema + lxml + mistune nh3 + numpy + pandas psycopg2-binary pyjwt pyopenssl + pyproj + python-magic pytz shortuuid sqlalchemy @@ -76,7 +88,9 @@ python3Packages.buildPythonApplication (finalAttrs: { xmltodict ] ++ dramatiq.optional-dependencies.redis - ++ flask-limiter.optional-dependencies.redis; + ++ flask-limiter.optional-dependencies.redis + ++ geoalchemy2.optional-dependencies.shapely + ++ staticmap3.optional-dependencies.filecache; pythonImportsCheck = [ "fittrackee" ]; @@ -84,7 +98,7 @@ python3Packages.buildPythonApplication (finalAttrs: { pytestCheckHook freezegun postgresqlTestHook - postgresql + (postgresql.withPackages (ps: with ps; [ postgis ])) time-machine ]; @@ -93,6 +107,7 @@ python3Packages.buildPythonApplication (finalAttrs: { ]; postgresqlTestSetupPost = '' + echo "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" | PGUSER=postgres psql test_db export DATABASE_TEST_URL=postgresql://$PGUSER/$PGDATABASE?host=$PGHOST ''; @@ -105,8 +120,8 @@ python3Packages.buildPythonApplication (finalAttrs: { meta = { description = "Self-hosted outdoor activity tracker"; - homepage = "https://github.com/SamR1/FitTrackee"; - changelog = "https://github.com/SamR1/FitTrackee/blob/${finalAttrs.src.tag}/CHANGELOG.md"; + homepage = "https://docs.fittrackee.org/"; + changelog = "https://codeberg.org/FitTrackee/FitTrackee/src/tag/${finalAttrs.src.tag}/CHANGELOG.md"; license = lib.licenses.agpl3Only; maintainers = with lib.maintainers; [ tebriel