From d77cc5a8bbbf03179e7879e53fbc90c278af2fe840b39f98b582546f5d114d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Chv=C3=A1tal?= Date: Thu, 12 Sep 2019 12:32:30 +0000 Subject: [PATCH] - Update to 2.4.11: * Restored fs.path import * Fixed potential race condition in makedirs. Fixes #310 * Added missing methods to WrapFS. Fixed #294 * MemFS now immediately releases all memory it holds when close() is called, rather than when it gets garbage collected. Closes issue #308. * FTPFS now translates EOFError into RemoteConnectionError. Closes #292 * Added automatic close for filesystems that go out of scope. Fixes #298 * Fixed broken WrapFS.movedir #322 * Added geturl for TarFS and ZipFS for 'fs' purpose. NoURL for 'download' purpose. * Added helpful root path in CreateFailed exception #340 - remove patch more-relaxed-requirements.patch replaced by sed OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-fs?expand=0&rev=20 --- conftest.py | 34 +++++++++++++++++++++++++++++++++ fs-2.4.11.tar.gz | 3 +++ fs-2.4.8.tar.gz | 3 --- more-relaxed-requirements.patch | 28 --------------------------- python-fs.changes | 15 +++++++++++++++ python-fs.spec | 25 ++++++++++++------------ 6 files changed, 65 insertions(+), 43 deletions(-) create mode 100644 conftest.py create mode 100644 fs-2.4.11.tar.gz delete mode 100644 fs-2.4.8.tar.gz delete mode 100644 more-relaxed-requirements.patch diff --git a/conftest.py b/conftest.py new file mode 100644 index 0000000..59d8eee --- /dev/null +++ b/conftest.py @@ -0,0 +1,34 @@ +import pytest + +try: + from unittest import mock +except ImportError: + import mock + + +@pytest.fixture +@mock.patch("appdirs.user_data_dir", autospec=True, spec_set=True) +@mock.patch("appdirs.site_data_dir", autospec=True, spec_set=True) +@mock.patch("appdirs.user_config_dir", autospec=True, spec_set=True) +@mock.patch("appdirs.site_config_dir", autospec=True, spec_set=True) +@mock.patch("appdirs.user_cache_dir", autospec=True, spec_set=True) +@mock.patch("appdirs.user_state_dir", autospec=True, spec_set=True) +@mock.patch("appdirs.user_log_dir", autospec=True, spec_set=True) +def mock_appdir_directories( + user_log_dir_mock, + user_state_dir_mock, + user_cache_dir_mock, + site_config_dir_mock, + user_config_dir_mock, + site_data_dir_mock, + user_data_dir_mock, + tmpdir +): + """Mock out every single AppDir directory so tests can't access real ones.""" + user_log_dir_mock.return_value = str(tmpdir.join("user_log").mkdir()) + user_state_dir_mock.return_value = str(tmpdir.join("user_state").mkdir()) + user_cache_dir_mock.return_value = str(tmpdir.join("user_cache").mkdir()) + site_config_dir_mock.return_value = str(tmpdir.join("site_config").mkdir()) + user_config_dir_mock.return_value = str(tmpdir.join("user_config").mkdir()) + site_data_dir_mock.return_value = str(tmpdir.join("site_data").mkdir()) + user_data_dir_mock.return_value = str(tmpdir.join("user_data").mkdir()) diff --git a/fs-2.4.11.tar.gz b/fs-2.4.11.tar.gz new file mode 100644 index 0000000..d2f92ff --- /dev/null +++ b/fs-2.4.11.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc99d476b500f993df8ef697b96dc70928ca2946a455c396a566efe021126767 +size 128125 diff --git a/fs-2.4.8.tar.gz b/fs-2.4.8.tar.gz deleted file mode 100644 index d4f9e69..0000000 --- a/fs-2.4.8.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:5e19251e939b10d50e4b58b0cf2862851794abcf4aa4387b67c69dd61e97b3dc -size 124808 diff --git a/more-relaxed-requirements.patch b/more-relaxed-requirements.patch deleted file mode 100644 index 53c6d3b..0000000 --- a/more-relaxed-requirements.patch +++ /dev/null @@ -1,28 +0,0 @@ -Index: fs-2.4.8/setup.py -=================================================================== ---- fs-2.4.8.orig/setup.py 2019-07-26 15:56:23.878197898 +0200 -+++ fs-2.4.8/setup.py 2019-07-26 15:57:13.178479543 +0200 -@@ -19,7 +19,7 @@ CLASSIFIERS = [ - "Topic :: System :: Filesystems", - ] - --REQUIREMENTS = ["appdirs~=1.4.3", "pytz", "setuptools", "six~=1.10"] -+REQUIREMENTS = ["appdirs>=1.4.3", "pytz", "setuptools", "six>=1.10"] - - setup( - author="Will McGugan", -@@ -28,10 +28,10 @@ setup( - description="Python's filesystem abstraction layer", - install_requires=REQUIREMENTS, - extras_require={ -- "scandir :python_version < '3.5'": ["scandir~=1.5"], -- ":python_version < '3.4'": ["enum34~=1.1.6"], -- ":python_version < '3.6'": ["typing~=3.6"], -- ":python_version < '3.0'": ["backports.os~=0.1"], -+ "scandir :python_version < '3.5'": ["scandir>=1.5"], -+ ":python_version < '3.4'": ["enum34>=1.1.6"], -+ ":python_version < '3.6'": ["typing>=3.6"], -+ ":python_version < '3.0'": ["backports.os>=0.1"], - }, - license="MIT", - name="fs", diff --git a/python-fs.changes b/python-fs.changes index 7e5e679..6cb0899 100644 --- a/python-fs.changes +++ b/python-fs.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Thu Sep 12 12:00:45 UTC 2019 - Tomáš Chvátal + +- Update to 2.4.11: + * Restored fs.path import + * Fixed potential race condition in makedirs. Fixes #310 + * Added missing methods to WrapFS. Fixed #294 + * MemFS now immediately releases all memory it holds when close() is called, rather than when it gets garbage collected. Closes issue #308. + * FTPFS now translates EOFError into RemoteConnectionError. Closes #292 + * Added automatic close for filesystems that go out of scope. Fixes #298 + * Fixed broken WrapFS.movedir #322 + * Added geturl for TarFS and ZipFS for 'fs' purpose. NoURL for 'download' purpose. + * Added helpful root path in CreateFailed exception #340 +- remove patch more-relaxed-requirements.patch replaced by sed + ------------------------------------------------------------------- Fri Jul 26 14:10:13 UTC 2019 - pgajdos@suse.com diff --git a/python-fs.spec b/python-fs.spec index 453a22e..f6898fa 100644 --- a/python-fs.spec +++ b/python-fs.spec @@ -19,21 +19,19 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-fs -Version: 2.4.8 +Version: 2.4.11 Release: 0 Summary: Python's filesystem abstraction layer License: MIT Group: Development/Languages/Python -Url: https://github.com/PyFilesystem/pyfilesystem2 +URL: https://github.com/PyFilesystem/pyfilesystem2 Source: https://files.pythonhosted.org/packages/source/f/fs/fs-%{version}.tar.gz -# PATCH-FIX-UPSTREAM more-relaxed-requirements.patch sebix+novell.com@sebix.at -- Weaken the version dependencies -Patch0: more-relaxed-requirements.patch +Source1: https://raw.githubusercontent.com/PyFilesystem/pyfilesystem2/master/tests/conftest.py BuildRequires: %{python_module appdirs >= 1.4.3} -BuildRequires: %{python_module mock} -BuildRequires: %{python_module nose} BuildRequires: %{python_module psutil} BuildRequires: %{python_module pyftpdlib} BuildRequires: %{python_module pysendfile} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module pytz} BuildRequires: %{python_module scandir >= 1.5} BuildRequires: %{python_module setuptools} @@ -41,16 +39,19 @@ BuildRequires: %{python_module six >= 1.10.0} BuildRequires: %{python_module typing >= 3.6} BuildRequires: fdupes BuildRequires: python-backports.os >= 0.1 +BuildRequires: python-enum34 >= 1.1.6 +BuildRequires: python-mock BuildRequires: python-rpm-macros Requires: python-appdirs >= 1.4.3 Requires: python-psutil Requires: python-pytz Requires: python-setuptools Requires: python-six >= 1.10.0 -Requires: python-typing >= 3.6 Recommends: python-pyftpdlib +Recommends: python-typing >= 3.6 +BuildArch: noarch %ifpython2 -Requires: python-backports.os +Requires: python-backports.os >= 0.1 %endif %if %{python_version_nodots} < 34 Requires: python-enum34 >= 1.1.6 @@ -59,8 +60,6 @@ Recommends: python-pysendfile %if %{python3_version_nodots} < 35 Recommends: python-scandir >= 1.5 %endif -BuildArch: noarch - %python_subpackages %description @@ -72,7 +71,8 @@ any of the supported filesystems (zip, ftp, S3 etc.). %prep %setup -q -n fs-%{version} -%patch0 -p1 +sed -i -e 's:~=:>=:g' setup.py +cp %{SOURCE1} tests/ %build %python_build @@ -83,7 +83,8 @@ any of the supported filesystems (zip, ftp, S3 etc.). %check export LANG=en_US.UTF-8 -%python_exec setup.py test +export PYTHONDONTWRITEBYTECODE=1 +%pytest %files %{python_files} %doc README.md