14
0

Accepting request 926418 from devel:languages:python

- Update to 1.7:
  - Drop Python 3.6 support
  - Add Python 3.9 support
  - Require Graphviz 2.42+, (Graphviz 2.46+ recommended)
  - Improve installation process and documentation
  - Switch from nose to pytest
  - Remove old Python 2 code
  - AGraph.eq includes attribute comparison (PR #246)

OBS-URL: https://build.opensuse.org/request/show/926418
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-pygraphviz?expand=0&rev=8
This commit is contained in:
2021-10-22 22:50:18 +00:00
committed by Git OBS Bridge
5 changed files with 45 additions and 41 deletions

View File

@@ -1,13 +1,15 @@
Index: setup.py
===================================================================
--- setup.py.orig
+++ setup.py
@@ -36,7 +36,7 @@
sys.path.pop(0)
---
setup.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/setup.py
+++ b/setup.py
@@ -54,7 +54,7 @@ with open("pygraphviz/__init__.py") as f
break
packages = ["pygraphviz", "pygraphviz.tests"]
-docdirbase = 'share/doc/pygraphviz-%s' % release.version
+docdirbase = 'share/doc/packages/pygraphviz-%s' % release.version
-docdirbase = f"share/doc/pygraphviz-{version}"
+docdirbase = f"share/doc/packages/pygraphviz-{version}"
data = [
(docdirbase, glob("*.txt")),
(os.path.join(docdirbase, 'examples'), glob("examples/*.py")),
(os.path.join(docdirbase, "examples"), glob("examples/*.py")),

View File

@@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:411ae84a5bc313e3e1523a1cace59159f512336318a510573b47f824edef8860
size 117043

3
pygraphviz-1.7.zip Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a7bec6609f37cf1e64898c59f075afd659106cf9356c5f387cecaa2e0cdb2304
size 118754

View File

@@ -1,3 +1,15 @@
-------------------------------------------------------------------
Tue Oct 19 19:58:44 UTC 2021 - Matej Cepl <mcepl@suse.com>
- Update to 1.7:
- Drop Python 3.6 support
- Add Python 3.9 support
- Require Graphviz 2.42+, (Graphviz 2.46+ recommended)
- Improve installation process and documentation
- Switch from nose to pytest
- Remove old Python 2 code
- AGraph.eq includes attribute comparison (PR #246)
-------------------------------------------------------------------
Mon Sep 28 11:16:38 UTC 2020 - Dirk Mueller <dmueller@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-pygraphviz
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -20,29 +20,30 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%global skip_python2 1
%global skip_python36 1
Name: python-pygraphviz
Version: 1.6
Version: 1.7
Release: 0
URL: http://networkx.lanl.gov/pygraphviz
URL: https://pygraphviz.github.io/
Summary: Python interface to Graphviz
License: BSD-3-Clause
Group: Development/Languages/Python
Source: https://files.pythonhosted.org/packages/source/p/pygraphviz/pygraphviz-%{version}.zip
# PATCH-FIX-UPSTREAM docdir.patch
Patch: docdir.patch
Patch0: docdir.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: graphviz-devel >= 2.16
BuildRequires: pkg-config
BuildRequires: graphviz-devel >= 2.42
BuildRequires: libpng-devel
BuildRequires: pkgconf-pkg-config
BuildRequires: python-rpm-macros
BuildRequires: swig
BuildRequires: unzip
# Needed even without tests
BuildRequires: %{python_module mock >= 2.0.0}
BuildRequires: %{python_module nose >= 1.3.7}
Requires: graphviz >= 2.16
BuildRequires: %{python_module pytest}
Requires: graphviz >= 2.42
%python_subpackages
%description
@@ -58,34 +59,23 @@ Provides: %{python_module pygraphviz-doc = %{version}}
This package provides documentation and help files for %{name}
%prep
%setup -q -n pygraphviz-%{version}
%patch
%autosetup -p1 -n pygraphviz-%{version}
%build
# Need command-line flags only available in install
export CFLAGS="%{optflags}"
%python_build
%install
export CFLAGS="%{optflags}"
%python_exec setup.py install -O1 --force --root %{buildroot} --prefix %{_prefix} --include-path %{_includedir}/graphviz/ --library-path %{_libdir}/graphviz/
%{python_expand pushd %{buildroot}%{$python_sitearch}
# Fix wrong-script-interpreter
sed -i "s|#!/usr/bin/env python|#!%__$python|" pygraphviz/tests/test.py
chmod a+x pygraphviz/tests/test.py
# Deduplicating files can generate a RPMLINT warning for pyc mtime
$python -m compileall -d %{$python_sitearch} pygraphviz/tests/
$python -O -m compileall -d %{$python_sitearch} pygraphviz/tests/
%fdupes .
popd
}
%python_install
%fdupes %{buildroot}%{$python_sitearch}
%if %{with tests}
%check
pushd examples
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitearch}
$python -c "import pygraphviz;pygraphviz.test()"
}
popd
# export PYTEST_ADDOPTS="--doctest-modules --durations=10 --import-mode=importlib"
export PYTEST_ADDOPTS="--import-mode=importlib"
# skip tests because of gh#pygraphviz/pygraphviz#366
%pytest_arch -k 'not (test_drawing_makes_file or test_drawing_makes_file1 or test_drawing_makes_file)'
%endif
%files %{python_files}