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 2024-01-07 21:39:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Faker (Old) and /work/SRC/openSUSE:Factory/.python-Faker.new.28375 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Faker" Sun Jan 7 21:39:11 2024 rev:48 rq:1137275 version:22.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-Faker/python-Faker.changes 2023-12-17 21:29:14.654871552 +0100 +++ /work/SRC/openSUSE:Factory/.python-Faker.new.28375/python-Faker.changes 2024-01-07 21:39:16.049760603 +0100 @@ -1,0 +2,10 @@ +Sat Jan 6 17:12:29 UTC 2024 - Dirk Müller <dmuel...@suse.com> + +- update to 22.0.0: + * Remove dot from `file_name` when `extention` is the empty + string. + * Allow extension in `file_path` to take a list of allowed + extensions, or empty for "no extension". + * Fix typo in `ru_RU` company names. + +------------------------------------------------------------------- Old: ---- Faker-21.0.0.tar.gz New: ---- Faker-22.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Faker.spec ++++++ --- /var/tmp/diff_new_pack.tb7JJI/_old 2024-01-07 21:39:16.669783156 +0100 +++ /var/tmp/diff_new_pack.tb7JJI/_new 2024-01-07 21:39:16.669783156 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-Faker # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?sle15_python_module_pythons} Name: python-Faker -Version: 21.0.0 +Version: 22.0.0 Release: 0 Summary: Python package that generates fake data License: MIT ++++++ Faker-21.0.0.tar.gz -> Faker-22.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-21.0.0/CHANGELOG.md new/Faker-22.0.0/CHANGELOG.md --- old/Faker-21.0.0/CHANGELOG.md 2023-12-13 17:58:59.000000000 +0100 +++ new/Faker-22.0.0/CHANGELOG.md 2023-12-29 17:13:37.000000000 +0100 @@ -1,5 +1,14 @@ ## Changelog +### [v22.0.0 - 2023-12-29](https://github.com/joke2k/faker/compare/v21.0.1...v22.0.0) + +* Remove dot from `file_name` when `extention` is the empty string. Thanks @gotofritz +* Allow extension in `file_path` to take a list of allowed extensions, or empty for "no extension". Thanks @gotofritz + +### [v21.0.1 - 2023-12-29](https://github.com/joke2k/faker/compare/v21.0.0...v21.0.1) + +* Fix typo in `ru_RU` company names. Thanks @scalar438. + ### [v21.0.0 - 2023-12-13](https://github.com/joke2k/faker/compare/v20.1.0...v21.0.0) * Fix: random sign in `pyfloat` when `positive=False`. Thanks @viraj-s15. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-21.0.0/Faker.egg-info/PKG-INFO new/Faker-22.0.0/Faker.egg-info/PKG-INFO --- old/Faker-21.0.0/Faker.egg-info/PKG-INFO 2023-12-13 17:59:34.000000000 +0100 +++ new/Faker-22.0.0/Faker.egg-info/PKG-INFO 2023-12-29 17:14:00.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Faker -Version: 21.0.0 +Version: 22.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-21.0.0/PKG-INFO new/Faker-22.0.0/PKG-INFO --- old/Faker-21.0.0/PKG-INFO 2023-12-13 17:59:35.507227700 +0100 +++ new/Faker-22.0.0/PKG-INFO 2023-12-29 17:14:01.770661000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: Faker -Version: 21.0.0 +Version: 22.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-21.0.0/VERSION new/Faker-22.0.0/VERSION --- old/Faker-21.0.0/VERSION 2023-12-13 17:59:23.000000000 +0100 +++ new/Faker-22.0.0/VERSION 2023-12-29 17:13:52.000000000 +0100 @@ -1 +1 @@ -21.0.0 +22.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-21.0.0/faker/__init__.py new/Faker-22.0.0/faker/__init__.py --- old/Faker-21.0.0/faker/__init__.py 2023-12-13 17:59:23.000000000 +0100 +++ new/Faker-22.0.0/faker/__init__.py 2023-12-29 17:13:52.000000000 +0100 @@ -2,6 +2,6 @@ from faker.generator import Generator from faker.proxy import Faker -VERSION = "21.0.0" +VERSION = "22.0.0" __all__ = ("Factory", "Generator", "Faker") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-21.0.0/faker/providers/company/ru_RU/__init__.py new/Faker-22.0.0/faker/providers/company/ru_RU/__init__.py --- old/Faker-21.0.0/faker/providers/company/ru_RU/__init__.py 2022-10-24 20:39:44.000000000 +0200 +++ new/Faker-22.0.0/faker/providers/company/ru_RU/__init__.py 2023-12-29 16:56:51.000000000 +0100 @@ -1048,7 +1048,7 @@ "иниÑиаÑив", "инÑеÑнеÑ-компаний", "инÑеÑнеÑ-магазинов", - "инÑеÑнеÑ-пÑодавÑоÑ", + "инÑеÑнеÑ-пÑодавÑов", "инÑеÑнеÑ-ÑÑлÑг", "инÑеÑÑейÑов", "инÑопоÑÑедников", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-21.0.0/faker/providers/file/__init__.py new/Faker-22.0.0/faker/providers/file/__init__.py --- old/Faker-21.0.0/faker/providers/file/__init__.py 2022-11-04 16:59:35.000000000 +0100 +++ new/Faker-22.0.0/faker/providers/file/__init__.py 2023-12-29 17:00:53.000000000 +0100 @@ -1,7 +1,7 @@ import string from collections import OrderedDict -from typing import Dict, Optional +from typing import Dict, Optional, Sequence, Union from .. import BaseProvider, ElementsType @@ -223,21 +223,24 @@ def file_name(self, category: Optional[str] = None, extension: Optional[str] = None) -> str: """Generate a random file name with extension. - If ``extension`` is ``None``, a random extension will be created under - the hood using |file_extension| with the specified ``category``. If a - value for ``extension`` is provided, the value will be used instead, - and ``category`` will be ignored. The actual name part itself is - generated using |word|. + If ``extension`` is ``None``, a random extension will be created + under the hood using |file_extension| with the specified + ``category``. If a value for ``extension`` is provided, the + value will be used instead, and ``category`` will be ignored. + The actual name part itself is generated using |word|. If + extension is an empty string then no extension will be added, + and file_name will be the same as |word|. :sample: size=10 :sample: category='audio' :sample: extension='abcdef' :sample: category='audio', extension='abcdef' + :sample: extension='' """ if extension is None: extension = self.file_extension(category) filename: str = self.generator.word() - return f"{filename}.{extension}" + return f"{filename}.{extension}" if extension else filename def file_extension(self, category: Optional[str] = None) -> str: """Generate a file extension under the specified ``category``. @@ -257,23 +260,39 @@ self, depth: int = 1, category: Optional[str] = None, - extension: Optional[str] = None, + extension: Optional[Union[str, Sequence[str]]] = None, absolute: Optional[bool] = True, ) -> str: """Generate an pathname to a file. - This method uses |file_name| under the hood to generate the file name - itself, and ``depth`` controls the depth of the directory path, and - |word| is used under the hood to generate the different directory names. - - If ``absolute`` is ``True`` (default), the generated path starts with - ``/`` and is absolute. Otherwise, the generated path is relative. + This method uses |file_name| under the hood to generate the file + name itself, and ``depth`` controls the depth of the directory + path, and |word| is used under the hood to generate the + different directory names. + + If ``absolute`` is ``True`` (default), the generated path starts + with ``/`` and is absolute. Otherwise, the generated path is + relative. + + If used, ``extension`` can be either a string, forcing that + extension, a sequence of strings (one will be picked at random), + or an empty sequence (the path will have no extension). Default + behaviour is the same as |file_name| :sample: size=10 :sample: depth=3 :sample: depth=5, category='video' :sample: depth=5, category='video', extension='abcdef' + :sample: extension=[] + :sample: extension='' + :sample: extension=["a", "bc", "def"] """ + if extension is not None and not isinstance(extension, str): + if len(extension): + extension = self.random_element(extension) + else: + extension = "" + file: str = self.file_name(category, extension) path: str = f"/{file}" for _ in range(0, depth): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Faker-21.0.0/tests/providers/test_file.py new/Faker-22.0.0/tests/providers/test_file.py --- old/Faker-21.0.0/tests/providers/test_file.py 2022-05-25 16:07:19.000000000 +0200 +++ new/Faker-22.0.0/tests/providers/test_file.py 2023-12-29 17:00:53.000000000 +0100 @@ -11,6 +11,21 @@ self.fake = Faker() Faker.seed(0) + def test_file_name(self): + for _ in range(100): + file_name = self.fake.file_name() + assert re.search(r"\w+\.\w+", file_name) + file_name = self.fake.file_name(extension=None) + assert re.search(r"\w+\.\w+", file_name) + file_name = self.fake.file_name(extension="pdf") + assert re.search(r"\w+\.pdf$", file_name) + file_name = self.fake.file_name(category="image") + assert re.search(r"\w+\.(bmp|gif|jpeg|jpg|png|tiff)$", file_name) + file_name = self.fake.file_name(category="image", extension="abcdef") + assert re.search(r"\w+\.abcdef$", file_name) + file_name = self.fake.file_name(extension="") + assert re.search(r"\w+$", file_name) + def test_file_path(self): for _ in range(100): file_path = self.fake.file_path() @@ -20,9 +35,17 @@ file_path = self.fake.file_path(depth=3) assert re.search(r"\/\w+\/\w+\/\w+\.\w+", file_path) file_path = self.fake.file_path(extension="pdf") - assert re.search(r"\/\w+\/\w+\.pdf", file_path) + assert re.search(r"\/\w+\/\w+\.pdf$", file_path) + file_path = self.fake.file_path(extension=["a", "bc", "def", "ghij", "klmno"]) + assert re.search(r"\/\w+\/\w+\.(a|bc|def|ghij|klmno)$", file_path) + file_path = self.fake.file_path(extension=None) + assert re.search(r"\/\w+\/\w+\.\w+", file_path) + file_path = self.fake.file_path(extension="") + assert re.search(r"\/\w+\/\w+$", file_path) + file_path = self.fake.file_path(extension=[]) + assert re.search(r"\/\w+\/\w+$", file_path) file_path = self.fake.file_path(category="image") - assert re.search(r"\/\w+\/\w+\.(bmp|gif|jpeg|jpg|png|tiff)", file_path) + assert re.search(r"\/\w+\/\w+\.(bmp|gif|jpeg|jpg|png|tiff)$", file_path) def test_unix_device(self): reg_device = re.compile(r"^/dev/(vd|sd|xvd)[a-z]$")