Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Sergio Pascual
24bbedd084 Backport patches from f39 2023-07-23 19:54:15 +02:00
3 changed files with 89 additions and 1 deletions

View file

@ -5,7 +5,7 @@
Name: APLpy
Version: 2.0.3
Release: 19%{?dist}
Release: 20%{?dist}
Summary: The Astronomical Plotting Library in Python
License: MIT
@ -14,6 +14,12 @@ Source0: %{pypi_source}
Patch0: aplpy-moved-function.patch
# https://github.com/aplpy/aplpy/pull/469
Patch1: aplpy-wraps-from-functools.patch
# Workaround for python 3.12 change of imp module removal
Patch2: astropy_helpers-py312-imp-deprecation.patch
# related:
# https://github.com/astropy/astropy/pull/12633
# astropy 5.1 removes astropy.tests.plugins.display and so on
Patch3: aplpy-astropy-5.1-tests-plugins-removal.patch
BuildArch: noarch
BuildRequires: python3-devel
@ -32,6 +38,7 @@ BuildRequires: python3-setuptools
BuildRequires: python3-numpy
BuildRequires: python3-matplotlib
BuildRequires: python3-astropy
BuildRequires: python3-pytest-astropy-header
# Testing
BuildRequires: python3-pytest
BuildRequires: python3-pillow
@ -78,6 +85,9 @@ popd
%{python3_sitelib}/aplpy/
%changelog
* Sun Jul 23 2023 Sergio Pascual <sergiopr@fedoraproject.org> - 2.0.3-20
- Backport patches from f39
* Wed Jan 18 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.3-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild

View file

@ -0,0 +1,36 @@
--- APLpy-2.0.3/aplpy/conftest.py.old 2019-02-19 20:20:49.000000000 +0900
+++ APLpy-2.0.3/aplpy/conftest.py 2023-07-13 00:18:27.256633975 +0900
@@ -13,14 +13,19 @@
# With older versions of Astropy, we actually need to import the pytest
# plugins themselves in order to make them discoverable by pytest.
from astropy.tests.pytest_plugins import * # noqa
-else:
+elif astropy_version < '5.1':
# As of Astropy 3.0, the pytest plugins provided by Astropy are
# automatically made available when Astropy is installed. This means it's
# not necessary to import them here, but we still need to import global
# variables that are used for configuration.
from astropy.tests.plugins.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS
+else:
+ from pytest_astropy_header.display import PYTEST_HEADER_MODULES, TESTED_VERSIONS
-from astropy.tests.helper import enable_deprecations_as_exceptions
+try:
+ from astropy.tests.helper import enable_deprecations_as_exceptions
+except:
+ pass
# Uncomment the following line to treat all DeprecationWarnings as
# exceptions. For Astropy v2.0 or later, there are 2 additional keywords,
@@ -32,7 +37,10 @@
# To ignore some specific deprecation warning messages for Python version
# MAJOR.MINOR or later, add:
# warnings_to_ignore_by_pyver={(MAJOR, MINOR): ['Message to ignore']}
-enable_deprecations_as_exceptions()
+try:
+ enable_deprecations_as_exceptions()
+except:
+ pass
# Uncomment and customize the following lines to add/remove entries from
# the list of packages for which version numbers are displayed when running

View file

@ -0,0 +1,42 @@
--- APLpy-2.0.3/astropy_helpers/astropy_helpers/utils.py.orig 2018-12-12 20:36:12.000000000 +0900
+++ APLpy-2.0.3/astropy_helpers/astropy_helpers/utils.py 2023-07-12 23:41:04.228876992 +0900
@@ -3,7 +3,6 @@
import contextlib
import functools
-import imp
import inspect
import os
import sys
@@ -60,9 +59,9 @@
import builtins
if hasattr(builtins, '__NUMPY_SETUP__'):
del builtins.__NUMPY_SETUP__
- import imp
+ import importlib
import numpy
- imp.reload(numpy)
+ importlib.reload(numpy)
try:
numpy_include = numpy.get_include()
--- APLpy-2.0.3/astropy_helpers/astropy_helpers/version_helpers.py.orig 2023-07-12 23:43:28.923036099 +0900
+++ APLpy-2.0.3/astropy_helpers/astropy_helpers/version_helpers.py 2023-07-12 23:43:41.692050140 +0900
@@ -21,7 +21,7 @@
from __future__ import division
import datetime
-import imp
+import importlib
import os
import pkgutil
import sys
@@ -278,7 +278,7 @@
invalidate_caches()
if version_module:
- imp.reload(version_module)
+ importlib.reload(version_module)
def get_pkg_version_module(packagename, fromlist=None):