%global pypi_name pew %bcond_without check Name: python-%{pypi_name} Version: 1.1.2 Release: 1%{?dist} Summary: Tool to manage multiple virtualenvs written in pure python License: MIT URL: https://github.com/berdario/pew Source0: https://github.com/berdario/%{pypi_name}/archive/%{version}/%{name}-%{version}.tar.gz # Add pytest marker to test requiring connection Patch0: 0001-tests-connection-marker-fix.patch BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3dist(setuptools) BuildRequires: python3dist(virtualenv-clone) >= 0.2.5 BuildRequires: python3dist(pythonz-bd) >= 1.10.2 %if %{with check} BuildRequires: python3dist(pytest) BuildRequires: python3dist(pip) %endif %global pew_desc_base \ Python Env Wrapper is a set of commands to manage multiple [virtual \ environments]. Pew can create, delete and copy your environments, using a \ single command to switch to them wherever you are, while keeping them in a \ single (configurable) location. %description %{pew_desc_base} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3dist(pythonz-bd) >= 1.10.2 Requires: python3dist(setuptools) >= 17.1 Requires: python3dist(virtualenv) >= 1.11 Requires: python3dist(virtualenv-clone) >= 0.2.5 %description -n python3-%{pypi_name} %{pew_desc_base} %package bash-completion Summary: Bash completion for Python Env Wrapper (Pew) Requires: bash-completion %description bash-completion %{summary}. %package zsh-completion Summary: Zsh completion for Python Env Wrapper (Pew) Requires: zsh %description zsh-completion %{summary}. %package fish-completion Summary: Fish completion for Python Env Wrapper (Pew) Requires: fish %description fish-completion %{summary}. %prep %autosetup -p1 -n %{pypi_name}-%{version} %build %py3_build %install %py3_install # Install shell completion scripts and remove shell_config directory install -Dpm 644 %{pypi_name}/shell_config/complete.bash \ %{buildroot}%{_datadir}/bash-completion/completions/%{pypi_name} install -Dpm 644 %{pypi_name}/shell_config/complete.zsh \ %{buildroot}%{_datadir}/zsh/site-functions/_%{pypi_name} install -Dpm 644 %{pypi_name}/shell_config/complete.fish \ %{buildroot}%{_datadir}/fish/completions/%{pypi_name}.fish rm -rf %{buildroot}%{python3_sitelib}/%{pypi_name}/shell_config/ %if %{with check} %check export PATH=$PATH:%{buildroot}%{_bindir} export PYTHONPATH=$PYTHONPATH:%{buildroot}%{python3_sitelib} py.test-3 -vv tests %endif %files -n python3-%{pypi_name} %license LICENSE %doc README.md %{_bindir}/pew %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %files bash-completion %{_datadir}/bash-completion/completions/%{pypi_name} %files zsh-completion %{_datadir}/zsh/site-functions/_%{pypi_name} %files fish-completion %{_datadir}/fish/completions/%{pypi_name}.fish %changelog * Fri Oct 13 2017 Michal Cyprian - 1.1.2-1 - Initial package.