Fix glob_paths to correctly include .kv files in package#1730
Fix glob_paths to correctly include .kv files in package#1730koala-sloth wants to merge 1 commit intokivymd:masterfrom
Conversation
- Modified glob_paths function to properly identify files with given extensions - Now correctly traverses subdirectories and returns relative file paths - Fixes issue where .kv files were missing from pip installations - Also affects .pot and .po files, ensuring all necessary files are included
|
I also found kv files missing after doing an iOS build with kivy_ios. To counter that a friend of mine made a recipe for KivyMD in kivy_ios; # pure-python package, this can be removed when we'll support any python package
from kivy_ios.toolchain import PythonRecipe, shprint
from os.path import join
import sh
import os
class KivyMDRecipe(PythonRecipe):
version = "2.0.1"
url = "https://github.com/kivymd/KivyMD/archive/master.zip"
depends = ["python"]
def install(self):
plat = list(self.platforms_to_build)[0]
build_dir = self.get_build_dir(plat)
os.chdir(build_dir)
hostpython = sh.Command(self.ctx.hostpython)
build_env = plat.get_env()
dest_dir = join(self.ctx.dist_dir, "root", "python3")
build_env['PYTHONPATH'] = self.ctx.site_packages_dir
shprint(hostpython, "setup.py", "install", "--prefix", dest_dir, _env=build_env)
recipe = KivyMDRecipe()For now we are forcing it to master version by default as its not yet released. There is no pull made for this as it's expected to be resolved in the library itself. |
I've built several iOS apps and never seen the bug you're talking about. |
|
He told me this (macOS 15). We used a custom fork of kivy_ios to be compatible with buildozer. The error was same as above described. If that's not an issue it's awesome. 👍 |
I figured it out. He bundled it explicitly inside the app directory. It only happens in this case. Thanks for clarification. |
Description of the problem:
The glob_paths function in setup.py was not correctly identifying .kv files (and potentially .pot and .po files) in the KivyMD project structure. This led to these files being excluded from the built package, causing issues for users who installed KivyMD via pip.
Algorithm of actions that leads to the problem:
Reproducing the problem:
Screenshots of the problem:
This is text-only, part of building python package, screenshots not needed.
Description of Changes:
We modified the glob_paths function in setup.py to correctly identify files with the given extension in all subdirectories of the 'kivymd' folder. The key changes were:
Code for testing new changes: