imio.pyutils 1.2.2__tar.gz → 1.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/CHANGES.rst +13 -0
  2. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/MANIFEST.in +1 -0
  3. {imio_pyutils-1.2.2/imio.pyutils.egg-info → imio_pyutils-1.3.0}/PKG-INFO +14 -1
  4. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio/pyutils/tests.py +7 -0
  5. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio/pyutils/utils.py +12 -1
  6. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0/imio.pyutils.egg-info}/PKG-INFO +14 -1
  7. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio.pyutils.egg-info/SOURCES.txt +0 -1
  8. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/setup.py +21 -4
  9. imio_pyutils-1.2.2/imio.pyutils.egg-info/namespace_packages.txt +0 -1
  10. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/Makefile +0 -0
  11. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/README.rst +0 -0
  12. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio/__init__.py +0 -0
  13. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio/pyutils/__init__.py +0 -0
  14. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio/pyutils/batching.py +0 -0
  15. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio/pyutils/bs.py +0 -0
  16. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio/pyutils/postgres.py +0 -0
  17. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio/pyutils/system.py +0 -0
  18. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio.pyutils.egg-info/dependency_links.txt +0 -0
  19. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio.pyutils.egg-info/not-zip-safe +0 -0
  20. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio.pyutils.egg-info/requires.txt +0 -0
  21. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/imio.pyutils.egg-info/top_level.txt +0 -0
  22. {imio_pyutils-1.2.2 → imio_pyutils-1.3.0}/setup.cfg +0 -0
@@ -1,6 +1,19 @@
1
1
  Changelog
2
2
  =========
3
3
 
4
+ 1.3.0 (2026-11-27)
5
+ ------------------
6
+
7
+ - Use a PEP 420 native namespace on Python 3 (setuptools 81 / Plone 6.2): the Python 3 build
8
+ no longer ships `imio/__init__.py`. Python 2.7 keeps the `pkg_resources`-style namespace.
9
+ [bsuttor]
10
+
11
+ 1.2.3 (2026-11-16)
12
+ ------------------
13
+
14
+ - Added `utils.is_true_value` to check if a value (like an environment variable) is considered as true.
15
+ [sgeulette]
16
+
4
17
  1.2.2 (2026-03-26)
5
18
  ------------------
6
19
 
@@ -1,2 +1,3 @@
1
1
  include *.rst
2
2
  include Makefile
3
+ include imio/__init__.py
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: imio.pyutils
3
- Version: 1.2.2
3
+ Version: 1.3.0
4
4
  Summary: Some python useful methods
5
5
  Home-page: https://github.com/imio/imio.pyutils/
6
6
  Author: IMIO
@@ -97,6 +97,19 @@ Can be run with: `bin/python -m unittest discover`
97
97
  Changelog
98
98
  =========
99
99
 
100
+ 1.3.0 (2026-11-27)
101
+ ------------------
102
+
103
+ - Use a PEP 420 native namespace on Python 3 (setuptools 81 / Plone 6.2): the Python 3 build
104
+ no longer ships `imio/__init__.py`. Python 2.7 keeps the `pkg_resources`-style namespace.
105
+ [bsuttor]
106
+
107
+ 1.2.3 (2026-11-16)
108
+ ------------------
109
+
110
+ - Added `utils.is_true_value` to check if a value (like an environment variable) is considered as true.
111
+ [sgeulette]
112
+
100
113
  1.2.2 (2026-03-26)
101
114
  ------------------
102
115
 
@@ -13,6 +13,7 @@ from imio.pyutils.utils import append
13
13
  from imio.pyutils.utils import get_clusters
14
14
  from imio.pyutils.utils import get_ordinal_clusters
15
15
  from imio.pyutils.utils import insert_in_ordereddict
16
+ from imio.pyutils.utils import is_true_value
16
17
  from imio.pyutils.utils import iterable_as_list_of_list
17
18
  from imio.pyutils.utils import letters_sequence
18
19
  from imio.pyutils.utils import listify
@@ -280,6 +281,12 @@ class TestUtils(unittest.TestCase):
280
281
  self.assertEqual(listify(("value",)), ("value",))
281
282
  self.assertEqual(listify(("value",), force=True), ["value"])
282
283
 
284
+ def test_is_true_value(self):
285
+ for value in ("yes", "Y", "TRUE", "True", "on", "1", True, 1):
286
+ self.assertTrue(is_true_value(value), value)
287
+ for value in (None, "", "no", "false", "False", "0", "off", "2", False, 0):
288
+ self.assertFalse(is_true_value(value), value)
289
+
283
290
 
