diff --git a/python-lib3to6.changes b/python-lib3to6.changes index 61383be..5a1a410 100644 --- a/python-lib3to6.changes +++ b/python-lib3to6.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Aug 8 05:21:21 UTC 2022 - Steve Kowalik + +- Add patch use-pathlib-directly.patch: + * Stop using pathlib2. +- No longer remove typing from requirements, we install it explicitly. + ------------------------------------------------------------------- Wed Dec 8 14:16:38 UTC 2021 - pgajdos@suse.com diff --git a/python-lib3to6.spec b/python-lib3to6.spec index ff1eca6..5ece657 100644 --- a/python-lib3to6.spec +++ b/python-lib3to6.spec @@ -1,7 +1,7 @@ # # spec file for package python-lib3to6 # -# Copyright (c) 2021 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,12 +25,13 @@ Summary: Module to compile Python 3.6+ code to Python 2.7+ License: MIT URL: https://gitlab.com/mbarkhau/lib3to6 Source: https://files.pythonhosted.org/packages/source/l/lib3to6/lib3to6-%{version}.tar.gz +# PATCH-FIX-UPSTREAM Based on gh#mbarkhau/lib3to6#5 +Patch0: use-pathlib-directly.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-astor Requires: python-click -Requires: python-pathlib2 Requires: python-typing Requires: python-wheel Requires(post): update-alternatives @@ -39,7 +40,6 @@ BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module astor} BuildRequires: %{python_module click} -BuildRequires: %{python_module pathlib2} BuildRequires: %{python_module pytest} BuildRequires: %{python_module typing} # /SECTION @@ -49,8 +49,7 @@ BuildRequires: %{python_module typing} A module to compile Python 3.6+ code to Python 2.7+. %prep -%setup -q -n lib3to6-%{version} -sed -i '/typing/d' requirements/* +%autosetup -p1 -n lib3to6-%{version} sed -i '1{/^#!/d}' src/lib3to6/__main__.py %build diff --git a/use-pathlib-directly.patch b/use-pathlib-directly.patch new file mode 100644 index 0000000..46dcece --- /dev/null +++ b/use-pathlib-directly.patch @@ -0,0 +1,55 @@ +From 98b13f97bf0d1da938d56de5a95b69490f70d52d Mon Sep 17 00:00:00 2001 +From: Steve Kowalik +Date: Mon, 8 Aug 2022 14:54:36 +1000 +Subject: [PATCH] Use pathlib directly + +Since this script runs in an environment where the minimal Python +version is greater than 3.4, we can rely on pathlib being available. +Remove pathlib2 from the requirements and just use pathlib. +--- + requirements/pypi.txt | 1 - + setup.cfg | 1 - + src/lib3to6/packaging.py | 2 +- + 3 files changed, 1 insertion(+), 3 deletions(-) + +Index: lib3to6-202107.1047/requirements/pypi.txt +=================================================================== +--- lib3to6-202107.1047.orig/requirements/pypi.txt ++++ lib3to6-202107.1047/requirements/pypi.txt +@@ -7,7 +7,6 @@ + # Binary (non-pure) packages may also be listed here, but you + # should see if there is a conda package that suits your needs. + +-pathlib2 + astor + typing;python_version<"3.5" + click<8.0; python_version < "3.6" +Index: lib3to6-202107.1047/setup.cfg +=================================================================== +--- lib3to6-202107.1047.orig/setup.cfg ++++ lib3to6-202107.1047/setup.cfg +@@ -17,7 +17,6 @@ warn_unused_ignores = True + warn_redundant_casts = True + + [tool:isort] +-known_third_party = pathlib2 + force_single_line = True + length_sort = True + +Index: lib3to6-202107.1047/src/lib3to6/packaging.py +=================================================================== +--- lib3to6-202107.1047.orig/src/lib3to6/packaging.py ++++ lib3to6-202107.1047/src/lib3to6/packaging.py +@@ -8,11 +8,10 @@ import os + import sys + import shutil + import typing as typ ++import pathlib as pl + import hashlib as hl + import tempfile + +-import pathlib2 as pl +- + from . import common + from . import transpile +