Package init

This commit is contained in:
dogsheng 2019-11-19 11:55:38 +08:00
commit 4098e97470
4 changed files with 198 additions and 0 deletions

37
1293.patch Normal file
View File

@ -0,0 +1,37 @@
From 989e13e0514a97cd01234233dd85ebbd2805a3bb Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam@redhat.com>
Date: Wed, 9 May 2018 15:50:50 -0700
Subject: [PATCH] Skip tests that use 'xprocess' fixture when not installed
There's already a little trick to skip tests that use a fixture
called 'subprocess' when pytest-xprocess is not installed, but
many tests use the 'xprocess' fixture directly, and all of those
will still just fail. This just defines a dummy 'xprocess'
fixture as well as the dummy 'subprocess' fixture when xprocess
is not installed, so those tests as well will be skipped instead
of failing.
I noticed this when trying to run the test suite during build
of the Fedora package - xprocess isn't packaged for Fedora yet,
so there's no way to run the tests that use it unfortunately.
Signed-off-by: Adam Williamson <awilliam@redhat.com>
---
tests/conftest.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tests/conftest.py b/tests/conftest.py
index ce885777a..f4611d9d0 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -29,6 +29,10 @@
@pytest.fixture(scope='session')
def subprocess():
pytest.skip('pytest-xprocess not installed.')
+
+ @pytest.fixture(scope='session')
+ def xprocess():
+ pytest.skip('pytest-xprocess not installed.')
else:
@pytest.fixture(scope='session')
def subprocess(xprocess):

BIN
Werkzeug-0.14.1.tar.gz Normal file

Binary file not shown.

161
python-werkzeug.spec Normal file
View File

@ -0,0 +1,161 @@
%global debug_package %{nil}
%global srcname Werkzeug
Name: python-werkzeug
Summary: A comprehensive WSGI web application library
Version: 0.14.1
Release: 4
License: BSD
URL: http://werkzeug.pocoo.org/
Source0: https://files.pythonhosted.org/packages/source/W/Werkzeug/%{srcname}-%{version}.tar.gz
# Pypi version of werkzeug is missing _themes folder needed to build werkzeug sphinx docs
# See https://github.com/mitsuhiko/werkzeug/issues/761
Source1: werkzeug-sphinx-theme.tar.gz
# https://github.com/pallets/werkzeug/pull/1293
# skip tests that use a fixture called 'subprocess' when pytest-xprocess
# is not installed
Patch0: 1293.patch
%global _description\
Werkzeug is a comprehensive WSGI web application library. It began as a\
simple collection of various utilities for WSGI applications and has\
become one of the most advanced WSGI utility libraries.\
It includes:\
* An interactive debugger that allows inspecting stack traces and source\
code in the browser with an interactive interpreter for any frame in the stack.\
* A full-featured request object with objects to interact with headers,\
query args, form data, files, and cookies.\
* A response object that can wrap other WSGI applications and handle\
streaming data.\
* A routing system for matching URLs to endpoints and generating URLs for\
endpoints, with an extensible system for capturing variables from URLs.\
* HTTP utilities to handle entity tags, cache control, dates, user agents,\
cookies, files, and more.\
* A threaded WSGI server for use while developing applications locally.\
* A test client for simulating HTTP requests during testing without\
requiring running a server.\
Werkzeug is Unicode aware and doesn't enforce any dependencies. It is up\
to the developer to choose a template engine, database adapter, and even\
how to handle requests. It can be used to build all sorts of end user\
applications such as blogs, wikis, or bulletin boards.\
%description %_description
%package -n python2-werkzeug
Summary: %summary
BuildRequires: python2-devel python2-setuptools git
# For tests
BuildRequires: python2-pytest python2-hypothesis python2-requests python2-pyOpenSSL
BuildRequires: python2-greenlet python2-redis
%{?python_provide:%python_provide python2-werkzeug}
%description -n python2-werkzeug %_description
%package -n python2-werkzeug-doc
Summary: Documentation for %{name}
BuildRequires: python2-sphinx
Requires: python2-werkzeug = %{version}-%{release}
%{?python_provide:%python_provide python2-werkzeug-doc}
%description -n python2-werkzeug-doc
Documentation and examples for %{name}.
%package -n python3-werkzeug
Summary: %summary
BuildRequires: python3-devel python3-setuptools git
# For tests
BuildRequires: python3-pytest python3-hypothesis python3-requests python3-pyOpenSSL
BuildRequires: python3-greenlet python3-redis
%{?python_provide:%python_provide python3-werkzeug}
%description -n python3-werkzeug %_description
%package -n python3-werkzeug-doc
Summary: Documentation for python3-werkzeug
BuildRequires: python3-sphinx
Requires: python3-werkzeug = %{version}-%{release}
%{?python_provide:%python_provide python3-werkzeug-doc}
%description -n python3-werkzeug-doc
Documentation and examples for python3-werkzeug.
%prep
%autosetup -n %{srcname}-%{version} -p1 -Sgit
%{__sed} -i 's/\r//' LICENSE
%{__sed} -i '1d' tests/multipart/test_collect.py
tar -xf %{SOURCE1}
rm -rf %{py3dir}
cp -a . %{py3dir}
find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|'
%build
werkzeug_build() {
find examples/ -name '*.py' -executable | xargs chmod -x
find examples/ -name '*.png' -executable | xargs chmod -x
pushd docs
# Add a symlink to the dir with the Python module so that __version__ can be
# obtained therefrom.
ln -s ../werkzeug werkzeug
make html
popd
}
%py2_build
werkzeug_build
pushd %{py3dir}
%py3_build
werkzeug_build
popd
%install
werkzeug_install() {
%{__rm} -rf docs/_build/html/.buildinfo
%{__rm} -rf examples/cupoftee/db.pyc
}
%py2_install
werkzeug_install
pushd %{py3dir}
%py3_install
werkzeug_install
popd
%check
PYTHONPATH=./ py.test-2
pushd %{py3dir}
PYTHONPATH=./ py.test-3
popd
%files -n python2-werkzeug
%license LICENSE AUTHORS
%doc PKG-INFO CHANGES.rst
%{python2_sitelib}/*
%files -n python2-werkzeug-doc
%doc docs/_build/html examples
%files -n python3-werkzeug
%license LICENSE AUTHORS
%doc PKG-INFO CHANGES.rst
%{python3_sitelib}/*
%files -n python3-werkzeug-doc
%doc docs/_build/html examples
%changelog
* Mon Nov 4 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.14.1-4
- Package init

Binary file not shown.