Skip to content
Merged
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
29 changes: 18 additions & 11 deletions pkgs/development/python-modules/fontbakery/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
, font-v
, freetype-py
, gflanguages
, gfsubsets
, git
, glyphsets
, lxml
, installShellFiles
, jinja2
, munkres
, opentypespec
, ots-python
Expand All @@ -32,6 +34,7 @@
, requests
, requests-mock
, rich
, setuptools
, setuptools-scm
, shaperglot
, stringbrewer
Expand All @@ -45,23 +48,15 @@
buildPythonPackage rec {
pname = "fontbakery";
version = "0.11.2";
format = "setuptools";

src = fetchPypi {
inherit pname version;
hash = "sha256-61EXlf+d5kJeUF41OEnGNLaOcSvFWUDFgarVvHQZYmw=";
};

patches = [
# Mock HTTP requests in tests (note we still have to skip some below)
# https://github.com/googlefonts/fontbakery/pull/4124
(fetchpatch {
url = "https://github.com/fonttools/fontbakery/pull/4124.patch";
hash = "sha256-NXuC2+TtxpHYMdd0t+cF0FJ3lrh4exP5yxspEasKKd0=";
})
];
pyproject = true;

propagatedBuildInputs = [
dependencies = [
axisregistry
babelfont
beautifulsoup4
Expand All @@ -74,8 +69,10 @@ buildPythonPackage rec {
font-v
freetype-py
gflanguages
gfsubsets
glyphsets
lxml
jinja2
munkres
ots-python
opentypespec
Expand All @@ -93,10 +90,13 @@ buildPythonPackage rec {
vharfbuzz
ufo2ft
];
build-system = [
setuptools
setuptools-scm
];
nativeBuildInputs = [
installShellFiles
pythonRelaxDepsHook
setuptools-scm
];

pythonRelaxDeps = [
Expand Down Expand Up @@ -125,7 +125,14 @@ buildPythonPackage rec {
'';
disabledTests = [
# These require network access:
"test_check_description_broken_links"
"test_check_description_family_update"
"test_check_metadata_designer_profiles"
"test_check_metadata_has_tags"
"test_check_metadata_includes_production_subsets"
"test_check_vertical_metrics"
"test_check_vertical_metrics_regressions"
"test_check_cjk_vertical_metrics"
"test_check_cjk_vertical_metrics_regressions"
"test_check_fontbakery_version_live_apis"
];
Expand Down
13 changes: 8 additions & 5 deletions pkgs/development/python-modules/gflanguages/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,25 @@
, pytestCheckHook
, pythonOlder
, pythonRelaxDepsHook
, setuptools
, setuptools-scm
, uharfbuzz
, youseedee
}:

buildPythonPackage rec {
pname = "gflanguages";
version = "5.0.4";
format = "setuptools";
version = "0.5.17";

disabled = pythonOlder "3.7";

src = fetchPypi {
inherit pname version;
hash = "sha256-AGXpg9EhwdhrcbdcHqz2v9TLaWH1F5gr0QhSuEN2GDA=";
hash = "sha256-dScgRQ6usjSqV0FqDyP+KGvHL06wlTFVcO+MmZ2NMAs=";
};

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
Expand All @@ -30,11 +32,12 @@ buildPythonPackage rec {
"protobuf"
];

nativeBuildInputs = [
build-system = [
setuptools
setuptools-scm
];

propagatedBuildInputs = [
dependencies = [
protobuf
];

Expand Down
47 changes: 47 additions & 0 deletions pkgs/development/python-modules/gfsubsets/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{ lib
, buildPythonPackage
, fetchPypi
, fonttools
, importlib-resources
, setuptools
, setuptools-scm
, youseedee
}:

buildPythonPackage rec {
pname = "gfsubsets";
version = "2024.2.5";
gitTag = "v2024.02.05";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you want to leak this into the environment, change it to

Suggested change
gitTag = "v2024.02.05";
env.gitTag = "v2024.02.05";

Otherwise, I don't see any usage, please remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used below in meta.changelog:

changelog = "https://github.com/googlefonts/nam-files/releases/tag/${gitTag}";

Unfortunately because of upstream's chosen versioning scheme, the git tag and PyPI versions don't match. I didn't want to try and craft some complicated expression to predict the git tag from the PyPI version or vice versa, I was intending to just use this variable here as a reminder to keep these two versions in sync with each other in future.

Admittedly, that means the normal Python package update script won't work correctly on this package. I'm not sure what the best solution is in this case.

Given that the release notes on Github contain very little useful information, maybe the simplest option is to just leave meta.changelog unspecified?


src = fetchPypi {
inherit pname version;
hash = "sha256-g9QxLa3B1MMTs+jmj4CyJySZRU0zoFNYdbOZwHjKPaQ=";
};

pyproject = true;

build-system = [
setuptools
setuptools-scm
];

dependencies = [
fonttools
importlib-resources
youseedee
];

# Package has no unit tests.
doCheck = false;
pythonImportsCheck = [
"gfsubsets"
];

meta = with lib; {
description = "Codepoint definitions for the Google Fonts subsetter";
homepage = "https://github.com/googlefonts/nam-files";
changelog = "https://github.com/googlefonts/nam-files/releases/tag/${gitTag}";
license = licenses.asl20;
maintainers = with maintainers; [ danc86 ];
};
}

This file was deleted.

22 changes: 11 additions & 11 deletions pkgs/development/python-modules/glyphsets/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
, fetchPypi
, defcon
, fonttools
, gflanguages
, glyphslib
, pytestCheckHook
, requests
, setuptools
, setuptools-scm
, unicodedata2
Expand All @@ -13,29 +15,23 @@
buildPythonPackage rec {
pname = "glyphsets";
version = "0.6.14";
format = "setuptools";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-lMRgchadgKyfFLw6ZF1sJAKBAK75zmw77L34MW9p7TI=";
};

patches = [
# Upstream has a needlessly strict version range for setuptools_scm, our
# setuptools-scm is newer. We can't use pythonRelaxDepsHook for this
# because it's in setup_requires which means we'll fail the requirement
# before pythonRelaxDepsHook can run.
./0001-relax-setuptools-scm-dep.patch
];

propagatedBuildInputs = [
dependencies = [
defcon
fonttools
gflanguages
glyphslib
requests
setuptools
unicodedata2
];
nativeBuildInputs = [
build-system = [
setuptools-scm
];

Expand All @@ -46,6 +42,10 @@ buildPythonPackage rec {
preCheck = ''
export PATH="$out/bin:$PATH"
'';
disabledTests = [
# This "test" just tries to connect to PyPI and look for newer releases. Not needed.
"test_dependencies"
];

meta = with lib; {
description = "Google Fonts glyph set metadata";
Expand Down
12 changes: 8 additions & 4 deletions pkgs/development/python-modules/shaperglot/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
, fetchFromGitHub
, gflanguages
, num2words
, poetry-core
, protobuf
, pytestCheckHook
, pyyaml
, setuptools
, setuptools-scm
, strictyaml
, termcolor
, ufo2ft
Expand All @@ -27,18 +29,20 @@ buildPythonPackage rec {

pyproject = true;

propagatedBuildInputs = [
dependencies = [
gflanguages
num2words
protobuf
pyyaml
strictyaml
termcolor
ufo2ft
vharfbuzz
youseedee
];
nativeBuildInputs = [
poetry-core
build-system = [
setuptools
setuptools-scm
];

doCheck = true;
Expand Down
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4693,6 +4693,8 @@ self: super: with self; {

gflanguages = callPackage ../development/python-modules/gflanguages { };

gfsubsets = callPackage ../development/python-modules/gfsubsets { };

ghapi = callPackage ../development/python-modules/ghapi { };

ghdiff = callPackage ../development/python-modules/ghdiff { };
Expand Down