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

add python_compileall macro and use it in pyproject_install #60

Merged
merged 5 commits into from
Oct 16, 2020

Conversation

bnavigator
Copy link
Collaborator

@bnavigator bnavigator commented Oct 8, 2020

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
macros/010-common-defs Outdated Show resolved Hide resolved
Comment on lines +163 to +172
%python_compileall \
%{python_expand for d in %{buildroot}%{$python_sitelib} %{buildroot}%{$python_sitearch}; do \
if [ -d $d ]; then \
find $d -name '*.pyc' -delete; \
$python -m compileall $d; \
$python -O -m compileall $d; \
fi; \
done \
} \
%{nil}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
%python_compileall \
%{python_expand for d in %{buildroot}%{$python_sitelib} %{buildroot}%{$python_sitearch}; do \
if [ -d $d ]; then \
find $d -name '*.pyc' -delete; \
$python -m compileall $d; \
$python -O -m compileall $d; \
fi; \
done \
} \
%{nil}
%python_compileall() \
%{python_expand # \
%if %# >= 1 \
dirs="%{**}" \
%else
dirs="%{buildroot}%{$python_sitelib} %{buildroot}%{$python_sitearch}"
%endif \
for d in $dirs; do \
if [ -d "$d" ]; then \
find "$d" -name '*.pyc' -delete; \
$python -m compileall "$d"; \
$python -O -m compileall "$d"; \
fi; \
done \
} \
%{nil}

This would add optionally providing the directories (But wouldn't work with %{$python_*} because of the inner expand.

@mcepl mcepl merged commit 1b806a3 into openSUSE:master Oct 16, 2020
@mcepl
Copy link
Contributor

mcepl commented Oct 16, 2020

Hmm, something’s wrong on Leap 15 ... https://is.gd/xyc8l7.

@bnavigator
Copy link
Collaborator Author

Fixed in #63. Sorry.

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