forked from pool/python-djvulibre
* sphinx_4_compatibility.patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-djvulibre?expand=0&rev=47
This commit is contained in:
parent
ea2dec2805
commit
ca38fba0d8
@ -4,7 +4,7 @@ Mon Jul 26 09:25:12 UTC 2021 - Matej Cepl <mcepl@suse.com>
|
||||
- Port testing of the package to unittest, adding these patches:
|
||||
* remove-all-dependencies-on-nose-in-the-code.patch
|
||||
* remove-nose-in-documentation.patch
|
||||
* switch-to-src-project-layout-to-simplify-testing.patch
|
||||
* sphinx_4_compatibility.patch
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Mar 8 13:48:17 UTC 2021 - Kyrill Detinov <lazy.kent@opensuse.org>
|
||||
|
@ -27,12 +27,11 @@ URL: http://jwilk.net/software/python-djvulibre
|
||||
Source0: https://files.pythonhosted.org/packages/source/p/python-djvulibre/%{name}-%{version}.tar.gz
|
||||
Source1: https://files.pythonhosted.org/packages/source/p/python-djvulibre/%{name}-%{version}.tar.gz.asc
|
||||
Source2: %{name}.keyring
|
||||
# PATCH-FEATURE-UPSTREAM set of patches gh#jwilk/python-djvulibre#14 mcepl@suse.com
|
||||
# Set of patches to port testing to unittest
|
||||
Patch0: switch-to-src-project-layout-to-simplify-testing.patch
|
||||
Patch1: remove-all-dependencies-on-nose-in-the-code.patch
|
||||
Patch2: remove-nose-in-documentation.patch
|
||||
|
||||
# PATCH-FIX-UPSTREAM sphinx_4_compatibility.patch gh#sphinx-doc/sphinx#7747 mcepl@suse.com
|
||||
# Sphinx doesn't stable API
|
||||
Patch3: sphinx_4_compatibility.patch
|
||||
BuildRequires: %{python_module Cython >= 0.19.1}
|
||||
BuildRequires: %{python_module Sphinx}
|
||||
BuildRequires: %{python_module devel}
|
||||
@ -80,7 +79,7 @@ rm build/sphinx/html/.buildinfo build/sphinx/html/objects.inv
|
||||
|
||||
%check
|
||||
cd tests/
|
||||
%pyunittest_arch discover -v tests/
|
||||
%pyunittest_arch -v
|
||||
|
||||
%files %{python_files}
|
||||
%license doc/COPYING
|
||||
|
14
sphinx_4_compatibility.patch
Normal file
14
sphinx_4_compatibility.patch
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
doc/api/conf.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/doc/api/conf.py
|
||||
+++ b/doc/api/conf.py
|
||||
@@ -55,6 +55,6 @@ rst_epilog = '''
|
||||
import sphinx.writers.html
|
||||
del sphinx.writers.html.HTMLTranslator.visit_math
|
||||
def setup(app):
|
||||
- app.add_stylesheet('docutils-math.css')
|
||||
+ app.add_css_file('docutils-math.css')
|
||||
|
||||
# vim:ts=4 sts=4 sw=4 et
|
@ -1,206 +0,0 @@
|
||||
From 5b58d1cc21a48d063e53b214f2291eac6a4842ba Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <mcepl@cepl.eu>
|
||||
Date: Mon, 26 Jul 2021 09:24:10 +0200
|
||||
Subject: [PATCH] Switch to src/ project layout to simplify testing.
|
||||
|
||||
---
|
||||
MANIFEST.in | 2 +-
|
||||
setup.cfg | 5 +++++
|
||||
setup.py | 37 +++++++++++++++-------------------
|
||||
{djvu => src/djvu}/__init__.py | 0
|
||||
{djvu => src/djvu}/common.pxi | 0
|
||||
{djvu => src/djvu}/const.py | 0
|
||||
{djvu => src/djvu}/decode.pxd | 0
|
||||
{djvu => src/djvu}/decode.pyx | 0
|
||||
{djvu => src/djvu}/dllpath.py | 0
|
||||
{djvu => src/djvu}/sexpr.pxd | 0
|
||||
{djvu => src/djvu}/sexpr.pyx | 0
|
||||
11 files changed, 22 insertions(+), 22 deletions(-)
|
||||
rename {djvu => src/djvu}/__init__.py (100%)
|
||||
rename {djvu => src/djvu}/common.pxi (100%)
|
||||
rename {djvu => src/djvu}/const.py (100%)
|
||||
rename {djvu => src/djvu}/decode.pxd (100%)
|
||||
rename {djvu => src/djvu}/decode.pyx (100%)
|
||||
rename {djvu => src/djvu}/dllpath.py (100%)
|
||||
rename {djvu => src/djvu}/sexpr.pxd (100%)
|
||||
rename {djvu => src/djvu}/sexpr.pyx (100%)
|
||||
|
||||
diff --git a/MANIFEST.in b/MANIFEST.in
|
||||
index f1e722a..7ff510b 100644
|
||||
--- a/MANIFEST.in
|
||||
+++ b/MANIFEST.in
|
||||
@@ -13,7 +13,7 @@ include pyproject.toml
|
||||
|
||||
include examples/*
|
||||
|
||||
-recursive-include djvu *.py *.pxi *.pxd *.pyx
|
||||
+recursive-include src/djvu *.py *.pxi *.pxd *.pyx
|
||||
|
||||
recursive-include tests *.py Makefile *.tex *.djvu
|
||||
|
||||
diff --git a/setup.cfg b/setup.cfg
|
||||
index 910c652..62d6219 100644
|
||||
--- a/setup.cfg
|
||||
+++ b/setup.cfg
|
||||
@@ -1,3 +1,8 @@
|
||||
+[options]
|
||||
+package_dir =
|
||||
+ = src
|
||||
+packages = find:
|
||||
+
|
||||
[pycodestyle]
|
||||
filename = *.py,*.pyx,*.px[di]
|
||||
ignore = E12,E131,E2,E3,E4,E501,E722,W504
|
||||
diff --git a/setup.py b/setup.py
|
||||
index 93b6493..0cb196b 100644
|
||||
--- a/setup.py
|
||||
+++ b/setup.py
|
||||
@@ -26,23 +26,18 @@ import re
|
||||
import subprocess as ipc
|
||||
import sys
|
||||
|
||||
-need_setuptools = False
|
||||
if os.name == 'nt':
|
||||
import djvu.dllpath
|
||||
- need_setuptools = True
|
||||
|
||||
-if need_setuptools:
|
||||
- import setuptools.extension
|
||||
- del setuptools.extension
|
||||
- del setuptools
|
||||
+import setuptools
|
||||
|
||||
-import distutils.core
|
||||
-import distutils.ccompiler
|
||||
-import distutils.command.build_ext
|
||||
-import distutils.command.sdist
|
||||
+import setuptools.command.build_ext
|
||||
+import setuptools.command.sdist
|
||||
import distutils.dep_util
|
||||
import distutils.dir_util
|
||||
import distutils.version
|
||||
+import distutils.log
|
||||
+import distutils.errors
|
||||
|
||||
try:
|
||||
import sphinx.setup_command as sphinx_setup_command
|
||||
@@ -65,7 +60,7 @@ type(b'') # Python >= 2.6 is required
|
||||
type(u'') # Python 2.X or >= 3.3 is required
|
||||
|
||||
def ext_modules():
|
||||
- for pyx_file in glob.iglob(os.path.join('djvu', '*.pyx')):
|
||||
+ for pyx_file in glob.iglob(os.path.join('src', 'djvu', '*.pyx')):
|
||||
module, _ = os.path.splitext(os.path.basename(pyx_file))
|
||||
yield module
|
||||
ext_modules = list(ext_modules())
|
||||
@@ -170,7 +165,7 @@ else:
|
||||
# Work-around for <https://bugs.python.org/issue969718>:
|
||||
os.environ.pop('CFLAGS', None)
|
||||
|
||||
-class build_ext(distutils.command.build_ext.build_ext):
|
||||
+class build_ext(setuptools.command.build_ext.build_ext):
|
||||
|
||||
def run(self):
|
||||
djvulibre_version = get_djvulibre_version()
|
||||
@@ -199,7 +194,7 @@ class build_ext(distutils.command.build_ext.build_ext):
|
||||
if '\n'.join(new_config).strip() != old_config.strip():
|
||||
distutils.log.info('creating {conf!r}'.format(conf=self.config_path))
|
||||
distutils.file_util.write_file(self.config_path, new_config)
|
||||
- distutils.command.build_ext.build_ext.run(self)
|
||||
+ setuptools.command.build_ext.build_ext.run(self)
|
||||
|
||||
def build_extensions(self):
|
||||
self.check_extensions_list(self.extensions)
|
||||
@@ -244,7 +239,7 @@ if sphinx_setup_command:
|
||||
# the extension modules. Prepend the directory that build_ext would
|
||||
# use instead.
|
||||
build_ext = self.get_finalized_command('build_ext')
|
||||
- sys.path[:0] = [build_ext.build_lib]
|
||||
+ sys.path[:0] = build_ext.build_lib
|
||||
for ext in ext_modules:
|
||||
__import__('djvu.' + ext)
|
||||
del sys.path[0]
|
||||
@@ -252,7 +247,7 @@ if sphinx_setup_command:
|
||||
else:
|
||||
build_sphinx = None
|
||||
|
||||
-class sdist(distutils.command.sdist.sdist):
|
||||
+class sdist(setuptools.command.sdist.sdist):
|
||||
|
||||
def maybe_move_file(self, base_dir, src, dst):
|
||||
src = os.path.join(base_dir, src)
|
||||
@@ -261,7 +256,7 @@ class sdist(distutils.command.sdist.sdist):
|
||||
self.move_file(src, dst)
|
||||
|
||||
def make_release_tree(self, base_dir, files):
|
||||
- distutils.command.sdist.sdist.make_release_tree(self, base_dir, files)
|
||||
+ setuptools.command.sdist.sdist.make_release_tree(self, base_dir, files)
|
||||
self.maybe_move_file(base_dir, 'COPYING', 'doc/COPYING')
|
||||
|
||||
classifiers = '''
|
||||
@@ -294,10 +289,10 @@ meta = dict(
|
||||
setup_params = dict(
|
||||
packages=['djvu'],
|
||||
ext_modules=[
|
||||
- distutils.command.build_ext.Extension(
|
||||
+ setuptools.Extension(
|
||||
'djvu.{mod}'.format(mod=name),
|
||||
- ['djvu/{mod}.pyx'.format(mod=name)],
|
||||
- depends=(['djvu/common.pxi'] + glob.glob('djvu/*.pxd')),
|
||||
+ ['src/djvu/{mod}.pyx'.format(mod=name)],
|
||||
+ depends=(['src/djvu/common.pxi'] + glob.glob('djvu/*.pxd')),
|
||||
)
|
||||
for name in ext_modules
|
||||
],
|
||||
@@ -315,13 +310,13 @@ if __name__ == '__main__':
|
||||
if (cython_version < req_cython_version) and egg_info_for_pip:
|
||||
# This shouldn't happen with pip >= 10, thanks to PEP-518 support.
|
||||
# For older versions, we use this hack to trick it into installing Cython:
|
||||
- distutils.core.setup(
|
||||
+ setuptools.setup(
|
||||
install_requires=['Cython>={ver}'.format(ver=req_cython_version)],
|
||||
# Conceptually, “setup_requires” would make more sense than
|
||||
# “install_requires”, but the former is not supported by pip.
|
||||
**meta
|
||||
)
|
||||
else:
|
||||
- distutils.core.setup(**setup_params)
|
||||
+ setuptools.setup(**setup_params)
|
||||
|
||||
# vim:ts=4 sts=4 sw=4 et
|
||||
diff --git a/djvu/__init__.py b/src/djvu/__init__.py
|
||||
similarity index 100%
|
||||
rename from djvu/__init__.py
|
||||
rename to src/djvu/__init__.py
|
||||
diff --git a/djvu/common.pxi b/src/djvu/common.pxi
|
||||
similarity index 100%
|
||||
rename from djvu/common.pxi
|
||||
rename to src/djvu/common.pxi
|
||||
diff --git a/djvu/const.py b/src/djvu/const.py
|
||||
similarity index 100%
|
||||
rename from djvu/const.py
|
||||
rename to src/djvu/const.py
|
||||
diff --git a/djvu/decode.pxd b/src/djvu/decode.pxd
|
||||
similarity index 100%
|
||||
rename from djvu/decode.pxd
|
||||
rename to src/djvu/decode.pxd
|
||||
diff --git a/djvu/decode.pyx b/src/djvu/decode.pyx
|
||||
similarity index 100%
|
||||
rename from djvu/decode.pyx
|
||||
rename to src/djvu/decode.pyx
|
||||
diff --git a/djvu/dllpath.py b/src/djvu/dllpath.py
|
||||
similarity index 100%
|
||||
rename from djvu/dllpath.py
|
||||
rename to src/djvu/dllpath.py
|
||||
diff --git a/djvu/sexpr.pxd b/src/djvu/sexpr.pxd
|
||||
similarity index 100%
|
||||
rename from djvu/sexpr.pxd
|
||||
rename to src/djvu/sexpr.pxd
|
||||
diff --git a/djvu/sexpr.pyx b/src/djvu/sexpr.pyx
|
||||
similarity index 100%
|
||||
rename from djvu/sexpr.pyx
|
||||
rename to src/djvu/sexpr.pyx
|
||||
--
|
||||
2.32.0
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user