Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ru_RU passport provider #2139

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

denisSurkov
Copy link

What does this change

Add passport_number_formats for ru_RU passport provider.
Add correct passport_owner() for ru_RU. Last name, first_name, middle_name.

What was wrong

Empty passport_number_formats with ru_RU locale gives error. passport_number_formats is empty in base PassportProvider.

How this fixes it

By adding more tests and adding ru_RU passport_number_formats.

Checklist

  • I have read the documentation about CONTRIBUTING
  • I have read the documentation about Coding style
  • I have run make lint

I have some troubles with generate_stubs. When I run this script, I get invalid proxy.pyi because of imports:

from collections import OrderedDict
from json import encoder
from typing import Any, Collection, Optional, List, Iterator, Sequence, Set, Type, Callable, Iterable, TypeVar, Dict, Literal, Tuple, Union
from uuid import UUID
from enum import Enum
from faker.typing import *
from faker.generator import Generator
from faker.providers import T
import datetime
from decimal import Decimal
from faker.providers.python import TEnum
from types import list[str] | None, faker.generator.Generator | None

Can you help me with doing it the right way? By the way, how new contributors know how to install tools like isort, black and etc? I just copy paste it from tox settings, may be this is the main problem.

@denisSurkov
Copy link
Author

>> python -V
Python 3.12.6

>> pip freeze
alabaster==0.7.16
babel==2.16.0
black==24.4.0
cachetools==5.5.0
certifi==2024.8.30
chardet==5.2.0
charset-normalizer==3.4.0
click==8.1.7
colorama==0.4.6
coverage==7.6.7
distlib==0.3.9
docutils==0.17.1
filelock==3.16.1
freezegun==0.3.15
idna==3.10
imagesize==1.4.1
iniconfig==2.0.0
isort==5.13.2
Jinja2==3.1.4
MarkupSafe==3.0.2
mypy-extensions==1.0.0
packaging==24.2
pathspec==0.12.1
pillow==11.0.0
platformdirs==4.3.6
pluggy==1.5.0
Pygments==2.18.0
pyproject-api==1.8.0
pytest==8.3.3
python-dateutil==2.9.0.post0
requests==2.32.3
setuptools==75.5.0
six==1.16.0
snowballstemmer==2.2.0
Sphinx==2.4.5
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tox==4.23.2
typing_extensions==4.12.2
UkPostcodeParser==1.1.2
urllib3==2.2.3
validators==0.34.0
virtualenv==20.27.1
xmltodict==0.14.2

@denisSurkov
Copy link
Author

@fcurella, hi

Sorry to bother you

Can you help me to understand, why running generate_stubs generates incorrect python file?

from types import list[str] | None, faker.generator.Generator | None

That's why I cannot make lint successfully

@fcurella
Copy link
Collaborator

Oh, generate_stubs needs to run on Python3.10. We need to fix that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants