Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-Faker for openSUSE:Factory checked in at 2023-02-19 18:18:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Faker (Old) and /work/SRC/openSUSE:Factory/.python-Faker.new.22824 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Faker" Sun Feb 19 18:18:45 2023 rev:38 rq:1066268 version:17.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Faker/python-Faker.changes 2023-02-11 21:56:03.579150465 +0100 +++ /work/SRC/openSUSE:Factory/.python-Faker.new.22824/python-Faker.changes 2023-02-19 18:18:47.765417794 +0100 @@ -1,0 +2,7 @@ +Thu Feb 16 21:06:46 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 17.0.0: + * Remove deprecated placeimg image provider. Thanks @Wonskcalb. + * Add `truth_probability` argument to `pybool` generator. + +------------------------------------------------------------------- Old: ---- Faker-16.8.1.tar.gz New: ---- Faker-17.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Faker.spec ++++++ --- /var/tmp/diff_new_pack.5yMDKZ/_old 2023-02-19 18:18:48.261420946 +0100 +++ /var/tmp/diff_new_pack.5yMDKZ/_new 2023-02-19 18:18:48.265420971 +0100 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python3-%{**}} %global skip_python2 1 Name: python-Faker -Version: 16.8.1 +Version: 17.0.0 Release: 0 Summary: Python package that generates fake data License: MIT ++++++ Faker-16.8.1.tar.gz -> Faker-17.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-16.8.1/CHANGELOG.md new/Faker-17.0.0/CHANGELOG.md --- old/Faker-16.8.1/CHANGELOG.md 2023-02-09 22:13:44.000000000 +0100 +++ new/Faker-17.0.0/CHANGELOG.md 2023-02-13 18:12:33.000000000 +0100 @@ -1,5 +1,14 @@ ## Changelog +### [v17.0.0 - 2023-02-13](https://github.com/joke2k/faker/compare/v16.9.0...v17.0.0) + +* Remove deprecated placeimg image provider. Thanks @Wonskcalb. + + +### [v16.9.0 - 2023-02-13](https://github.com/joke2k/faker/compare/v16.8.1...v16.9.0) + +* Add `truth_probability` argument to `pybool` generator. Thanks @Kolyunya. + ### [v16.8.1 - 2023-02-09](https://github.com/joke2k/faker/compare/v16.8.0...v16.8.1) * Sort and add new Arabic words in `ar_AA` and `ar_PS`. Thanks @alfawal. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-16.8.1/Faker.egg-info/PKG-INFO new/Faker-17.0.0/Faker.egg-info/PKG-INFO --- old/Faker-16.8.1/Faker.egg-info/PKG-INFO 2023-02-09 22:14:38.000000000 +0100 +++ new/Faker-17.0.0/Faker.egg-info/PKG-INFO 2023-02-13 18:19:48.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Faker -Version: 16.8.1 +Version: 17.0.0 Summary: Faker is a Python package that generates fake data for you. Home-page: https://github.com/joke2k/faker Author: joke2k diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-16.8.1/PKG-INFO new/Faker-17.0.0/PKG-INFO --- old/Faker-16.8.1/PKG-INFO 2023-02-09 22:14:42.820333500 +0100 +++ new/Faker-17.0.0/PKG-INFO 2023-02-13 18:19:51.769714000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Faker -Version: 16.8.1 +Version: 17.0.0 Summary: Faker is a Python package that generates fake data for you. Home-page: https://github.com/joke2k/faker Author: joke2k diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-16.8.1/VERSION new/Faker-17.0.0/VERSION --- old/Faker-16.8.1/VERSION 2023-02-09 22:14:12.000000000 +0100 +++ new/Faker-17.0.0/VERSION 2023-02-13 18:18:46.000000000 +0100 @@ -1 +1 @@ -16.8.1 +17.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-16.8.1/faker/__init__.py new/Faker-17.0.0/faker/__init__.py --- old/Faker-16.8.1/faker/__init__.py 2023-02-09 22:14:12.000000000 +0100 +++ new/Faker-17.0.0/faker/__init__.py 2023-02-13 18:18:46.000000000 +0100 @@ -2,6 +2,6 @@ from faker.generator import Generator from faker.proxy import Faker -VERSION = "16.8.1" +VERSION = "17.0.0" __all__ = ("Factory", "Generator", "Faker") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-16.8.1/faker/providers/internet/__init__.py new/Faker-17.0.0/faker/providers/internet/__init__.py --- old/Faker-16.8.1/faker/providers/internet/__init__.py 2022-11-30 20:10:46.000000000 +0100 +++ new/Faker-17.0.0/faker/providers/internet/__init__.py 2023-02-13 18:10:38.000000000 +0100 @@ -157,7 +157,6 @@ "https://picsum.photos/{width}/{height}", "https://dummyimage.com/{width}x{height}", "https://placekitten.com/{width}/{height}", - "https://placeimg.com/{width}/{height}/any", ) replacements: Tuple[Tuple[str, str], ...] = () diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-16.8.1/faker/providers/python/__init__.py new/Faker-17.0.0/faker/providers/python/__init__.py --- old/Faker-16.8.1/faker/providers/python/__init__.py 2023-02-09 21:33:45.000000000 +0100 +++ new/Faker-17.0.0/faker/providers/python/__init__.py 2023-02-13 18:07:38.000000000 +0100 @@ -55,8 +55,14 @@ allowed_types = () return tuple(value_types) + tuple(allowed_types) - def pybool(self) -> bool: - return self.random_int(0, 1) == 1 + def pybool(self, truth_probability: int = 50) -> bool: + """ + Generates a random boolean, optionally biased towards `True` or `False`. + + :truth_probability: Probability of generating a `True` value. + :return: Random boolean. + """ + return self.random_int(1, 100) <= truth_probability def pystr( self, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-16.8.1/tests/providers/test_python.py new/Faker-17.0.0/tests/providers/test_python.py --- old/Faker-16.8.1/tests/providers/test_python.py 2023-02-09 21:33:45.000000000 +0100 +++ new/Faker-17.0.0/tests/providers/test_python.py 2023-02-13 18:07:38.000000000 +0100 @@ -468,10 +468,46 @@ def setUp(self): self.factory = Faker() - def test_pybool(self): + def test_pybool_return_type(self): some_bool = self.factory.pybool() assert isinstance(some_bool, bool) + def __test_pybool_truth_probability( + self, + truth_probability: int, + deviation_threshold: int = 5, + iterations: int = 999, + ): + truth_count_expected = iterations * truth_probability / 100 + truth_count_actual = 0 + + for iteration in range(iterations): + boolean = self.factory.pybool(truth_probability=truth_probability) + assert isinstance(boolean, bool) + if boolean is True: + truth_count_actual += 1 + + deviation_absolute = abs(truth_count_expected - truth_count_actual) + deviation_percentage = deviation_absolute / iterations * 100 + + # Increase `deviation_threshold` value in case this assertion becomes flaky. + assert deviation_percentage <= deviation_threshold + + def test_pybool_truth_probability_zero(self): + self.__test_pybool_truth_probability(0, deviation_threshold=0) + + def test_pybool_truth_probability_twenty_five(self): + self.__test_pybool_truth_probability(25) + + def test_pybool_truth_probability_fifty(self): + self.__test_pybool_truth_probability(50) + + def test_pybool_truth_probability_seventy_five(self): + self.__test_pybool_truth_probability(75) + + def test_pybool_truth_probability_hundred(self): + self.__test_pybool_truth_probability(100, deviation_threshold=0) + def test_pytuple(self): with warnings.catch_warnings(record=True) as w: some_tuple = Faker().pytuple()