[med-svn] [Git][med-team/python-cobra][master] patch-out python3-importlib-resources
Alexandre Detiste (@detiste-guest)
gitlab at salsa.debian.org
Wed Jul 2 23:34:21 BST 2025
Alexandre Detiste pushed to branch master at Debian Med / python-cobra
Commits:
587179a9 by Alexandre Detiste at 2025-07-03T00:27:01+02:00
patch-out python3-importlib-resources
- - - - -
4 changed files:
- debian/changelog
- debian/control
- + debian/patches/pr1452.patch
- debian/patches/series
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+python-cobra (0.29.1-3) unstable; urgency=medium
+
+ * Team upload.
+ * Patch-out dependency on external python3-importlib-resources.
+
+ -- Alexandre Detiste <tchet at debian.org> Thu, 03 Jul 2025 00:26:36 +0200
+
python-cobra (0.29.1-2) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -9,7 +9,6 @@ Build-Depends: debhelper-compat (= 13),
python3-dev,
python3-setuptools,
python3-depinfo,
- python3-importlib-resources,
python3-numpy,
python3-optlang (>= 1.7.0-1~),
python3-ruamel.yaml,
=====================================
debian/patches/pr1452.patch
=====================================
@@ -0,0 +1,129 @@
+From 61c0bfe738dee0ec76fb8fbffa0b0854ef66b13e Mon Sep 17 00:00:00 2001
+From: Alexandre Detiste <alexandre.detiste at gmail.com>
+Date: Thu, 3 Jul 2025 00:18:34 +0200
+Subject: [PATCH] use the importlib.resources from the standard library, not
+ the external backport
+
+---
+ setup.cfg | 1 -
+ src/cobra/io/web/cobrapy_repository.py | 4 ++--
+ tests/conftest.py | 4 ++--
+ tests/data/update_pickles.py | 11 +++++------
+ tests/test_io/test_json.py | 2 +-
+ tox.ini | 1 -
+ 6 files changed, 10 insertions(+), 13 deletions(-)
+
+--- a/setup.cfg
++++ b/setup.cfg
+@@ -56,7 +56,6 @@
+ depinfo ~=2.2
+ diskcache ~=5.0
+ httpx ~=0.24
+- importlib_resources
+ numpy >=1.13
+ optlang ~=1.8
+ pandas >=1.0,<3.0
+--- a/src/cobra/io/web/cobrapy_repository.py
++++ b/src/cobra/io/web/cobrapy_repository.py
+@@ -1,6 +1,6 @@
+ """Provide functions for loading metabolic models from local package data."""
+
+-import importlib_resources
++import importlib.resources
+
+ import cobra.data
+
+@@ -50,7 +50,7 @@
+ A gzip-compressed, UTF-8 encoded SBML document.
+ """
+ return (
+- importlib_resources.files(cobra.data)
++ importlib.resources.files(cobra.data)
+ .joinpath(f"{model_id}.xml.gz")
+ .read_bytes()
+ )
+--- a/tests/conftest.py
++++ b/tests/conftest.py
+@@ -1,10 +1,10 @@
+ """Define global fixtures."""
+
++import importlib.resources
+ from pathlib import Path
+ from pickle import load as _load
+ from typing import List, Tuple
+
+-import importlib_resources
+ import pytest
+
+ import cobra
+@@ -14,7 +14,7 @@
+
+
+ data_dir = Path(__file__).parent / "data"
+-cobra_data_dir = importlib_resources.files(cobra.data)
++cobra_data_dir = importlib.resources.files(cobra.data)
+
+
+ def create_test_model(model_name: str = "salmonella") -> Model:
+--- a/tests/data/update_pickles.py
++++ b/tests/data/update_pickles.py
+@@ -10,12 +10,11 @@
+ """
+
+
++import importlib.resources
+ from collections import OrderedDict
+ from json import dump as json_dump
+ from pickle import dump, load
+
+-import importlib_resources
+-
+ import cobra
+ from cobra.io import (
+ load_matlab_model,
+@@ -99,16 +98,16 @@
+ # output to various formats
+ with open("mini.pickle", "wb") as outfile:
+ dump(mini, outfile, protocol=2)
+- save_matlab_model(mini, importlib_resources.files(cobra.data).joinpath("mini.mat"))
++ save_matlab_model(mini, importlib.resources.files(cobra.data).joinpath("mini.mat"))
+ save_json_model(
+- mini, importlib_resources.files(cobra.data).joinpath("mini.json"), pretty=True
++ mini, importlib.resources.files(cobra.data).joinpath("mini.json"), pretty=True
+ )
+- save_yaml_model(mini, importlib_resources.files(cobra.data).joinpath("mini.yml"))
++ save_yaml_model(mini, importlib.resources.files(cobra.data).joinpath("mini.yml"))
+ write_sbml_model(mini, "mini_fbc2.xml")
+ write_sbml_model(mini, "mini_fbc2.xml.bz2")
+ write_sbml_model(mini, "mini_fbc2.xml.gz")
+ write_sbml_model(
+- mini, importlib_resources.files(cobra.data).joinpath("mini_cobra.xml")
++ mini, importlib.resources.files(cobra.data).joinpath("mini_cobra.xml")
+ )
+ raven = load_matlab_model("raven.mat")
+ with open("raven.pickle", "wb") as outfile:
+--- a/tests/test_io/test_json.py
++++ b/tests/test_io/test_json.py
+@@ -1,11 +1,11 @@
+ """Test functionalities of I/O in JSON format."""
+
+ import json
++from importlib.resources import files
+ from pathlib import Path
+ from typing import Any, Callable, Dict, Union
+
+ import pytest
+-from importlib_resources import files
+
+ from cobra import Model
+ from cobra import io as cio
+--- a/tox.ini
++++ b/tox.ini
+@@ -111,7 +111,6 @@
+ diskcache
+ future
+ httpx
+- importlib_resources
+ libsbml
+ numpy
+ optlang
=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ ignore_tests.patch
no_future_dependency.patch
remove-appdirs.patch
a2b9d00a04b85b8c8eb12e4deba29ce2147896cf.patch
+pr1452.patch
View it on GitLab: https://salsa.debian.org/med-team/python-cobra/-/commit/587179a9fbbd2d21f8eb96834ff5782df7bf21be
--
View it on GitLab: https://salsa.debian.org/med-team/python-cobra/-/commit/587179a9fbbd2d21f8eb96834ff5782df7bf21be
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20250702/661c80e5/attachment-0001.htm>
More information about the debian-med-commit
mailing list