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

spec: add Makefile & spec #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ var/
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
Expand Down
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.PHONY: build install dist sources srpm clean

PYTHON := python
PROGRAM := pytest-asyncio
PACKAGE := python-$(PROGRAM)
VERSION := $(shell sed -n s/[[:space:]]*Version:[[:space:]]*//p $(PACKAGE).spec)


build:
$(PYTHON) setup.py build

install:
$(PYTHON) setup.py install --skip-build

dist: clean
$(PYTHON) setup.py sdist

sources: clean
@git archive --format=tar --prefix="$(PROGRAM)-$(VERSION)/" \
$(shell git rev-parse --verify HEAD) | gzip > "$(PROGRAM)-$(VERSION).tar.gz"

srpm: sources
rpmbuild -bs --define "_sourcedir $(CURDIR)" \
--define "_srcrpmdir $(CURDIR)" $(PACKAGE).spec

clean:
@rm -rf build dist $(PROGRAM).egg-info $(PROGRAM)-*.tar.gz *.egg *.src.rpm
58 changes: 58 additions & 0 deletions python-pytest-asyncio.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
%define pkgname pytest-asyncio
%global sum Pytest support for asyncio
%global descr Pytest support for asyncio

Name: python-%{pkgname}
Summary: %{sum}
Version: 0.9.0
Release: CROC1%{?dist}
License: Apache License, Version 2.0

Group: Development/Testing
URL: https://github.com/pytest-dev/pytest-asyncio
Source0: %{pkgname}-%{version}.tar.gz


BuildArch: noarch

%description
%{descr}


%package -n python%{python3_pkgversion}-%{pkgname}
Summary: %{sum}
BuildRequires: python%{python3_pkgversion}-devel
BuildRequires: python%{python3_pkgversion}-setuptools

%description -n python%{python3_pkgversion}-%{pkgname}
%{descr}


%prep
%setup -q -n %{pkgname}-%{version}


%build
%py3_build


%install
[ %buildroot = "/" ] || rm -rf %buildroot

%py3_install



%clean
rm -rf %{buildroot}


%files -n python%{python3_pkgversion}-%{pkgname}
%defattr(-,root,root,-)
%{python3_sitelib}/*

%doc README.rst LICENSE

%changelog
* Thu Dec 03 2020 Andrey Kulaev <[email protected]> 0.9.0-1
- Initial build.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def find_version():
packages=find_packages(),
url="https://github.com/pytest-dev/pytest-asyncio",
license="Apache 2.0",
author="Tin Tvrtković",
author="Tin Tvrtkovic",
author_email="[email protected]",
description="Pytest support for asyncio.",
long_description=Path(__file__).parent.joinpath("README.rst").read_text(),
Expand Down