diff --git a/pkgs/development/python-modules/python-fluent/fluent-pygments.nix b/pkgs/development/python-modules/python-fluent/fluent-pygments.nix new file mode 100644 index 0000000000000..141e13c1d5c41 --- /dev/null +++ b/pkgs/development/python-modules/python-fluent/fluent-pygments.nix @@ -0,0 +1,51 @@ +{ + buildPythonPackage, + fetchFromGitHub, + lib, + pytestCheckHook, + setuptools, + + # dependencies + fluent-syntax, + pygments, + six, +}: + +let + version = "1.0"; + + src = fetchFromGitHub { + owner = "projectfluent"; + repo = "python-fluent"; + rev = "fluent.pygments@${version}"; + hash = "sha256-AR2uce3HS1ELzpoHmx7F/5/nrL+7KhYemw/00nmvLik="; + }; +in +buildPythonPackage { + pname = "fluent-pygments"; + inherit version; + pyproject = true; + + inherit src; + sourceRoot = "${src.name}/fluent.pygments"; + + build-system = [ setuptools ]; + + dependencies = [ + fluent-syntax + pygments + six + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "fluent.pygments" ]; + + meta = { + changelog = "https://github.com/projectfluent/python-fluent/blob/main/fluent.pygments/CHANGELOG.rst"; + description = "Plugin for pygments to add syntax highlighting of Fluent files in Sphinx"; + homepage = "https://projectfluent.org/python-fluent/fluent.pygments/${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ getpsyched ]; + }; +} diff --git a/pkgs/development/python-modules/python-fluent/fluent-runtime.nix b/pkgs/development/python-modules/python-fluent/fluent-runtime.nix new file mode 100644 index 0000000000000..1a011956eccee --- /dev/null +++ b/pkgs/development/python-modules/python-fluent/fluent-runtime.nix @@ -0,0 +1,61 @@ +{ + buildPythonPackage, + fetchFromGitHub, + lib, + pytestCheckHook, + setuptools, + + # dependencies + attrs, + babel, + fluent-syntax, + pytz, + typing-extensions, +}: + +let + version = "0.4.0"; + + src = fetchFromGitHub { + owner = "projectfluent"; + repo = "python-fluent"; + rev = "fluent.runtime@${version}"; + hash = "sha256-Crg6ybweOZ4B3WfLMOcD7+TxGEZPTHJUxr8ItLB4G+Y="; + }; +in +buildPythonPackage { + pname = "fluent-runtime"; + inherit version; + pyproject = true; + + inherit src; + sourceRoot = "${src.name}/fluent.runtime"; + + build-system = [ setuptools ]; + + dependencies = [ + attrs + babel + fluent-syntax + pytz + typing-extensions + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + disabledTests = [ + # https://github.com/projectfluent/python-fluent/pull/203 + "test_timeZone" + ]; + + pythonImportsCheck = [ "fluent.runtime" ]; + + meta = { + changelog = "https://github.com/projectfluent/python-fluent/blob/${src.rev}/fluent.runtime/CHANGELOG.rst"; + description = "Localization library for expressive translations"; + downloadPage = "https://github.com/projectfluent/python-fluent/releases/tag/${src.rev}"; + homepage = "https://projectfluent.org/python-fluent/fluent.runtime/${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ getpsyched ]; + }; +} diff --git a/pkgs/development/python-modules/python-fluent/fluent-syntax.nix b/pkgs/development/python-modules/python-fluent/fluent-syntax.nix new file mode 100644 index 0000000000000..ddaa43560f2a7 --- /dev/null +++ b/pkgs/development/python-modules/python-fluent/fluent-syntax.nix @@ -0,0 +1,44 @@ +{ + buildPythonPackage, + fetchFromGitHub, + lib, + pytestCheckHook, + setuptools, + typing-extensions, +}: + +let + version = "0.19.0"; + + src = fetchFromGitHub { + owner = "projectfluent"; + repo = "python-fluent"; + rev = "fluent.syntax@${version}"; + hash = "sha256-nULngwBG/ebICRDi6HMHBdT+r/oq6tbDL7C1iMZpMsA="; + }; +in +buildPythonPackage { + pname = "fluent-syntax"; + inherit version; + pyproject = true; + + inherit src; + sourceRoot = "${src.name}/fluent.syntax"; + + build-system = [ setuptools ]; + + dependencies = [ typing-extensions ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + pythonImportsCheck = [ "fluent.syntax" ]; + + meta = { + changelog = "https://github.com/projectfluent/python-fluent/blob/${src.rev}/fluent.syntax/CHANGELOG.md"; + description = "Parse, analyze, process, and serialize Fluent files"; + downloadPage = "https://github.com/projectfluent/python-fluent/releases/tag/${src.rev}"; + homepage = "https://projectfluent.org/python-fluent/fluent.syntax/${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ getpsyched ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index b9ae5de95e7db..17468d9112540 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4510,6 +4510,12 @@ self: super: with self; { fluent-logger = callPackage ../development/python-modules/fluent-logger { }; + fluent-pygments = callPackage ../development/python-modules/python-fluent/fluent-pygments.nix { }; + + fluent-runtime = callPackage ../development/python-modules/python-fluent/fluent-runtime.nix { }; + + fluent-syntax = callPackage ../development/python-modules/python-fluent/fluent-syntax.nix { }; + flufl-bounce = callPackage ../development/python-modules/flufl/bounce.nix { }; flufl-i18n = callPackage ../development/python-modules/flufl/i18n.nix { };