Unverified Commit 6d150cab authored by Fabian Affolter's avatar Fabian Affolter Committed by GitHub
Browse files

python312Packages.afdko: refactor (#349610)

parents 46dccd69 56eb0d0a
Loading
Loading
Loading
Loading
+40 −45
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  # Enables some expensive tests, useful for verifying an update
  afdko,
  antlr4_9,
  booleanoperations,
  buildPythonPackage,
  fetchFromGitHub,
  pythonOlder,
  fonttools,
  cmake,
  defcon,
  lxml,
  fs,
  unicodedata2,
  zopfli,
  brotlipy,
  fontpens,
  brotli,
  fetchFromGitHub,
  fontmath,
  fontpens,
  fonttools,
  libxml2,
  mutatormath,
  booleanoperations,
  ufoprocessor,
  ufonormalizer,
  tqdm,
  setuptools-scm,
  scikit-build,
  cmake,
  ninja,
  antlr4_9,
  libxml2,
  pytestCheckHook,
  # Enables some expensive tests, useful for verifying an update
  pythonOlder,
  runAllTests ? false,
  afdko,
  scikit-build,
  setuptools-scm,
  tqdm,
  ufonormalizer,
  ufoprocessor,
}:

buildPythonPackage rec {
  pname = "afdko";
  version = "4.0.1";
  format = "pyproject";
  pyproject = true;

  disabled = pythonOlder "3.7";
  disabled = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "adobe-type-tools";
    repo = pname;
    repo = "afdko";
    rev = "refs/tags/${version}";
    hash = "sha256-I5GKPkbyQX8QNSZgNB3wPKdWwpx8Xkklesu1M7nhgp8=";
  };

  build-system = [ setuptools-scm ];

  nativeBuildInputs = [
    setuptools-scm
    scikit-build
    cmake
    ninja
@@ -78,23 +73,23 @@ buildPythonPackage rec {
  # setup.py will always (re-)execute cmake in buildPhase
  dontConfigure = true;

  propagatedBuildInputs = [
  dependencies =
    [
      booleanoperations
    fonttools
    lxml # fonttools[lxml], defcon[lxml] extra
    fs # fonttools[ufo] extra
    unicodedata2 # fonttools[unicode] extra
    brotlipy # fonttools[woff] extra
    zopfli # fonttools[woff] extra
    fontpens
    brotli
      defcon
      fontmath
      fontpens
      fonttools
      mutatormath
    ufoprocessor
    ufonormalizer
      tqdm
  ];
      ufonormalizer
      ufoprocessor
    ]
    ++ defcon.optional-dependencies.lxml
    ++ fonttools.optional-dependencies.lxml
    ++ fonttools.optional-dependencies.ufo
    ++ fonttools.optional-dependencies.unicode
    ++ fonttools.optional-dependencies.woff;

  # Use system libxml2
  FORCE_SYSTEM_LIBXML2 = true;
@@ -116,7 +111,7 @@ buildPythonPackage rec {
      "test_waterfallplot"
    ]
    ++ lib.optionals (stdenv.cc.isGNU) [
      # broke in the gcc 13  14 update
      # broke in the gcc 13 -> 14 update
      "test_dump"
      "test_input_formats"
      "test_other_input_formats"
@@ -146,10 +141,10 @@ buildPythonPackage rec {
  };

  meta = with lib; {
    changelog = "https://github.com/adobe-type-tools/afdko/blob/${version}/NEWS.md";
    description = "Adobe Font Development Kit for OpenType";
    changelog = "https://github.com/adobe-type-tools/afdko/blob/${version}/NEWS.md";
    homepage = "https://adobe-type-tools.github.io/afdko";
    license = licenses.asl20;
    maintainers = [ maintainers.sternenseemann ];
    maintainers = with maintainers; [ sternenseemann ];
  };
}
+3 −1
Original line number Diff line number Diff line
@@ -5,8 +5,8 @@
  fonttools,
  protobuf,
  pytestCheckHook,
  setuptools-scm,
  pythonOlder,
  setuptools-scm,
}:

buildPythonPackage rec {
@@ -27,6 +27,8 @@ buildPythonPackage rec {
  # in the closure of fontbakery. It seems to be compatible enough.
  pythonRelaxDeps = [ "protobuf" ];

  env.PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";

  build-system = [ setuptools-scm ];

  dependencies = [
+7 −4
Original line number Diff line number Diff line
@@ -27,19 +27,22 @@

buildPythonPackage rec {
  pname = "diffenator2";
  version = "0.4.3";
  version = "0.4.4";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "googlefonts";
    repo = "diffenator2";
    rev = "refs/tags/v${version}";
    hash = "sha256-zeNcNR14ieY6Inp4kOwIPXd6S+/wFdMFp6wbiqgB/iA=";
    hash = "sha256-FVdQW2iupAxHFmx6sC88yO2Vx3VvBhPJl55gA0fmvgo=";
  };

  nativeBuildInputs = [ pythonRelaxDepsHook ];
  env.PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";

  pythonRelaxDeps = [ "protobuf" ];
  pythonRelaxDeps = [
    "protobuf"
    "python-bidi"
  ];

  build-system = [
    poetry-core
+5 −1
Original line number Diff line number Diff line
@@ -57,6 +57,8 @@ buildPythonPackage rec {
    hash = "sha256-Cl0jRQqF83IIldkp1VuVSS4ZeVsQH1NNpyEkpMJqhA8=";
  };

  env.PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";

  pythonRelaxDeps = [
    "collidoscope"
    "protobuf"
@@ -127,7 +129,7 @@ buildPythonPackage rec {
  '';

  disabledTests = [
    # These require network access:
    # These require network access
    "test_check_description_broken_links"
    "test_check_description_family_update"
    "test_check_metadata_designer_profiles"
@@ -138,6 +140,8 @@ buildPythonPackage rec {
    "test_check_cjk_vertical_metrics"
    "test_check_cjk_vertical_metrics_regressions"
    "test_check_fontbakery_version_live_apis"
    # AssertionError
    "test_check_shape_languages"
  ];

  postInstall = ''
+18 −5
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
  protobuf,
  pytestCheckHook,
  pythonOlder,
  regex,
  setuptools,
  setuptools-scm,
  uharfbuzz,
@@ -13,29 +14,33 @@

buildPythonPackage rec {
  pname = "gflanguages";
  version = "0.6.2";
  version = "0.6.5";
  pyproject = true;

  disabled = pythonOlder "3.7";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-v93mXDwHT/8Tau78ApLUR+dQCpL9jmRQp0BT5y/sfq4=";
    hash = "sha256-wMhRVWdjKiEfzswnAWqKfzHrpJj0U4q8tzDBGshNryo=";
  };

  pyproject = true;

  # Relax the dependency on protobuf 3. Other packages in the Google Fonts
  # ecosystem have begun upgrading from protobuf 3 to protobuf 4,
  # so we need to use protobuf 4 here as well to avoid a conflict
  # in the closure of fontbakery. It seems to be compatible enough.
  pythonRelaxDeps = [ "protobuf" ];

  env.PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION = "python";

  build-system = [
    setuptools
    setuptools-scm
  ];

  dependencies = [ protobuf ];
  dependencies = [
    protobuf
    regex
  ];

  nativeCheckInputs = [
    pytestCheckHook
@@ -43,6 +48,14 @@ buildPythonPackage rec {
    youseedee
  ];

  pythonImportsCheck = [ "gflanguages" ];

  disabledTests = [
    # AssertionError
    "test_exemplars_are_in_script"
    "test_sample_texts_are_in_script"
  ];

  meta = with lib; {
    description = "Python library for Google Fonts language metadata";
    homepage = "https://github.com/googlefonts/lang";
Loading