Unverified Commit aa70ff8e authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

Merge pull request #255937 from GetPsyched/python-fluent

parents 04caedf5 0f861fa4
Loading
Loading
Loading
Loading
+51 −0
Original line number Diff line number Diff line
{
  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 ];
  };
}
+61 −0
Original line number Diff line number Diff line
{
  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 ];
  };
}
+44 −0
Original line number Diff line number Diff line
{
  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 ];
  };
}
+6 −0
Original line number Diff line number Diff line
@@ -4522,6 +4522,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 { };