conan
conan copied to clipboard
[bug] __pycache__ folders are ignored even when keep_python_files is set
__pycache__ folders are ignored during the packaging even when the parameter keep_python_files is set to true.
def gather_files(folder):
file_dict = {}
symlinks = {}
keep_python = get_env("CONAN_KEEP_PYTHON_FILES", False)
for root, dirs, files in walk(folder):
dirs[:] = [d for d in dirs if d != "__pycache__"] # Avoid recursing pycache
for d in dirs:
This is already solved in Conan 2.0, and we are trying to avoid changes in 1.X unless they are regressions, backports for the migration or critical issues. It is very likely that we can break users relying on this "bug", I know it makes sense, but still means more support and work for us, and we are trying to prioritize things.
Packaging .pyc files always seemed a bit risky to me, and apparently this is not a regression, but always have been this way. What is your use case? Why packaging .pyc files in the first place?
One of our third-party SW contains .pyc files without the corresponding .py files so when Conan creates the package and removes the files it is not working.
Checking in https://github.com/conan-io/conan/pull/11828 if it could break some CI tests.
https://github.com/conan-io/conan/pull/11828 was merged, so this will be released in 1.52