From 5c3c2dd4fb1ab4d46b517d2981227878f8eb54e5 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Wed, 19 Aug 2026 15:58:31 +0200 Subject: [PATCH 1/3] Run `tox -e lint` This PR runs the linting script in place, with no changes to the underling versions of black nor flake8 --- _data/operations.yml | 20 ++++++++++---------- src/obofoundry/update_operations_metadata.py | 6 ++---- tests/test_integrity.py | 16 ++++++++-------- tests/test_memberships.py | 6 ++---- util/extract-metadata.py | 4 ++-- util/make-shacl-prefixes.py | 3 +-- util/sort-ontologies.py | 6 ++---- 7 files changed, 27 insertions(+), 34 deletions(-) diff --git a/_data/operations.yml b/_data/operations.yml index db4b61254..80274f476 100644 --- a/_data/operations.yml +++ b/_data/operations.yml @@ -115,6 +115,16 @@ members: name: James Stevenson orcid: 0000-0002-2568-6163 wikidata: Q125208044 +- affiliation: + name: Rancho Biosciences + ror: 0114vcr39 + country: UK + github: janelomax + groups: + - outreach + name: Jane Lomax + orcid: 0000-0001-8865-4321 + wikidata: Q20746117 - affiliation: name: University of Michigan, Ann Arbor, MI ror: 00jmfr291 @@ -218,13 +228,3 @@ members: name: Shawn Tan orcid: 0000-0001-7258-9596 wikidata: Q57023310 -- affiliation: - name: Rancho Biosciences - ror: 0114vcr39 - country: UK - github: janelomax - groups: - - outreach - name: Jane Lomax - orcid: 0000-0001-8865-4321 - wikidata: Q20746117 diff --git a/src/obofoundry/update_operations_metadata.py b/src/obofoundry/update_operations_metadata.py index f24584d3d..574ad17a7 100644 --- a/src/obofoundry/update_operations_metadata.py +++ b/src/obofoundry/update_operations_metadata.py @@ -24,8 +24,7 @@ def _main(path: Path): orcid = member["orcid"] if "wikidata" not in member or "github" not in member: tqdm.write(f"{member['name']} ({orcid}) missing wikidata or github") - sparql = dedent( - f"""\ + sparql = dedent(f"""\ SELECT DISTINCT ?item ?github WHERE {{ @@ -33,8 +32,7 @@ def _main(path: Path): OPTIONAL {{ ?item wdt:P2037 ?github }} . }} LIMIT 1 - """ - ) + """) res = query_wikidata(sparql) if res: member["wikidata"] = res[0]["item"]["value"].removeprefix( diff --git a/tests/test_integrity.py b/tests/test_integrity.py index 49148a278..73733c233 100644 --- a/tests/test_integrity.py +++ b/tests/test_integrity.py @@ -217,16 +217,18 @@ def test_has_purl_config(self): """Tests that OBO PURL configuration is available.""" existing_purl_configs = set() missing = set() - res = requests.get('https://api.github.com/repos/OBOFoundry/purl.obolibrary.org/git/trees/master?recursive=1') + res = requests.get( + "https://api.github.com/repos/OBOFoundry/purl.obolibrary.org/git/trees/master?recursive=1" + ) self.assertEqual( 200, res.status_code, - "Error while fetching Git tree for OBOFoundry/purl.obolibrary.org" + "Error while fetching Git tree for OBOFoundry/purl.obolibrary.org", ) data = res.json() - for entry in data['tree']: - if entry['path'].startswith('config/'): - existing_purl_configs.add(entry['path']) + for entry in data["tree"]: + if entry["path"].startswith("config/"): + existing_purl_configs.add(entry["path"]) for prefix, record in self.ontologies.items(): if self.skip_inactive(record): continue @@ -235,9 +237,7 @@ def test_has_purl_config(self): if filename not in existing_purl_configs: missing.add(prefix) self.assertEqual( - set(), - missing, - msg=f"PURL configuration missing for {', '.join(missing)}" + set(), missing, msg=f"PURL configuration missing for {', '.join(missing)}" ) diff --git a/tests/test_memberships.py b/tests/test_memberships.py index bb320c770..c20b7ba92 100644 --- a/tests/test_memberships.py +++ b/tests/test_memberships.py @@ -58,14 +58,12 @@ def test_data(self): self.assertFalse( person.affiliation.ror is None and person.affiliation.wikidata is None, - msg=dedent( - f"""\ + msg=dedent(f"""\ No ROR nor Wikidata identifier was curated for {person.name}. Please search https://ror.org for their affiliation. If none exists, please submit a new ROR ID request (linked from bottom of homepage). If the request is rejected, create a Wikidata entry and annotate in the `affiliation_wikidata` field. - """.rstrip() - ), + """.rstrip()), ) self.assertTrue( OFOC_IMAGES.joinpath(person.github).with_suffix(".png").is_file(), diff --git a/util/extract-metadata.py b/util/extract-metadata.py index 33890389e..1ce752ae5 100755 --- a/util/extract-metadata.py +++ b/util/extract-metadata.py @@ -143,7 +143,7 @@ def validate_structure(obj): errs.append(f"%s: {p}" % (fn)) elif p.level == "warning": warn.append(f"%s: {p}" % (fn)) - (obj, md) = load_md(fn) + obj, md = load_md(fn) errs += validate_structure(obj) if len(warn) > 0: print("WARNINGS:", file=sys.stderr) @@ -255,7 +255,7 @@ def concat_principles_yaml(args): with open(args.include, "r") as f: cfg = yaml.load(f.read(), Loader=yaml.SafeLoader) for fn in args.files: - (obj, md) = load_md(fn) + obj, md = load_md(fn) objs.append(obj) objs.sort(key=lambda x: x["id"]) cfg["principles"] = objs diff --git a/util/make-shacl-prefixes.py b/util/make-shacl-prefixes.py index 10045358a..22e2a8326 100755 --- a/util/make-shacl-prefixes.py +++ b/util/make-shacl-prefixes.py @@ -34,8 +34,7 @@ def main(): """ parser = ArgumentParser( - description=""" - Takes ontologies.yml file and makes a triple file with shacl prefixes""" + description="Takes ontologies.yml file and makes a triple file with shacl prefixes" ) parser.add_argument("input") args = parser.parse_args() diff --git a/util/sort-ontologies.py b/util/sort-ontologies.py index 11ab99c88..9e3b52ee4 100755 --- a/util/sort-ontologies.py +++ b/util/sort-ontologies.py @@ -15,11 +15,9 @@ def main(): - parser = ArgumentParser( - description=""" + parser = ArgumentParser(description=""" Takes a YAML file containing information for various ontologies and a metadata file specifying - the sorting order for ontologies, and then produces a sorted version input YAML""" - ) + the sorting order for ontologies, and then produces a sorted version input YAML""") parser.add_argument( "unsorted_yaml", type=str, From 9c0126ac35340b1a888b1aec810ae2030c5b9353 Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Wed, 19 Aug 2026 16:00:14 +0200 Subject: [PATCH 2/3] Update black --- src/obofoundry/update_operations_metadata.py | 6 ++++-- tests/test_memberships.py | 6 ++++-- tox.ini | 2 +- util/sort-ontologies.py | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/obofoundry/update_operations_metadata.py b/src/obofoundry/update_operations_metadata.py index 574ad17a7..f24584d3d 100644 --- a/src/obofoundry/update_operations_metadata.py +++ b/src/obofoundry/update_operations_metadata.py @@ -24,7 +24,8 @@ def _main(path: Path): orcid = member["orcid"] if "wikidata" not in member or "github" not in member: tqdm.write(f"{member['name']} ({orcid}) missing wikidata or github") - sparql = dedent(f"""\ + sparql = dedent( + f"""\ SELECT DISTINCT ?item ?github WHERE {{ @@ -32,7 +33,8 @@ def _main(path: Path): OPTIONAL {{ ?item wdt:P2037 ?github }} . }} LIMIT 1 - """) + """ + ) res = query_wikidata(sparql) if res: member["wikidata"] = res[0]["item"]["value"].removeprefix( diff --git a/tests/test_memberships.py b/tests/test_memberships.py index c20b7ba92..bb320c770 100644 --- a/tests/test_memberships.py +++ b/tests/test_memberships.py @@ -58,12 +58,14 @@ def test_data(self): self.assertFalse( person.affiliation.ror is None and person.affiliation.wikidata is None, - msg=dedent(f"""\ + msg=dedent( + f"""\ No ROR nor Wikidata identifier was curated for {person.name}. Please search https://ror.org for their affiliation. If none exists, please submit a new ROR ID request (linked from bottom of homepage). If the request is rejected, create a Wikidata entry and annotate in the `affiliation_wikidata` field. - """.rstrip()), + """.rstrip() + ), ) self.assertTrue( OFOC_IMAGES.joinpath(person.github).with_suffix(".png").is_file(), diff --git a/tox.ini b/tox.ini index 6fc814e46..fc43f8e10 100644 --- a/tox.ini +++ b/tox.ini @@ -37,7 +37,7 @@ description = Run the flake8 code quality checks [testenv:lint] usedevelop = true deps = - black + black==24.8.0 isort pyyaml commands = diff --git a/util/sort-ontologies.py b/util/sort-ontologies.py index 9e3b52ee4..11ab99c88 100755 --- a/util/sort-ontologies.py +++ b/util/sort-ontologies.py @@ -15,9 +15,11 @@ def main(): - parser = ArgumentParser(description=""" + parser = ArgumentParser( + description=""" Takes a YAML file containing information for various ontologies and a metadata file specifying - the sorting order for ontologies, and then produces a sorted version input YAML""") + the sorting order for ontologies, and then produces a sorted version input YAML""" + ) parser.add_argument( "unsorted_yaml", type=str, From f36b31f79045c924b27fac1b423564b0be85df7e Mon Sep 17 00:00:00 2001 From: Charles Tapley Hoyt Date: Wed, 19 Aug 2026 16:04:57 +0200 Subject: [PATCH 3/3] Update tox.ini --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index fc43f8e10..7c7b577f1 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,7 @@ description = Run the new-style tests [testenv:flake8] skip_install = true deps = - flake8<5.0.0 + flake8 flake8-docstrings black==24.8.0 flake8-black