Skip to content

Comments

Update __init__.py to fix #1982#1983

Merged
AndreMiras merged 3 commits intokivy:masterfrom
nicolashainaux:patch-1
Nov 24, 2025
Merged

Update __init__.py to fix #1982#1983
AndreMiras merged 3 commits intokivy:masterfrom
nicolashainaux:patch-1

Conversation

@nicolashainaux
Copy link
Contributor

Problem is described here: #1982

AndreMiras
AndreMiras previously approved these changes Nov 12, 2025
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thanks for investigating and fixing.
Having tests would be great too, do you want to give a stab at it?

@nicolashainaux
Copy link
Contributor Author

Yes, I think I can try to add this too.

I see your tests use the standard unit test library from python; and temporary files.

If I understand your code and tests organization correctly, you'd suggest to add a test of Buildozer._copy_application_sources() to TestBuildozer class in buildozer/tests/test_buildozer.py?

@AndreMiras
Copy link
Member

Yes, I think I can try to add this too.

I see your tests use the standard unit test library from python; and temporary files.

If I understand your code and tests organization correctly, you'd suggest to add a test of Buildozer._copy_application_sources() to TestBuildozer class in buildozer/tests/test_buildozer.py?

Yes that seems right to me, thanks for giving it a try

@nicolashainaux
Copy link
Contributor Author

OK, I need a few days and give you a proposal.

@nicolashainaux
Copy link
Contributor Author

nicolashainaux commented Nov 16, 2025

Finally, as your tests didn't seem to cover Buidlozer._copy_application_sources at all, I have included tests to cover more of its code (not only the hidden parent case), though I am not 100% sure it covers all cases.

In order to make changes in a cleaner way, I have gathered the tests of Buidlozer._copy_application_sources in a new dedicated class TestCopyApplicationSources(unittest.TestCase) with its own setUp, tearDown and helpers. So I think it's clean, clear and does not interfere with existing tests.

It looks good, on my local linux I get this (I only check python 3.11 here):

(buildozer-py311) buildozer [patch-1 ↑·1|✔] $ pytest -vv tests/test_buildozer.py
================================================================================== test session starts ==================================================================================
platform linux -- Python 3.11.13, pytest-9.0.1, pluggy-1.6.0 -- /home/nico/dev/.venv/buildozer-py311/bin/python
cachedir: .pytest_cache
rootdir: /home/nico/dev/buildozer
collected 14 items                                                                                                                                                                      

tests/test_buildozer.py::TestBuildozer::test_android_ant_path PASSED                                                                                                              [  7%]
tests/test_buildozer.py::TestBuildozer::test_buildozer_base PASSED                                                                                                                [ 14%]
tests/test_buildozer.py::TestBuildozer::test_buildozer_help PASSED                                                                                                                [ 21%]
tests/test_buildozer.py::TestBuildozer::test_buildozer_read_spec PASSED                                                                                                           [ 28%]
tests/test_buildozer.py::TestBuildozer::test_log_get_set PASSED                                                                                                                   [ 35%]
tests/test_buildozer.py::TestBuildozer::test_p4a_recommended_android_ndk_error PASSED                                                                                             [ 42%]
tests/test_buildozer.py::TestBuildozer::test_p4a_recommended_android_ndk_found PASSED                                                                                             [ 50%]
tests/test_buildozer.py::TestBuildozer::test_p4a_recommended_ndk_version_default_value PASSED                                                                                     [ 57%]
tests/test_buildozer.py::TestBuildozer::test_run_command_unknown PASSED                                                                                                           [ 64%]
tests/test_buildozer.py::TestCopyApplicationSources::test_exclude_dirs_filter PASSED                                                                                              [ 71%]
tests/test_buildozer.py::TestCopyApplicationSources::test_exclude_patterns PASSED                                                                                                 [ 78%]
tests/test_buildozer.py::TestCopyApplicationSources::test_ignore_hidden_files_and_directories_in_source PASSED                                                                    [ 85%]
tests/test_buildozer.py::TestCopyApplicationSources::test_include_extensions_filter PASSED                                                                                        [ 92%]
tests/test_buildozer.py::TestCopyApplicationSources::test_source_dir_with_hidden_parent PASSED                                                                                    [100%]

================================================================================== 14 passed in 0.16s ===================================================================================
(buildozer-py311) buildozer [patch-1 ↑·1|✔] $

So I push this and let you check it.

kuzeyron
kuzeyron previously approved these changes Nov 17, 2025
Comment on lines 306 to 310
# def create_dir(self, relpath):
# """Helper to create a directory in source_dir."""
# dirpath = os.path.join(self.source_dir, relpath)
# os.makedirs(dirpath, exist_ok=True)
# return dirpath
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove this commented out code completely

AndreMiras
AndreMiras previously approved these changes Nov 23, 2025
Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for taking a stab at it.
I didn't expect integration tests to be honest, but that also works I guess.
Let's maybe just remove the unused commented out code and I think we're good for merging.
Thanks again 🙇

@nicolashainaux nicolashainaux dismissed stale reviews from AndreMiras and kuzeyron via 2263844 November 24, 2025 14:15
@nicolashainaux
Copy link
Contributor Author

OK, I added a commit to remove the commented out code!
Kivy and buildozer helped me to build a modest app, so I am happy if I can help too ☺️

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the follow up.
Merging 🚀

@AndreMiras AndreMiras merged commit 1c31049 into kivy:master Nov 24, 2025
26 checks passed
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 this pull request may close these issues.

3 participants