284
291
  class TestSystem(unittest.TestCase):
285
292
  """ """
@@ -166,6 +166,15 @@ def insert_in_ordereddict(dic, value, after_key="", at_position=None):
166
166
  return OrderedDict(tuples)
167
167
 
168
168
 
169
+ def is_true_value(value):
170
+ """Check if given value (string, bool, number, None) is considered as true.
171
+
172
+ :param value: the value to check, like an environment variable value
173
+ :return: True if lowercased value is in ("yes", "y", "true", "on", "1")
174
+ """
175
+ return str(value).lower() in ("yes", "y", "true", "on", "1")
176
+
177
+
169
178
  def iterable_as_list_of_list(lst, cols=1):
170
179
  """Transform an iterable as list of list.
171
180
 
@@ -311,7 +320,9 @@ def setup_logger(logger, replace=logging.StreamHandler, level=20):
311
320
  :param level: level to set
312
321
  """
313
322
  for i_c, container in enumerate((logger, logger.parent)):
314
- found = [i for i, hdl in enumerate(container.handlers) if isinstance(hdl, logging.StreamHandler)]
323
+ if container is None:
324
+ continue
325
+ found = [i for i, hdl in enumerate(container.handlers) if isinstance(hdl, replace)]
315
326
  if found:
316
327
  if i_c:
317
328
  logger.parent = container = copy.copy(logger.parent)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: imio.pyutils
3
- Version: 1.2.2
3
+ Version: 1.3.0
4
4
  Summary: Some python useful methods
5
5
  Home-page: https://github.com/imio/imio.pyutils/
6
6
  Author: IMIO
@@ -97,6 +97,19 @@ Can be run with: `bin/python -m unittest discover`
97
97
  Changelog
98
98
  =========
99
99
 
100
+ 1.3.0 (2026-11-27)
101
+ ------------------
102
+
103
+ - Use a PEP 420 native namespace on Python 3 (setuptools 81 / Plone 6.2): the Python 3 build
104
+ no longer ships `imio/__init__.py`. Python 2.7 keeps the `pkg_resources`-style namespace.
105
+ [bsuttor]
106
+
107
+ 1.2.3 (2026-11-16)
108
+ ------------------
109
+
110
+ - Added `utils.is_true_value` to check if a value (like an environment variable) is considered as true.
111
+ [sgeulette]
112
+
100
113
  1.2.2 (2026-03-26)
101
114
  ------------------
102
115
 
@@ -7,7 +7,6 @@ imio/__init__.py
7
7
  imio.pyutils.egg-info/PKG-INFO
8
8
  imio.pyutils.egg-info/SOURCES.txt
9
9
  imio.pyutils.egg-info/dependency_links.txt
10
- imio.pyutils.egg-info/namespace_packages.txt
11
10
  imio.pyutils.egg-info/not-zip-safe
12
11
  imio.pyutils.egg-info/requires.txt
13
12
  imio.pyutils.egg-info/top_level.txt
@@ -1,8 +1,26 @@
1
- from setuptools import find_packages
2
1
  from setuptools import setup
3
2
 
3
+ import sys
4
4
 
5
- version = "1.2.2"
5
+
6
+ if sys.version_info[0] < 3:
7
+ # Python 2 has no PEP 420 native namespaces: keep the pkg_resources-style
8
+ # namespace (imio/__init__.py).
9
+ from setuptools import find_packages
10
+
11
+ namespace_kwargs = {
12
+ "packages": find_packages(exclude=["ez_setup"]),
13
+ "namespace_packages": ["imio"],
14
+ }
15
+ else:
16
+ # PEP 420 native namespace: "imio" isn't listed as a package, so
17
+ # imio/__init__.py stays out of the build.
18
+ from setuptools import find_namespace_packages
19
+
20
+ namespace_kwargs = {"packages": find_namespace_packages(include=["imio.*"])}
21
+
22
+
23
+ version = "1.3.0"
6
24
 
7
25
  setup(
8
26
  name="imio.pyutils",
@@ -33,8 +51,6 @@ setup(
33
51
  # ),
34
52
  },
35
53
  license="GPL",
36
- packages=find_packages(exclude=["ez_setup"]),
37
- namespace_packages=["imio"],
38
54
  include_package_data=True,
39
55
  zip_safe=False,
40
56
  install_requires=[
@@ -49,4 +65,5 @@ setup(
49
65
  entry_points="""
50
66
  # -*- Entry points: -*-
51
67
  """,
68
+ **namespace_kwargs
52
69
  )
File without changes
File without changes
File without changes