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
53 changes: 53 additions & 0 deletions pkgs/development/python-modules/django-cache-memoize/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
django,
pytestCheckHook,
pytest-cov-stub,
pytest-django,
nix-update-script,
}:

buildPythonPackage rec {
pname = "django-cache-memoize";
version = "0.2.1";
pyproject = true;

src = fetchFromGitHub {
owner = "peterbe";
repo = "django-cache-memoize";
# No tags. See <https://github.com/peterbe/django-cache-memoize/issues/60>.
rev = "9a0dc28315b9bd2848973d38b6f63a400a0e0526";
hash = "sha256-oORTN53s9GVHiY9tbx5FKb7ygkYUKWgPRJusdB0RfcA=";
};

build-system = [
setuptools
];

dependencies = [
django
];

nativeCheckInputs = [
pytestCheckHook
pytest-cov-stub
pytest-django
];

pythonImportsCheck = [ "cache_memoize" ];

passthru.updateScript = nix-update-script {
extraArgs = [ "--version=branch" ];
};

meta = {
description = "Django utility for a memoization decorator that uses the Django cache framework";
homepage = "https://github.com/peterbe/django-cache-memoize";
changelog = "https://github.com/peterbe/django-cache-memoize/blob/${src.rev}/CHANGELOG.rst";
license = lib.licenses.mpl20;
teams = [ lib.teams.ngi ];
};
}
41 changes: 41 additions & 0 deletions pkgs/development/python-modules/lb-matching-tools/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
regex,
pytestCheckHook,
}:

buildPythonPackage rec {
pname = "lb-matching-tools";
version = "2024.01.30.1";
pyproject = true;

src = fetchFromGitHub {
owner = "metabrainz";
repo = "listenbrainz-matching-tools";
tag = "v${version}";
hash = "sha256-RQ4X6DKigQsNxaAWXB1meATKP+ddMUgkoAIyX8iIisU=";
};

build-system = [
setuptools
setuptools-scm
];

dependencies = [ regex ];

nativeCheckInputs = [ pytestCheckHook ];

pythonImportsCheck = [ "lb_matching_tools" ];

meta = {
description = "ListenBrainz tools for matching metadata to and from MusicBrainz";
homepage = "https://github.com/metabrainz/listenbrainz-matching-tools";
changelog = "https://github.com/metabrainz/listenbrainz-matching-tools/releases/tag/${src.tag}";
license = lib.licenses.gpl2Plus;
teams = [ lib.teams.ngi ];
};
}
45 changes: 45 additions & 0 deletions pkgs/development/python-modules/liblistenbrainz/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
requests,
pytestCheckHook,
requests-mock,
}:

buildPythonPackage rec {
pname = "liblistenbrainz";
version = "0.6.0";
pyproject = true;

src = fetchFromGitHub {
owner = "metabrainz";
repo = "liblistenbrainz";
tag = "v${version}";
hash = "sha256-mUw+x9SEHrPocZRdtazqInMGLBDv1KUR5/mmfF3CbVg=";
};

build-system = [
setuptools
setuptools-scm
];

dependencies = [ requests ];

nativeCheckInputs = [
pytestCheckHook
requests-mock
];

pythonImportsCheck = [ "liblistenbrainz" ];

meta = {
description = "Simple ListenBrainz client library for Python";
homepage = "https://github.com/metabrainz/liblistenbrainz";
changelog = "https://github.com/metabrainz/liblistenbrainz/releases/tag/${src.tag}";
license = lib.licenses.gpl3Plus;
teams = [ lib.teams.ngi ];
};
}
34 changes: 34 additions & 0 deletions pkgs/development/python-modules/pluralizer/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
hatchling,
pytestCheckHook,
}:

buildPythonPackage rec {
pname = "pluralizer";
version = "2.0.0";
pyproject = true;

src = fetchFromGitHub {
owner = "weixu365";
repo = "pluralizer-py";
tag = "v${version}";
hash = "sha256-2m7E4cwAdmny/5R5FqaCzk8mu9so/ZCgNPBckTdIc/0=";
};

build-system = [ hatchling ];

nativeCheckInputs = [ pytestCheckHook ];

pythonImportsCheck = [ "pluralizer" ];

meta = {
description = "Singularize or pluralize a given word using a pre-defined list of rules";
homepage = "https://github.com/weixu365/pluralizer-py";
changelog = "https://github.com/weixu365/pluralizer-py/releases/tag/${src.tag}";
license = lib.licenses.mit;
teams = [ lib.teams.ngi ];
};
}
38 changes: 30 additions & 8 deletions pkgs/development/python-modules/python-ffmpeg/default.nix
Original file line number Diff line number Diff line change
@@ -1,24 +1,46 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
ffmpeg-headless,
setuptools,
pyee,
fetchPypi,
setuptools-scm,
pytestCheckHook,
pytest-asyncio,
}:

