#2 Fix for Python 3.7 (PEP 562)
Merged 5 years ago by jujens. Opened 5 years ago by churchyard.
rpms/ churchyard/python-sphinx-intl py37  into  master

file added
+22
@@ -0,0 +1,22 @@ 

+ diff --git a/tests/conftest.py b/tests/conftest.py

+ index 9248693..dfff83c 100644

+ --- a/tests/conftest.py

+ +++ b/tests/conftest.py

+ @@ -14,7 +14,7 @@ import pytest

+  

+  from path import path

+  

+ -__dir__ = path(os.path.dirname(os.path.abspath(__file__)))

+ +_dir = path(os.path.dirname(os.path.abspath(__file__)))

+  

+  

+  @pytest.fixture(scope="function")

+ @@ -22,7 +22,7 @@ def temp(request, tmpdir):

+      template_dir = 'root'

+  

+      tmpdir = path(tmpdir)

+ -    (__dir__ / template_dir).copytree(tmpdir / template_dir)

+ +    (_dir / template_dir).copytree(tmpdir / template_dir)

+      cwd = os.getcwd()

+      temp = tmpdir / template_dir

+      os.chdir(temp)

file modified
+7 -1
@@ -25,6 +25,12 @@ 

  URL:            https://pypi.python.org/pypi/%{pypi_name}

  Source0:        https://github.com/%{project_owner}/%{github_name}/archive/v%{version}/%{github_name}-%{version}.tar.gz

  

+ # Python 3.7 has module level dunder __dir__ attribute

+ # So we need to rename the __dir__ variable as it fails to work with 3.7

+ # https://www.python.org/dev/peps/pep-0562/

+ # https://bugzilla.redhat.com/show_bug.cgi?id=1605925

+ Patch0:         py37.patch

+ 

  BuildArch:      noarch

  

  %description
@@ -77,7 +83,7 @@ 

  

  

  %prep

- %setup -qn %{pypi_name}-%{version}

+ %autosetup -n %{pypi_name}-%{version} -p1

  # Correct line encoding in README.rst

  sed -i 's/\r$//' README.rst

  

no initial comment

Pull-Request has been merged by jujens

5 years ago