lk-geimfari / mimesis

Mimesis is a robust data generator for Python that can produce a wide range of fake data in multiple languages.
https://mimesis.name
MIT License
4.38k stars 326 forks source link

[Integration] Pytest plugin is outdated #1473

Closed Dragon1573 closed 6 months ago

Dragon1573 commented 7 months ago

Feature request

Bundle pytest fixtures support in mimesis itself, without any other "wrapper" packages (such as pytest-mimesis)

Thesis

I'm switching from Faker to mimesis these days, as package Faker does not able to provide auto-completions when using VSCode Pylance. When I try to integrate mimesis with pytest, I find a "wrapper" package called pytest-mimesis in your documentation.

Install pytest-mimesis and mimesis itself with pdm, depencency tree shows as follows.

D:\Workloads\Playground> python --version
Python 3.12.1

D:\Workloads\Playground> pipx --version
1.4.3

D:\Workloads\Playground> pdm --version
PDM, version 2.12.2

D:\Workloads\Playground> pdm add -G check pytest-mimesis
Adding packages to check dependencies: pytest-mimesis
πŸ”’ Lock successful
Changes are written to pyproject.toml.
Synchronizing working set with resolved packages: 2 to add, 0 to update, 0 to remove

  βœ” Install pytest-mimesis 1.1.0 successful
  βœ” Install mimesis 4.1.3 successful

πŸŽ‰ All complete!

D:\Workloads\Playground> pdm list --tree '*mimesis*'
pytest-mimesis 1.1.0 [ required: >=1.1.0 ]
β”œβ”€β”€ mimesis 4.1.3 [ required: <5.0,>=4.0 ]
└── pytest 7.4.4 [ required: >=4.2 ]
    β”œβ”€β”€ colorama 0.4.6 [ required: Any ]
    β”œβ”€β”€ iniconfig 2.0.0 [ required: Any ]
    β”œβ”€β”€ packaging 23.2 [ required: Any ]
    └── pluggy 1.3.0 [ required: <2.0,>=0.12 ]

Reasoning

Package mimesis is limited to >=4.0,<5.0 because of pytest-mimesis version >=1.1.0, while the latest version of pytest-mimesis is exactly 1.1.0, released 4 years ago. The latest version of mimesis itself is 13.1.0 released no more than 24 hours ago.

Inspecting the official repository of pytest-mimesis, the package only supports Python >=3.6,<=3.8. The package has been staled for a long time and NO more commits since 2020-03-21.

If mimesis itself can provide direct support of pytest, and disconnect from pytest-mimesis, it would be great as mimesis is currently active developing.

lk-geimfari commented 7 months ago

I'll work on the new version of pytest-mimesis this weekend.

lk-geimfari commented 6 months ago

Pytest plugin will be a part of Mimesis starting from the version 14.0.0. It's already in the master branch and I'm going to update docs and the repository of the pytest-mimesis approprietly.

lk-geimfari commented 6 months ago

The last thing to be done is to support not only field, but fieldset too.

lk-geimfari commented 6 months ago

Mimesis 14.0.0 is released. I'm closing this issue.