Repository: googlefonts/axisregistry (language: python)

Issue:
Don't delete name IDs which are shared with the STAT table



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml
index ab9611e47..143910ab3 100644
--- a/.github/workflows/tox.yml
+++ b/.github/workflows/tox.yml
@@ -23,7 +23,9 @@ jobs:
     - name: Install dependencies
       run: |
         python -m pip install --upgrade pip
-        pip install tox tox-gh-actions
+        pip install tox tox-gh-actions pytest
 
     - name: Test with tox
-      run: tox
+      run: |
+        tox -e py
+        tox -e lint
diff --git a/Lib/axisregistry/__init__.py b/Lib/axisregistry/__init__.py
index 47bb6773b..328acdc01 100644
--- a/Lib/axisregistry/__init__.py
+++ b/Lib/axisregistry/__init__.py
@@ -323,8 +323,10 @@ def build_fvar_instances(ttFont, axis_dflts={}):
     # Protect name IDs which are shared with the STAT table
     stat_nameids = []
     if "STAT" in ttFont:
-        if stat.table.AxisValueCount > 0:
-            stat_nameids = [av.ValueNameID for av in ttFont["STAT"].table.AxisValueArray.AxisValue]
+        if ttFont["STAT"].table.AxisValueCount > 0:
+            stat_nameids = [
+                av.ValueNameID for av in ttFont["STAT"].table.AxisValueArray.AxisValue
+            ]
 
     # rm old fvar subfamily and ps name records
     for inst in fvar.instances:
diff --git a/setup.py b/setup.py
index 34df052bd..01b44b6fa 100644
--- a/setup.py
+++ b/setup.py
@@ -43,5 +43,5 @@
     ],
     python_requires=">=3.7",
     setup_requires=["setuptools_scm>=4,<6.1"],
-    install_requires=["protobuf"],
+    install_requires=["protobuf==3.19.4", "fonttools"],
 )
diff --git a/tox.ini b/tox.ini
index 6bd931b89..9809c5c78 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,9 +16,7 @@ skip_install = true
 deps =
     -r test_requirements.txt
 commands =
-    black --check --diff .
-    isort --check-only --diff .
-    flake8
+    black --check --diff --extend-exclude "_version.py" .
 
 [testenv:coverage-report]
 skip_install = true


Test patch:
diff --git a/test_requirements.txt b/test_requirements.txt
new file mode 100644
index 000000000..ec739f6ad
--- /dev/null
+++ b/test_requirements.txt
@@ -0,0 +1,5 @@
+pytest>=4.5.0
+coverage>=5
+black
+isort
+flake8-bugbear
\ No newline at end of file
diff --git a/tests/test_names.py b/tests/test_names.py
index 3497bd9e8..e9913c193 100644
--- a/tests/test_names.py
+++ b/tests/test_names.py
@@ -500,9 +500,9 @@ def test_filename(fp, expected):
         (opensans_roman_fp, [opensans_cond_roman_fp], True),
         (opensans_roman_fp, [opensans_italic_fp], False),
         (wonky_fp, [], False),
-    ]
+    ],
 )
 def test_fvar_instance_collisions(fp, sibling_fps, result):
     ttFont = TTFont(fp)
     siblings = [TTFont(fp) for fp in sibling_fps]
-    assert _fvar_instance_collisions(ttFont, siblings) == result
\ No newline at end of file
+    assert _fvar_instance_collisions(ttFont, siblings) == result