buildPythonPackage rec {
pname = "python_ffmpeg";
pname = "python-ffmpeg";
version = "2.0.12";
pyproject = true;

src = fetchPypi {
inherit pname version;
sha256 = "GayAr1oGSi9TwkWvGpCbLXZI6gRVANltO81Qe4jUPcc=";
src = fetchFromGitHub {
owner = "jonghwanhyeon";
repo = "python-ffmpeg";
tag = "v${version}";
hash = "sha256-1dhkjrg7QUtYSyEV9c88HphdcFuSCSaGJqVAQmMF/5E=";
};

propagatedBuildInputs = [ pyee ];
postPatch = ''
substituteInPlace ffmpeg/{ffmpeg.py,asyncio/ffmpeg.py,protocol.py} \
--replace-fail 'executable: str = "ffmpeg"' 'executable: str = "${lib.getExe ffmpeg-headless}"'
substituteInPlace tests/helpers.py \
--replace-fail '"ffprobe"' '"${lib.getExe' ffmpeg-headless "ffprobe"}"'

# Some systems can finish before the `0.1` timeout.
substituteInPlace tests/test_{,asyncio_}timeout.py \
--replace-fail 'ffmpeg.execute(timeout=0.1)' 'ffmpeg.execute(timeout=0.01)'
'';

build-system = [ setuptools ];

dependencies = [ pyee ];

nativeCheckInputs = [
pytestCheckHook
pytest-asyncio
];

nativeBuildInputs = [ setuptools-scm ];
pythonImportsCheck = [ "ffmpeg" ];

meta = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
lib,
buildPythonPackage,
fetchFromGitLab,
poetry-core,
cryptography,
requests,
}:

buildPythonPackage rec {
pname = "requests-http-message-signatures";
version = "0.3.0";
pyproject = true;

src = fetchFromGitLab {
domain = "dev.funkwhale.audio";
owner = "funkwhale";
repo = "requests-http-message-signatures";
tag = version;
hash = "sha256-1GObY+bF5wwgjDORUlO61bmIadK+EpZtyYGMgS9Bqzg=";
};

build-system = [ poetry-core ];

dependencies = [
cryptography
requests
];

# Tests require network access.
doCheck = false;

pythonImportsCheck = [ "requests_http_message_signatures" ];

meta = {
description = "Request authentication plugin implementing IETF HTTP Message Signatures";
homepage = "https://dev.funkwhale.audio/funkwhale/requests-http-message-signatures";
changelog = "https://dev.funkwhale.audio/funkwhale/requests-http-message-signatures/-/blob/${src.tag}/CHANGELOG.md";
license = lib.licenses.asl20;
teams = [ lib.teams.ngi ];
};
}
89 changes: 89 additions & 0 deletions pkgs/development/python-modules/troi/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
lib,
buildPythonPackage,
fetchFromGitHub,
setuptools,
setuptools-scm,
click,
lb-matching-tools,
liblistenbrainz,
more-itertools,
mutagen,
peewee,
psycopg2-binary,
py-sonic,
python-dateutil,
regex,
requests,
scikit-learn,
spotipy,
tqdm,
ujson,
unidecode,
pytestCheckHook,
requests-mock,
}:

buildPythonPackage rec {
pname = "troi";
version = "2025.08.06.3";
pyproject = true;

src = fetchFromGitHub {
owner = "metabrainz";
repo = "troi-recommendation-playground";
tag = "v${version}";
hash = "sha256-qLnXaNb1Kon+XPJYCPe31EgXpukIfzTa+LADOzFjE9Q=";
};

build-system = [
setuptools
setuptools-scm
];

pythonRelaxDeps = [ "mutagen" ];
pythonRemoveDeps = [
# It's not used anywhere in the code.
# TODO: Remove in next update. See <https://github.com/metabrainz/troi-recommendation-playground/pull/179>
"countryinfo"
];

dependencies = [
click
lb-matching-tools
liblistenbrainz
more-itertools
mutagen
peewee
psycopg2-binary
py-sonic
python-dateutil
regex
requests
scikit-learn
spotipy
tqdm
ujson
unidecode
];

optional-dependencies = {
# Not packaged yet.
# nmslib = [ "nmslib-metabrainz" ];
};

nativeCheckInputs = [
pytestCheckHook
requests-mock
];

pythonImportsCheck = [ "troi" ];

meta = {
description = "ListenBrainz' empathic music recommendation/playlisting engine";
homepage = "https://github.com/metabrainz/troi-recommendation-playground";
changelog = "https://github.com/metabrainz/troi-recommendation-playground/releases/tag/${src.tag}";
license = lib.licenses.gpl2Only;
teams = [ lib.teams.ngi ];
};
}
Loading
Loading