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

11.0.0: issue with faker.sphinx module #1582

Closed
kloczek opened this issue Dec 27, 2021 · 4 comments
Closed

11.0.0: issue with faker.sphinx module #1582

kloczek opened this issue Dec 27, 2021 · 4 comments
Labels

Comments

@kloczek
Copy link
Contributor

kloczek commented Dec 27, 2021

  • Faker version: 11.0.0
  • OS: Linux/x86/64

I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

During that process using above methodology I found that sometbig odd is with faker.sphinx module.
That is not installed and is used by test suite.
Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-faker-11.0.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-faker-11.0.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -q tests --ignore tests/providers/test_ssn.py
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/faker-11.0.0, configfile: setup.cfg
plugins: Faker-11.0.0
collected 1210 items / 2 errors / 1208 selected

================================================================================== ERRORS ==================================================================================
_____________________________________________________________ ERROR collecting tests/sphinx/test_docstring.py ______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/faker-11.0.0/tests/sphinx/test_docstring.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/sphinx/test_docstring.py:8: in <module>
    from faker.sphinx.docstring import DEFAULT_SAMPLE_SIZE, DEFAULT_SEED, ProviderMethodDocstring, Sample
E   ModuleNotFoundError: No module named 'faker.sphinx'
_____________________________________________________________ ERROR collecting tests/sphinx/test_validator.py ______________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/faker-11.0.0/tests/sphinx/test_validator.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/sphinx/test_validator.py:6: in <module>
    from faker.sphinx.validator import SampleCodeValidator
E   ModuleNotFoundError: No module named 'faker.sphinx'
========================================================================= short test summary info ==========================================================================
ERROR tests/sphinx/test_docstring.py
ERROR tests/sphinx/test_validator.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================ 2 errors in 3.76s =============================================================================

That fails because faker/sphinx directory is not part of the installed resources.
If faker.sphinx module is only part of the test suite IMO it should be moved under tests/ or if it may have some general use case it should be installed.
Am I rigt?🤔

@fcurella
Copy link
Collaborator

I'm tempted to just include the module. I don't think it's going to cause any problem.

This was referenced Dec 27, 2021
@kloczek
Copy link
Contributor Author

kloczek commented Jan 5, 2022

I'm tempted to just include the module. I don't think it's going to cause any problem.

Just tested new 11.2.0 and looks like decision still has not been made :P

@github-actions
Copy link

github-actions bot commented Apr 6, 2022

This issue is stale because it has been open for 30 days with no activity.

@github-actions github-actions bot added the stale label Apr 6, 2022
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

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

No branches or pull requests

2 participants