diff --git a/patsy-error-doc.patch b/patsy-error-doc.patch new file mode 100644 index 0000000..946f6e6 --- /dev/null +++ b/patsy-error-doc.patch @@ -0,0 +1,92 @@ +diff -Naur patsy-0.5.0.orig/doc/library-developers.rst patsy-0.5.0/doc/library-developers.rst +--- patsy-0.5.0.orig/doc/library-developers.rst 2015-11-09 06:05:25.000000000 +0100 ++++ patsy-0.5.0/doc/library-developers.rst 2018-10-06 12:05:36.394522540 +0200 +@@ -120,6 +120,7 @@ + exec(f.read()) + + .. ipython:: python ++ :okwarning: + + from patsy import demo_data + data = demo_data("x", "y", "a") +diff -Naur patsy-0.5.0/doc/quickstart.rst patsy-0.5.0.2/doc/quickstart.rst +--- patsy-0.5.0/doc/quickstart.rst 2014-04-29 02:16:03.000000000 +0200 ++++ patsy-0.5.0.2/doc/quickstart.rst 2018-10-06 12:17:20.869923224 +0200 +@@ -43,6 +43,7 @@ + like :func:`np.linalg.lstsq`: + + .. ipython:: python ++ :okwarning: + + outcome, predictors = dmatrices("y ~ x1 + x2", data) + betas = np.linalg.lstsq(predictors, outcome)[0].ravel() +diff -Naur patsy-0.5.0/doc/spline-regression.rst patsy-0.5.0.2/doc/spline-regression.rst +--- patsy-0.5.0/doc/spline-regression.rst 2015-11-09 06:01:53.000000000 +0100 ++++ patsy-0.5.0.2/doc/spline-regression.rst 2018-10-06 12:25:41.462326090 +0200 +@@ -162,6 +162,7 @@ + marginal spline bases patterns can be observed on the x and y contour projections: + + .. ipython:: ++ :okwarning: + + In [10]: from matplotlib import cm + +diff -Naur patsy-0.5.0/doc/stateful-transforms.rst patsy-0.5.0.2/doc/stateful-transforms.rst +--- patsy-0.5.0/doc/stateful-transforms.rst 2015-11-09 06:00:29.000000000 +0100 ++++ patsy-0.5.0.2/doc/stateful-transforms.rst 2018-10-06 12:34:46.687480063 +0200 +@@ -35,6 +35,7 @@ + Now we can build a design matrix and see what we get: + + .. ipython:: python ++ :okexcept: + + mat = dmatrix("naive_center(x)", data) + mat +@@ -49,6 +50,7 @@ + transformation, like so: + + .. ipython:: python ++ :okexcept: + + new_data = {"x": [5, 6, 7, 8]} + # Broken! +@@ -76,6 +78,7 @@ + way: + + .. ipython:: python ++ :okexcept: + + fixed_mat = dmatrix("center(x)", data) + fixed_mat +@@ -83,6 +86,7 @@ + But if we then feed in our new data, we also get out the correct result: + + .. ipython:: python ++ :okexcept: + + # Correct! + build_design_matrices([fixed_mat.design_info], new_data)[0] +@@ -97,6 +101,7 @@ + just similar enough for you to miss the problem until it's too late.) + + .. ipython:: python ++ :okexcept: + + data_chunked = [{"x": data["x"][:2]}, + {"x": data["x"][2:]}] +@@ -108,6 +113,7 @@ + But if we use the proper stateful transform, this just works: + + .. ipython:: python ++ :okexcept: + + dinfo = incr_dbuilder("center(x)", lambda: iter(data_chunked)) + # Correct! +@@ -133,6 +139,7 @@ + for prediction as well: + + .. ipython:: python ++ :okexcept: + + # Correct! + build_design_matrices([dinfo], new_data)[0] diff --git a/patsy-ipython-doc.patch b/patsy-ipython-doc.patch deleted file mode 100644 index dff6991..0000000 --- a/patsy-ipython-doc.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff -ur patsy-0.2.1/doc/conf.py patsy-0.2.1.doc/doc/conf.py ---- patsy-0.2.1/doc/conf.py 2014-06-17 00:33:42.062390010 +0200 -+++ patsy-0.2.1.doc/doc/conf.py 2014-06-17 00:35:39.727331116 +0200 -@@ -60,7 +60,8 @@ - # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. - extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.pngmath', - 'sphinx.ext.intersphinx', -- 'ipython_directive', 'ipython_console_highlighting', -+ 'IPython.sphinxext.ipython_directive', -+ 'IPython.sphinxext.ipython_console_highlighting' - ] - - # Add any paths that contain templates here, relative to this directory. diff --git a/patsy-nopandas.patch b/patsy-nopandas.patch deleted file mode 100644 index 0cdd03a..0000000 --- a/patsy-nopandas.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff -ur patsy-0.2.1/patsy/test_highlevel.py patsy-0.2.1.nopandas/patsy/test_highlevel.py ---- patsy-0.2.1/patsy/test_highlevel.py 2014-01-09 22:45:10.795234808 +0100 -+++ patsy-0.2.1.nopandas/patsy/test_highlevel.py 2014-01-09 22:46:42.958974829 +0100 -@@ -645,7 +645,12 @@ - def test_dmatrix_NA_action(): - data = {"x": [1, 2, 3, np.nan], "y": [np.nan, 20, 30, 40]} - -- for return_type in ["matrix", "dataframe"]: -+ return_types = ["matrix"] -+ -+ if have_pandas: -+ return_types.append("dataframe") -+ -+ for return_type in return_types: - mat = dmatrix("x + y", data=data, return_type=return_type) - assert np.array_equal(mat, [[1, 2, 20], - [1, 3, 30]]) diff --git a/python-patsy.spec b/python-patsy.spec index 05f7628..3dbc64e 100644 --- a/python-patsy.spec +++ b/python-patsy.spec @@ -8,7 +8,7 @@ the 'formula' mini-language used in R and S. Name: python-%{srcname} Version: 0.5.0 -Release: 4%{?dist} +Release: 5%{?dist} Summary: %{summary} # All code is under BSD except patsy.compat that is under Python # See LICENSE.txt for details @@ -16,6 +16,7 @@ License: BSD and Python URL: https://github.com/pydata/patsy Source0: https://pypi.io/packages/source/p/patsy/patsy-%{version}.tar.gz +Patch0: patsy-error-doc.patch BuildArch: noarch BuildRequires: python3-devel @@ -31,6 +32,7 @@ BuildRequires: python3-numpy # For the docs BuildRequires: python3-sphinx BuildRequires: python3-ipython-sphinx +BuildRequires: python3-pandas # This should be required by python3-ipython-sphinx BuildRequires: python3-matplotlib # For splines @@ -55,12 +57,15 @@ This package contains the full API documentation for python3-%{srcname}. %prep -%autosetup -n %{srcname}-%{version} +%autosetup -n %{srcname}-%{version} -p1 %build %py3_build -# Creating the docs with python3-sphinx doesn't work -%{__python3} setup.py build_sphinx + +pushd doc + export PYTHONPATH=`readlink -f ../build/lib` + make html SPHINXBUILD=sphinx-build-%{python3_version} +popd %install %py3_install @@ -70,17 +75,19 @@ pushd %{buildroot}/%{python3_sitelib} nosetests-%{python3_version} patsy popd - %files -n python3-%{srcname} %doc README.rst TODO %license LICENSE.txt %{python3_sitelib}/patsy* %files -n python3-%{srcname}-doc -%doc README.rst TODO build/sphinx/html +%doc README.rst TODO doc/_build/html %license LICENSE.txt %changelog +* Sat Oct 06 2018 Sergio Pascual - 0.5.0-5 +- Build docs with python3 + * Fri Oct 05 2018 Sergio Pascual - 0.5.0-4 - Drop python2 subpackage