Skip to content

Commit

Permalink
Don't add empty path to PYTHONPATH setting.
Browse files Browse the repository at this point in the history
Fixes #31
  • Loading branch information
mcepl committed Jun 2, 2020
1 parent 48bd863 commit 503823c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions macros/010-common-defs
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,21 @@

%pytest(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) %{lua:\
local args = rpm.expand("%**"); \
local intro = "%{python_expand PYTHONPATH=$PYTHONPATH:%{buildroot}%{$python_sitelib} PYTHONDONTWRITEBYTECODE=1 "; \
local path = ""; \
if posix.getenv("PYTHONPATH") then \
path = path .. "$PYTHONPATH:"; \
end; \
local intro = "%{python_expand PYTHONPATH=" .. path .. "%{buildroot}%{$python_sitelib} PYTHONDONTWRITEBYTECODE=1 "; \
intro = intro .. "pytest-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v " \
print(intro .. args .. "}") \
}
%pytest_arch(+abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-=) %{lua:\
local args = rpm.expand("%**"); \
local intro = "%{python_expand PYTHONPATH=$PYTHONPATH:%{buildroot}%{$python_sitearch} PYTHONDONTWRITEBYTECODE=1 "; \
local path = ""; \
if posix.getenv("PYTHONPATH") then \
path = path .. "$PYTHONPATH:"; \
end; \
local intro = "%{python_expand PYTHONPATH=" .. path .. "%{buildroot}%{$python_sitearch} PYTHONDONTWRITEBYTECODE=1 "; \
intro = intro .. "pytest-%{$python_bin_suffix} --ignore=_build.python2 --ignore=_build.python3 --ignore=_build.pypy3 -v "; \
print(intro .. args .. "}") \
}
Expand Down

0 comments on commit 503823c

Please sign in to comment.