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

3.0.0 sdist is missing tests/__init__.py #346

Closed
mgorny opened this issue Jun 8, 2023 · 6 comments · Fixed by #350
Closed

3.0.0 sdist is missing tests/__init__.py #346

mgorny opened this issue Jun 8, 2023 · 6 comments · Fixed by #350

Comments

@mgorny
Copy link
Contributor

mgorny commented Jun 8, 2023

When attempting to run the test suite from 3.0.0 sdist, I'm getting errors such as the following:

______________________________________________ ERROR collecting tests/test_commonmark.py ______________________________________________
ImportError while importing test module '/tmp/mistune-3.0.0/tests/test_commonmark.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.12/importlib/__init__.py:90: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_commonmark.py:2: in <module>
    from tests import BaseTestCase, normalize_html
E   ImportError: cannot import name 'BaseTestCase' from 'tests' (unknown location)

It seems that tests/__init__.py file is missing from the sdist for some reason.

@lepture
Copy link
Owner

lepture commented Jun 8, 2023

How do you run the test with sdist? May I know the command? So, basically, if I put a __init__.py file in tests would fix the problem. Is it correct?

@mgorny
Copy link
Contributor Author

mgorny commented Jun 8, 2023

Roughly, python -m pytest. The file was included in 2.0.5 but somehow disappeared in 3.0.0. From a quick glance, tests/fixtures are missing too.

@mgorny
Copy link
Contributor Author

mgorny commented Jun 9, 2023

I'll make a pull request in a minute.

mgorny added a commit to mgorny/mistune that referenced this issue Jun 9, 2023
Include documentation sources and test files in sdist archives,
to make them more useful to distribution packagers.

Fixes lepture#346
@mgorny
Copy link
Contributor Author

mgorny commented Jun 9, 2023

Are you planned to make another release soon or should we workaround this on our end?

@lepture
Copy link
Owner

lepture commented Jun 9, 2023

I'll make a release soon.

@mgorny
Copy link
Contributor Author

mgorny commented Jun 10, 2023

Thank you. I can confirm that 3.0.1 worked!

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

Successfully merging a pull request may close this issue.

2 participants