From ce244db1fd9ab68f51e14a67c0828b334f6cf7a9 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 29 Nov 2020 21:25:07 +0100 Subject: [PATCH 01/16] Update watch file version --- debian/watch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/watch b/debian/watch index 166f285..19c0ed1 100644 --- a/debian/watch +++ b/debian/watch @@ -1,5 +1,5 @@ -# format version number, currently 3; this line is compulsory! -version=3 +# format version number, currently 4; this line is compulsory! +version=4 # the package is located on my own site, github deprecated downloads opts=pgpsigurlmangle=s/$/.asc/ \ -- 2.39.2 From aabcfc1f1caa0007abbddeac0ce7d1f4db7218a2 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 29 Nov 2020 21:25:22 +0100 Subject: [PATCH 02/16] Update standards version (no changes needed) --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 910a3bc..e90b512 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Build-Depends: debhelper-compat (= 12), dh-python, python3-all, python3-all-dev, python3-all-dbg, python3-setuptools, python3-sphinx -Standards-Version: 4.2.1 +Standards-Version: 4.5.1 Homepage: https://pyxattr.k1024.org/ Vcs-Browser: https://salsa.debian.org/debian/python-pyxattr Vcs-Git: https://salsa.debian.org/debian/python-pyxattr.git -- 2.39.2 From ed415c62cdee506a056c0722f53edca68a25c5bc Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 29 Nov 2020 21:28:03 +0100 Subject: [PATCH 03/16] Bump debhelper compat version --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index e90b512..01479dc 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: python-pyxattr Section: python Priority: optional Maintainer: Iustin Pop -Build-Depends: debhelper-compat (= 12), dh-python, +Build-Depends: debhelper-compat (= 13), dh-python, python3-all, python3-all-dev, python3-all-dbg, python3-setuptools, python3-sphinx -- 2.39.2 From 6e7843229b3ecfe0a0e7d8ede19553a25729f797 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 29 Nov 2020 21:31:29 +0100 Subject: [PATCH 04/16] Add build-depends on python3-recommonmark MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Oops… --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 01479dc..14db048 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,7 @@ Maintainer: Iustin Pop Build-Depends: debhelper-compat (= 13), dh-python, python3-all, python3-all-dev, python3-all-dbg, python3-setuptools, - python3-sphinx + python3-sphinx, python3-recommonmark Standards-Version: 4.5.1 Homepage: https://pyxattr.k1024.org/ Vcs-Browser: https://salsa.debian.org/debian/python-pyxattr -- 2.39.2 From d01517864c66412fd7cf92aebcb7aaaf6364ec35 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 29 Nov 2020 21:29:24 +0100 Subject: [PATCH 05/16] Final changelog bump for 0.7.2-1 --- debian/changelog | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 6370c9c..f72ac83 100644 --- a/debian/changelog +++ b/debian/changelog @@ -8,8 +8,11 @@ python-pyxattr (0.7.2-1) unstable; urgency=medium [ Iustin Pop ] * New upstream version, officially dropping Python 2 support, which allows better compatibility with Python 3, e.g. Path objects support. + * Minor refresh of packaging (debhelper compat, standards version, watch + file version, etc.). + * Drop the easy-doc patch, it is actually harmful. - -- Iustin Pop Sun, 29 Nov 2020 21:09:12 +0100 + -- Iustin Pop Sun, 29 Nov 2020 21:28:46 +0100 python-pyxattr (0.6.1-2) unstable; urgency=medium -- 2.39.2 From 1bc352f3e4313ba55fea3f21fe4b80bdfc24b1c2 Mon Sep 17 00:00:00 2001 From: Debian Janitor Date: Mon, 11 Oct 2021 14:06:56 +0000 Subject: [PATCH 06/16] Remove constraints unnecessary since buster * python-pyxattr-doc: Drop versioned constraint on python-pyxattr in Replaces. * python-pyxattr-doc: Drop versioned constraint on python-pyxattr in Breaks. Changes-By: deb-scrub-obsolete --- debian/changelog | 9 +++++++++ debian/control | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index f72ac83..2e16034 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +python-pyxattr (0.7.2-2) UNRELEASED; urgency=medium + + * Remove constraints unnecessary since buster: + + python-pyxattr-doc: Drop versioned constraint on python-pyxattr in + Replaces. + + python-pyxattr-doc: Drop versioned constraint on python-pyxattr in Breaks. + + -- Debian Janitor Mon, 11 Oct 2021 14:06:56 -0000 + python-pyxattr (0.7.2-1) unstable; urgency=medium [ Debian Janitor ] diff --git a/debian/control b/debian/control index 14db048..693575e 100644 --- a/debian/control +++ b/debian/control @@ -42,8 +42,6 @@ Description: module for manipulating filesystem extended attributes (Python3 deb Package: python-pyxattr-doc Architecture: all Section: doc -Replaces: python-pyxattr (<< 0.5.6-1) -Breaks: python-pyxattr (<< 0.5.6-1) Depends: ${misc:Depends}, ${sphinxdoc:Depends} Multi-Arch: foreign Description: module for manipulating filesystem extended attributes (documentation) -- 2.39.2 From 8850dd0684aed15b75ee2b6c0f6836b0e8344c5f Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Fri, 26 Nov 2021 23:39:31 +0100 Subject: [PATCH 07/16] Remove dbg package and prepare new upload --- debian/changelog | 10 ++++++++-- debian/control | 18 ++---------------- debian/rules | 4 ---- debian/tests/run-testsuite-if-attrs-enabled | 2 -- debian/tests/simple | 1 - 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/debian/changelog b/debian/changelog index 2e16034..10c3d20 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,11 +1,17 @@ -python-pyxattr (0.7.2-2) UNRELEASED; urgency=medium +python-pyxattr (0.7.2-2) unstable; urgency=medium + [ Debian Janitor ] * Remove constraints unnecessary since buster: + python-pyxattr-doc: Drop versioned constraint on python-pyxattr in Replaces. + python-pyxattr-doc: Drop versioned constraint on python-pyxattr in Breaks. - -- Debian Janitor Mon, 11 Oct 2021 14:06:56 -0000 + [ Iustin Pop ] + * Remove debug package; no reverse deps, so straightforward (Closes: + #994366). + * Bump standards version (no changes needed). + + -- Iustin Pop Fri, 26 Nov 2021 20:08:27 +0100 python-pyxattr (0.7.2-1) unstable; urgency=medium diff --git a/debian/control b/debian/control index 693575e..6a3e794 100644 --- a/debian/control +++ b/debian/control @@ -3,10 +3,10 @@ Section: python Priority: optional Maintainer: Iustin Pop Build-Depends: debhelper-compat (= 13), dh-python, - python3-all, python3-all-dev, python3-all-dbg, + python3-all, python3-all-dev, python3-setuptools, python3-sphinx, python3-recommonmark -Standards-Version: 4.5.1 +Standards-Version: 4.6.0.1 Homepage: https://pyxattr.k1024.org/ Vcs-Browser: https://salsa.debian.org/debian/python-pyxattr Vcs-Git: https://salsa.debian.org/debian/python-pyxattr.git @@ -25,20 +25,6 @@ Description: module for manipulating filesystem extended attributes (Python3) . This package contains the library for Python 3. -Package: python3-pyxattr-dbg -Section: debug -Architecture: any -Depends: python3-pyxattr (= ${binary:Version}), python3-dbg, - ${shlibs:Depends}, ${misc:Depends}, ${python3:Depends} -Provides: ${python3:Provides} -Multi-Arch: same -Description: module for manipulating filesystem extended attributes (Python3 debug version) - pyxattr is a Python interface to the libattr library. It allows - manipulation of the filesystem extended attributes present in some - operating systems (GNU/Linux included). - . - This package contains the library for the Python 3 debug interpreter. - Package: python-pyxattr-doc Architecture: all Section: doc diff --git a/debian/rules b/debian/rules index f810cba..bc83be3 100755 --- a/debian/rules +++ b/debian/rules @@ -26,11 +26,7 @@ override_dh_auto_clean: dh_auto_clean $(MAKE) clean -override_dh_strip: - dh_strip -ppython3-pyxattr --dbg-package=python3-pyxattr-dbg - override_dh_installdocs: - dh_installdocs --link-doc=python3-pyxattr -ppython3-pyxattr-dbg dh_installdocs -A --remaining-packages README.md override_dh_installchangelogs: diff --git a/debian/tests/run-testsuite-if-attrs-enabled b/debian/tests/run-testsuite-if-attrs-enabled index 15782cf..8c568f3 100755 --- a/debian/tests/run-testsuite-if-attrs-enabled +++ b/debian/tests/run-testsuite-if-attrs-enabled @@ -9,8 +9,6 @@ if setfattr -n user.foo -v bar "$TESTFILE"; then export TEST_DIR="$AUTOPKGTEST_TMP" echo "* testing Python 3" python3 tests/test_xattr.py - echo "* testing Python 3 debug package" - python3-dbg tests/test_xattr.py else echo "Temporary directory '$AUTOPKGTEST_TMP' doesn't have extended attributes enabled" echo "Skipping the tests :(" diff --git a/debian/tests/simple b/debian/tests/simple index aff76be..8d0f46f 100755 --- a/debian/tests/simple +++ b/debian/tests/simple @@ -7,4 +7,3 @@ cd "$AUTOPKGTEST_TMP/" # and now simply import the modules: python3 -c 'import xattr; print(xattr); print(xattr.__version__)' -python3-dbg -c 'import xattr; print(xattr); print(xattr.__version__)' -- 2.39.2 From 41cdeaecb8a11f78dc52ef139d71e39d147b2c1c Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sat, 27 Nov 2021 01:12:41 +0100 Subject: [PATCH 08/16] Ignore egg-info files --- debian/changelog | 4 +++- debian/source/options | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 debian/source/options diff --git a/debian/changelog b/debian/changelog index 10c3d20..c272db6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,10 @@ python-pyxattr (0.7.2-2) unstable; urgency=medium * Remove debug package; no reverse deps, so straightforward (Closes: #994366). * Bump standards version (no changes needed). + * Fix double-building (pbuild) by adding an ignore for egg-info/PKG-INFO + files. - -- Iustin Pop Fri, 26 Nov 2021 20:08:27 +0100 + -- Iustin Pop Sat, 27 Nov 2021 01:13:39 +0100 python-pyxattr (0.7.2-1) unstable; urgency=medium diff --git a/debian/source/options b/debian/source/options new file mode 100644 index 0000000..b2b7b88 --- /dev/null +++ b/debian/source/options @@ -0,0 +1 @@ +extend-diff-ignore="^[^/]+\.egg-info/" -- 2.39.2 From a9c2e960188ab295027929a8435f994b3b110378 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Thu, 19 Jan 2023 13:24:28 +0100 Subject: [PATCH 09/16] New upstream version 0.8.0 --- MANIFEST.in | 2 + Makefile | 11 +- NEWS | 15 ++ PKG-INFO | 14 +- README.md | 30 ++-- doc/conf.py | 10 +- doc/news.rst | 257 +++++++++++++++++++++++++++++++++++ doc/readme.md | 76 +++++++++++ pyxattr.egg-info/PKG-INFO | 14 +- pyxattr.egg-info/SOURCES.txt | 2 + setup.py | 3 +- tests/test_xattr.py | 5 + xattr.c | 47 +++---- 13 files changed, 418 insertions(+), 68 deletions(-) create mode 100644 doc/news.rst create mode 100644 doc/readme.md diff --git a/MANIFEST.in b/MANIFEST.in index 4960670..4c29306 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,8 @@ include Makefile include doc/conf.py include doc/index.rst include doc/module.rst +include doc/news.md +include doc/readme.md include setup.cfg include tests/test_xattr.py include tests/__init__.py diff --git a/Makefile b/Makefile index f57b8bf..0fe2199 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,13 @@ DOCDIR = doc DOCHTML = $(DOCDIR)/html DOCTREES = $(DOCDIR)/doctrees ALLSPHINXOPTS = -d $(DOCTREES) $(SPHINXOPTS) $(DOCDIR) -VERSION = 0.7.2 +VERSION = 0.8.0 FULLVER = pyxattr-$(VERSION) DISTFILE = $(FULLVER).tar.gz MODNAME = xattr.so RSTFILES = doc/index.rst doc/module.rst doc/news.rst doc/readme.md doc/conf.py -PYVERS = 3.4 3.5 3.6 3.7 3.8 3.9 +PYVERS = 3.7 3.8 3.9 3.10 REPS = 5 all: doc test @@ -25,12 +25,6 @@ $(DOCHTML)/index.html: $(MODNAME) $(RSTFILES) doc: $(DOCHTML)/index.html -doc/readme.md: README.md - ln -s ../README.md doc/readme.md - -doc/news.rst: NEWS - ln -s ../NEWS doc/news.rst - dist: fakeroot $(PYTHON) ./setup.py sdist @@ -89,7 +83,6 @@ coverage: clean: rm -rf $(DOCHTML) $(DOCTREES) - rm -f doc/readme.md doc/news.rst rm -f $(MODNAME) rm -f *.so rm -rf build diff --git a/NEWS b/NEWS index 87caf52..d92f428 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,21 @@ News ==== +Version 0.8.0 +------------- + +*Mon, 12 Dec 2022* + +Minor bugfix release, but due to lack of CI environments supporting old +Python versions, only Python 3.7+ is supported. Otherwise: + +* Snape3058@ found some refcount issues (see issue #35), these have been + fixed. +* Tested and enabled Python 3.10 support, dropped < 3.7. +* Various improvements to the CI environments. +* Move fully to `setuptools` (where available), in preparation for 3.12 + dropping `distutils` support. + Version 0.7.2 ------------- diff --git a/PKG-INFO b/PKG-INFO index efe5a0c..b088a2d 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,16 +1,13 @@ -Metadata-Version: 1.2 +Metadata-Version: 2.1 Name: pyxattr -Version: 0.7.2 +Version: 0.8.0 Summary: Filesystem extended attributes for python Home-page: http://pyxattr.k1024.org/ +Download-URL: http://pyxattr.k1024.org/downloads/ Author: Iustin Pop Author-email: iustin@k1024.org License: LGPL -Download-URL: http://pyxattr.k1024.org/downloads/ Project-URL: Bug Tracker, https://github.com/iustin/pyxattr/issues -Description: This is a C extension module for Python which - implements extended attributes manipulation. It is a wrapper on top - of the attr C library - see attr(5). Platform: Linux Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers @@ -23,3 +20,8 @@ Classifier: Operating System :: POSIX :: Linux Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Filesystems Requires-Python: >=3.4 +License-File: COPYING + +This is a C extension module for Python which +implements extended attributes manipulation. It is a wrapper on top +of the attr C library - see attr(5). diff --git a/README.md b/README.md index 693be67..59e5c0f 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is the pyxattr module, a Python extension module which gives access to the extended attributes for filesystem objects available in some operating systems. -[![Travis](https://img.shields.io/travis/iustin/pyxattr)](https://travis-ci.org/iustin/pyxattr) +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/iustin/pyxattr/CI)](https://github.com/iustin/pyxattr/actions/workflows/ci.yml) [![Codecov](https://img.shields.io/codecov/c/github/iustin/pyxattr)](https://codecov.io/gh/iustin/pyxattr) [![Read the Docs](https://img.shields.io/readthedocs/pyxattr)](http://pyxattr.readthedocs.io/en/latest/?badge=latest) [![GitHub issues](https://img.shields.io/github/issues/iustin/pyxattr)](https://github.com/iustin/pyxattr/issues) @@ -23,23 +23,31 @@ repository is either at or at ## Requirements -The current supported Python versions are 3.4+ (tested up to 3.9). +The current supported Python versions are 3.7+ (tested up to 3.10), or +PyPy versions 3.7+ (tested up to 3.9). The code should currently be +compatible down to Python 3.4, but such versions are no longer tested. The library has been written and tested on Linux, kernel v2.4 or -later, with XFS and ext2/ext3/ext3 file systems. If any other platform -implements the same behaviour, pyxattr could be used. +later, with XFS and ext2/ext3/ext4 file systems, and MacOS recent +versions. If any other platform implements the same behaviour, +pyxattr could be used. -You need to have the setuptools tool installed in order to build and -install the module, and for building the documentation you need to -have Sphinx installed. +To build the module from source, you will need both a Python +development environment/libraries and the C compiler, plus the +setuptools tool installed, and for building the documentation you need +to have Sphinx installed. The exact list of dependencies depends on +the operating system/distribution, but should be something along the +lines of `python3-devel` (RedHat), `python3-all-dev` (Debian), etc. -Alternatively, you can install directly from pip: +Alternatively, you can install directly from pip after installing the +above depedencies (C compiler, Python development libraries): - $ pip install pyxattr + pip install pyxattr -Or from your distribution, e.g. in Debian: +Or you can install already compiled versions from your distribution, +e.g. in Debian: - $ sudo apt install python3-pyxattr + sudo apt install python3-pyxattr ## Basic example diff --git a/doc/conf.py b/doc/conf.py index c48b6d7..f5b8ed8 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -48,9 +48,9 @@ copyright = u'2002, 2003, 2006, 2008, 2012, 2013, 2014, 2015, Iustin Pop' # built documents. # # The short X.Y version. -version = '0.7.2' +version = '0.8.0' # The full version, including alpha/beta/rc tags. -release = '0.7.2' +release = '0.8.0' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -90,12 +90,6 @@ pygments_style = 'sphinx' keep_warnings = True -# Note: this is still needed in Sphinx 1.8 with recommonmark 0.4.0 -# (https://github.com/readthedocs/recommonmark/issues/119): -source_parsers = { - '.md': 'recommonmark.parser.CommonMarkParser', -} - # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for diff --git a/doc/news.rst b/doc/news.rst new file mode 100644 index 0000000..d92f428 --- /dev/null +++ b/doc/news.rst @@ -0,0 +1,257 @@ +News +==== + +Version 0.8.0 +------------- + +*Mon, 12 Dec 2022* + +Minor bugfix release, but due to lack of CI environments supporting old +Python versions, only Python 3.7+ is supported. Otherwise: + +* Snape3058@ found some refcount issues (see issue #35), these have been + fixed. +* Tested and enabled Python 3.10 support, dropped < 3.7. +* Various improvements to the CI environments. +* Move fully to `setuptools` (where available), in preparation for 3.12 + dropping `distutils` support. + +Version 0.7.2 +------------- + +*Sun, 29 Nov 2020* + +Minor release: + +* Expand testing by adding better mixed-access checks (e.g. set via + symlink and read on file) and by not leaking resources during tests. +* Enable testing with Python 3.9 and confirm compatibility with it. +* Fix documentation building with Sphinx 3.0+. + +Version 0.7.1 +------------- + +*released Tue, 26 Nov 2019* + +Typo fix release in the bug tracker link :/ + +Version 0.7.0 +------------- + +*released Tue, 26 Nov 2019* + +Major change: drop compatibility with Python 2, which allows significant +code cleanups. + +Other changes: + +* Switch internal implementation of argument parsing to a built-in one + (`PyUnicode_FSConverter`), which brings automatic support for + path-like objects in Python 3.6+ (#20), and also a more uniform + handling of Unicode path arguments with respect to other Python code. +* Fix missing error check in list operations in `get_all` (#17). +* Switch test library to pytest; not that a reasonable recent version is + needed. Additionally, expand test coverage, although not directly + visible in actual coverage reports… + +Version 0.6.1 +------------- + +*released Tue, 24 Jul 2018* + +Minor bugfix, performance and compatibility release. + +* Minor compatibility fix: on Linux, drop the use of the `attr` library, + and instead switch to the glibc header `sys/xattr.h`, which is + provided for a really long time (since glibc 2.3). The formerly used + header `attr/xattr.h` has been removed from the `attr` library in + version 2.4.48. Fix provided by Lars Wendler, many thanks! +* Release the GIL when performing I/O. Patch proposed by xwhuang, many + thanks. I tested this a long while back it seemed to impact + performance on local filesystems, but upon further inspection, the + downsides are minor (between 0 and 5%, in many cases negligible). For + remote or slow filesystems, this should allow much increased + parallelism. +* Fix symlink set operation on MacOS X; bugfix provided by adamlin, much + appreciated! This also uncovered testing problems related to symlinks, + which are now fixed (the bug would be caught by the updated tests). + +Version 0.6.0 +------------- + +*released Mon, 23 Jan 2017* + +Bugfix and feature release (hence the version bump). + +The main change is to the implementation of how attributes are listed +and read. This was done due to existing race issues when attributes are +modified while being read (github issue #12), but basically all various +internal paths that dealt with retrieving an attribute value or listing +attributes were unified in a single helper function that does handle +such concurrent modifications. As a side effect, the size of the buffers +used for such reads have changed, which (depending on attribute value) +might change the trade-off between number of syscalls done and memory +usage. + +As feature release, OSX support was contributed by Adam Knight +, thanks a lot! I don't have access to OSX so the testing +for it is done via Travis builds; please report any issues. + +Version 0.5.6 +------------- + +*released Sat, 09 Apr 2016* + +Small bugfix release: + +* Fixes some sign-compare warnings +* Fixes potential name truncation in merge_ns() +* Fixes building on systems which don't have ENODATA + +Tested with Python 2.7.11, Python 3.5.1 and PyPy 5.0.1. + +Version 0.5.5 +------------- + +*released Fri, 01 May 2015* + +Bugfix release: + +* fixes some more memory leaks when handling out-of-memory in get_all() + function +* improve error reporting when an attribute disappears after we asked + for its length but before we managed to read it +* fix int/size_t issues found by RedHat/Fedora, + https://bugzilla.redhat.com/show_bug.cgi?id=1127310; the fix is + different than their fix, but it should accomplish the same thing +* convert all code to only do explicit casts after checking boundaries, + making the code `-Wconversion`-clean (although that warning is not + enabled by default) + +Version 0.5.4 +------------- + +*released Thu, 30 Apr 2015* + +Fix memory leaks on some of the error-handling paths of the `get()` +function. + +Version 0.5.3 +------------- + +*released Fri, 23 May 2014* + +Small optimisations release: + +* ari edelkind contributed a speed-up optimisation for handling of files + without xattrs (which is, in general, the expected case) +* Jonas Borgström contributed a behaviour change to the handling of file + names: under Python 3 and up, unicode paths are encoded/decoded using + the 'surogatee' handler, instead of the 'strict' handler; while this + can hide encoding errors, it mirrors what Python libraries do + (e.g. see os.fsencode/fsdecode) +* Sean Patrick Santos contributed improvements to the test suite so that + it can be used even on files systems which have built-in attributes + (e.g. when using SELinux, or NFSv4); to enable this, define the + attributes in the TEST_IGNORE_XATTRS environment variable + +Version 0.5.2 +------------- + +*released Thu, 03 Jan 2013* + +Bug-fix release. Thanks to Michał Górny, it looked like the library had +problem running under pypy, but actually there was a bug in the +PyArg_ParseTuple use of et# (signed vs. unsigned, and lack of compiler +warnings). This was fixed, and now the test suite passed with many +CPython versions and PyPy (version 1.9). + +Version 0.5.1 +------------- + +*released Wed, 16 May 2012* + +Bug-fix release. Thanks to Dave Malcolm and his cpychecker tool, a +number of significant bugs (refcount leaks and potential NULL-pointer +dereferences) have been fixed. + +Furthermore, compatibility with Python 3 has been improved; this however +required changing the meaning of the ``namespace`` argument to the +functions: if passed, None is no longer a valid value; pass an empty +string if (due to the structure of your program) you have to pass this +argument but want to specify no namespace. + +Also, the project home page has changed from SourceForge to GitHub, and +the documentation has been converted from epydoc-based to sphinx. + + +Version 0.5 +----------- + +*released Sun, 27 Dec 2009* + +Implemented support for Python 3. This required a significant change to +the C module, hence the new version number. + +Version 0.4 +----------- + +*released Mon, 30 Jun 2008* + +API +~~~ + +The old functions ({get,set,list,remove}xattr) are deprecated and replaced with +a new API that is namespace-aware and hopefully will allow other OSes (e.g. +FreeBSD) to be supported more naturally. + +Both the old and the new API are supported in the 0.4 versions, however users +are encouraged to migrate to the new API. + +New features +~~~~~~~~~~~~ + +A new bulk get function called get_all() has been added that should be somewhat +faster in case of querying files which have many attributes. + +License +~~~~~~~ + +Since LGPLv3 is not compatible with GPLv2 (which unfortunately I didn't realize +before), the license was changed to LGPLv2.1 or later. + +Internals +~~~~~~~~~ + +Unittest coverage was improved. + +Version 0.3 +----------- + +*released Sun, 09 Mar 2008* + +* changed licence from GPL to LGPL (3 or later) +* changed listxattr return type from tuple to a list +* developer-related: added unittests + +Version 0.2.2 +------------- + +*released Sun, 01 Jul 2007* + +* fixed listing symlink xattrs + +Version 0.2.1 +------------- + +*released Sat, 11 Feb 2006* + +* fixed a bug when reading symlink EAs (you weren't able to + do it, actually) +* fixed a possible memory leak when the actual read of the EA + failed but the call to get the length of the EA didn't + +.. Local Variables: +.. mode: rst +.. fill-column: 72 +.. End: diff --git a/doc/readme.md b/doc/readme.md new file mode 100644 index 0000000..59e5c0f --- /dev/null +++ b/doc/readme.md @@ -0,0 +1,76 @@ +# pyxattr + +This is the pyxattr module, a Python extension module which gives access +to the extended attributes for filesystem objects available in some +operating systems. + +[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/iustin/pyxattr/CI)](https://github.com/iustin/pyxattr/actions/workflows/ci.yml) +[![Codecov](https://img.shields.io/codecov/c/github/iustin/pyxattr)](https://codecov.io/gh/iustin/pyxattr) +[![Read the Docs](https://img.shields.io/readthedocs/pyxattr)](http://pyxattr.readthedocs.io/en/latest/?badge=latest) +[![GitHub issues](https://img.shields.io/github/issues/iustin/pyxattr)](https://github.com/iustin/pyxattr/issues) +![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/iustin/pyxattr) +[![GitHub release (latest by date)](https://img.shields.io/github/v/release/iustin/pyxattr)](https://github.com/iustin/pyxattr/releases) +[![PyPI](https://img.shields.io/pypi/v/pyxattr)](https://pypi.org/project/pyxattr/) +![Debian package](https://img.shields.io/debian/v/python-pyxattr) +![Ubuntu package](https://img.shields.io/ubuntu/v/python-pyxattr) +![GitHub Release Date](https://img.shields.io/github/release-date/iustin/pyxattr) +![GitHub commits since latest release](https://img.shields.io/github/commits-since/iustin/pyxattr/latest) +![GitHub last commit](https://img.shields.io/github/last-commit/iustin/pyxattr) + +Downloads: go to . The source +repository is either at or at +. + +## Requirements + +The current supported Python versions are 3.7+ (tested up to 3.10), or +PyPy versions 3.7+ (tested up to 3.9). The code should currently be +compatible down to Python 3.4, but such versions are no longer tested. + +The library has been written and tested on Linux, kernel v2.4 or +later, with XFS and ext2/ext3/ext4 file systems, and MacOS recent +versions. If any other platform implements the same behaviour, +pyxattr could be used. + +To build the module from source, you will need both a Python +development environment/libraries and the C compiler, plus the +setuptools tool installed, and for building the documentation you need +to have Sphinx installed. The exact list of dependencies depends on +the operating system/distribution, but should be something along the +lines of `python3-devel` (RedHat), `python3-all-dev` (Debian), etc. + +Alternatively, you can install directly from pip after installing the +above depedencies (C compiler, Python development libraries): + + pip install pyxattr + +Or you can install already compiled versions from your distribution, +e.g. in Debian: + + sudo apt install python3-pyxattr + +## Basic example + + >>> import xattr + >>> xattr.listxattr("file.txt") + ['user.mime_type'] + >>> xattr.getxattr("file.txt", "user.mime_type") + 'text/plain' + >>> xattr.setxattr("file.txt", "user.comment", "Simple text file") + >>> xattr.listxattr("file.txt") + ['user.mime_type', 'user.comment'] + >>> xattr.removexattr ("file.txt", "user.comment") + +## License + +pyxattr is Copyright 2002-2008, 2012-2015 Iustin Pop. + +pyxattr is free software; you can redistribute it and/or modify it under the +terms of the GNU Lesser General Public License as published by the Free +Software Foundation; either version 2.1 of the License, or (at your option) any +later version. See the COPYING file for the full license terms. + +Note that previous versions had different licenses: version 0.3 was licensed +under LGPL version 3 (which, I realized later, is not compatible with GPLv2, +hence the change to LGPL 2.1), and even older versions were licensed under GPL +v2 or later. diff --git a/pyxattr.egg-info/PKG-INFO b/pyxattr.egg-info/PKG-INFO index efe5a0c..b088a2d 100644 --- a/pyxattr.egg-info/PKG-INFO +++ b/pyxattr.egg-info/PKG-INFO @@ -1,16 +1,13 @@ -Metadata-Version: 1.2 +Metadata-Version: 2.1 Name: pyxattr -Version: 0.7.2 +Version: 0.8.0 Summary: Filesystem extended attributes for python Home-page: http://pyxattr.k1024.org/ +Download-URL: http://pyxattr.k1024.org/downloads/ Author: Iustin Pop Author-email: iustin@k1024.org License: LGPL -Download-URL: http://pyxattr.k1024.org/downloads/ Project-URL: Bug Tracker, https://github.com/iustin/pyxattr/issues -Description: This is a C extension module for Python which - implements extended attributes manipulation. It is a wrapper on top - of the attr C library - see attr(5). Platform: Linux Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers @@ -23,3 +20,8 @@ Classifier: Operating System :: POSIX :: Linux Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Filesystems Requires-Python: >=3.4 +License-File: COPYING + +This is a C extension module for Python which +implements extended attributes manipulation. It is a wrapper on top +of the attr C library - see attr(5). diff --git a/pyxattr.egg-info/SOURCES.txt b/pyxattr.egg-info/SOURCES.txt index f9162da..14ef93e 100644 --- a/pyxattr.egg-info/SOURCES.txt +++ b/pyxattr.egg-info/SOURCES.txt @@ -9,6 +9,8 @@ xattr.c doc/conf.py doc/index.rst doc/module.rst +doc/news.rst +doc/readme.md pyxattr.egg-info/PKG-INFO pyxattr.egg-info/SOURCES.txt pyxattr.egg-info/dependency_links.txt diff --git a/setup.py b/setup.py index ac5c82b..d4b2c72 100755 --- a/setup.py +++ b/setup.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import distutils import platform try: from setuptools import setup, Extension @@ -10,7 +9,7 @@ except ImportError: long_desc = """This is a C extension module for Python which implements extended attributes manipulation. It is a wrapper on top of the attr C library - see attr(5).""" -version = "0.7.2" +version = "0.8.0" author = "Iustin Pop" author_email = "iustin@k1024.org" libraries = [] diff --git a/tests/test_xattr.py b/tests/test_xattr.py index 4f3e663..40183f8 100644 --- a/tests/test_xattr.py +++ b/tests/test_xattr.py @@ -151,6 +151,10 @@ NOT_BEFORE_36 = pytest.mark.xfail(condition="sys.version_info < (3,6)", NOT_PYPY = pytest.mark.xfail(condition="platform.python_implementation() == 'PyPy'", strict=False) +NOT_MACOSX = pytest.mark.xfail(condition="sys.platform.startswith('darwin')", + reason="Test not supported on MacOS", + strict=True) + # Note: user attributes are only allowed on files and directories, so # we have to skip the symlinks here. See xattr(7). ITEMS_P = [ @@ -438,6 +442,7 @@ def test_binary_payload(subject): assert xattr.get_all(item, namespace=NAMESPACE) == [(USER_NN, BINVAL)] xattr.remove(item, USER_ATTR) +@NOT_MACOSX def test_symlinks_user_fail(testdir, use_dangling): _, sname = get_symlink(testdir, dangling=use_dangling) with pytest.raises(IOError): diff --git a/xattr.c b/xattr.c index e118f79..31ad87f 100644 --- a/xattr.c +++ b/xattr.c @@ -311,13 +311,11 @@ static int _remove_obj(target_t *tgt, const char *name) { * - buffer: pointer to either an already allocated memory area (in * which case size contains its current size), or NULL to * allocate. In all cases (success or failure), the caller should - * deallocate the buffer, using PyMem_Free(). Note that if size is - * zero but buffer already points to allocate memory, it will be - * ignored/leaked. + * deallocate the buffer, using PyMem_Free(). * - size: either size of current buffer (if non-NULL), or size for - * initial allocation (if non-zero), or a zero value which means - * auto-allocate buffer with automatically queried size. Value will - * be updated upon return with the current buffer size. + * initial allocation; zero means use a hardcoded initial buffer + * size (ESTIMATE_ATTR_SIZE). The value will be updated upon return + * with the current buffer size. * - io_errno: if non-NULL, the actual errno will be recorded here; if * zero, the call was successful and the output/size/nval are valid. * @@ -354,18 +352,9 @@ static ssize_t _generic_get(buf_getter getter, target_t *tgt, } /* Initialize the buffer, if needed. */ - if (*size == 0 || *buffer == NULL) { - if (*size == 0) { - ssize_t nalloc; - if ((nalloc = getter(tgt, name, NULL, 0)) == -1) { - EXIT_IOERROR(); - } - if (nalloc == 0) { - /* Empty, so no need to retrieve it. */ - return 0; - } - *size = nalloc; - } + if (*buffer == NULL) { + if (*size == 0) + *size = ESTIMATE_ATTR_SIZE; if((*buffer = PyMem_Malloc(*size)) == NULL) { PyErr_NoMemory(); return -1; @@ -443,7 +432,7 @@ pygetxattr(PyObject *self, PyObject *args) char *attrname = NULL; char *buf = NULL; ssize_t nret; - size_t nalloc = ESTIMATE_ATTR_SIZE; + size_t nalloc = 0; PyObject *res; /* Parse the arguments */ @@ -507,7 +496,7 @@ xattr_get(PyObject *self, PyObject *args, PyObject *keywds) char *buf = NULL; const char *ns = NULL; ssize_t nret; - size_t nalloc = ESTIMATE_ATTR_SIZE; + size_t nalloc = 0; PyObject *res = NULL; static char *kwlist[] = {"item", "name", "nofollow", "namespace", NULL}; @@ -591,7 +580,7 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds) const char *ns = NULL; char *buf_list = NULL, *buf_val = NULL; const char *s; - size_t nalloc = ESTIMATE_ATTR_SIZE; + size_t nalloc = 0; ssize_t nlist, nval; PyObject *mylist; target_t tgt; @@ -621,7 +610,7 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds) goto free_buf_list; } - nalloc = ESTIMATE_ATTR_SIZE; + nalloc = 0; /* Create and insert the attributes as strings in the list */ for(s = buf_list; s - buf_list < nlist; s += strlen(s) + 1) { PyObject *my_tuple; @@ -645,11 +634,12 @@ get_all(PyObject *self, PyObject *args, PyObject *keywds) Py_DECREF(mylist); goto free_buf_val; } - if(PyList_Append(mylist, my_tuple) < 0) { + int lappend_ret = PyList_Append(mylist, my_tuple); + Py_DECREF(my_tuple); + if(lappend_ret < 0) { Py_DECREF(mylist); goto free_buf_val; } - Py_DECREF(my_tuple); } /* Successful exit */ @@ -970,7 +960,7 @@ pylistxattr(PyObject *self, PyObject *args) char *buf = NULL; int nofollow = 0; ssize_t nret; - size_t nalloc = ESTIMATE_ATTR_SIZE; + size_t nalloc = 0; PyObject *myarg; PyObject *mylist; Py_ssize_t nattrs; @@ -1053,7 +1043,7 @@ xattr_list(PyObject *self, PyObject *args, PyObject *keywds) char *buf = NULL; int nofollow = 0; ssize_t nret; - size_t nalloc = ESTIMATE_ATTR_SIZE; + size_t nalloc = 0; PyObject *myarg; PyObject *res; const char *ns = NULL; @@ -1216,6 +1206,10 @@ PyInit_xattr(void) goto err_out; if((ns_user = PyBytes_FromString("user")) == NULL) goto err_out; + + /* Add the new objects to the module */ + /* TODO: after switching to min 3.10, use the *Ref version, and simplify + the error handling. */ if(PyModule_AddObject(m, "NS_SECURITY", ns_security) < 0) goto err_out; ns_security = NULL; @@ -1236,5 +1230,6 @@ PyInit_xattr(void) Py_XDECREF(ns_trusted); Py_XDECREF(ns_system); Py_XDECREF(ns_security); + Py_DECREF(m); INITERROR; } -- 2.39.2 From dca3b8a3c8546776306c31117058caa1a068ae24 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Thu, 19 Jan 2023 13:11:33 +0100 Subject: [PATCH 10/16] Bump standards version --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 6a3e794..76e8895 100644 --- a/debian/control +++ b/debian/control @@ -6,7 +6,7 @@ Build-Depends: debhelper-compat (= 13), dh-python, python3-all, python3-all-dev, python3-setuptools, python3-sphinx, python3-recommonmark -Standards-Version: 4.6.0.1 +Standards-Version: 4.6.2 Homepage: https://pyxattr.k1024.org/ Vcs-Browser: https://salsa.debian.org/debian/python-pyxattr Vcs-Git: https://salsa.debian.org/debian/python-pyxattr.git -- 2.39.2 From 08fb9c6939c618936c9ad4bf1070e16c4c326755 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Thu, 19 Jan 2023 13:11:48 +0100 Subject: [PATCH 11/16] Re-enable PIE builds and also enable LTO Both seem to just work? --- debian/rules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index bc83be3..6805538 100755 --- a/debian/rules +++ b/debian/rules @@ -9,7 +9,7 @@ export DH_OPTIONS export PYBUILD_NAME = pyxattr export PYBUILD_DISABLE = test -export DEB_BUILD_MAINT_OPTIONS = hardening=+all,-pie +export DEB_BUILD_MAINT_OPTIONS = hardening=+all optimize=+lto DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk -- 2.39.2 From 04b8b5daa6d7591ece411df57c2d32dd01dc6fa9 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Thu, 19 Jan 2023 13:14:24 +0100 Subject: [PATCH 12/16] Bump changelog for the new version and mark bugs fixes --- debian/changelog | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debian/changelog b/debian/changelog index c272db6..f7e403b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +python-pyxattr (0.8.0-1) unstable; urgency=medium + + * New upstream version, one memory leak on an error path and otherwise + trivial changes. + * Bump standards version (no changes needed, AFACIS). + * Re-enable pie, since it now builds correctly with it (Closes: #986191). + * Enable LTO, looks like more recent Python allows building with it + (Closes: #1015600). + + -- Iustin Pop Thu, 19 Jan 2023 12:44:31 +0100 + python-pyxattr (0.7.2-2) unstable; urgency=medium [ Debian Janitor ] -- 2.39.2 From dfa09e5c1754666e3e49ab5d5ac311796dad2ec7 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sun, 22 Jan 2023 12:32:48 +0100 Subject: [PATCH 13/16] Drop suggests on the old dbg package --- debian/changelog | 6 ++++++ debian/control | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f7e403b..3b2ee10 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +python-pyxattr (0.8.0-2) UNRELEASED; urgency=medium + + * Drop the suggests on the -dbg package, was remove a long time ago. + + -- Iustin Pop Sun, 22 Jan 2023 12:31:44 +0100 + python-pyxattr (0.8.0-1) unstable; urgency=medium * New upstream version, one memory leak on an error path and otherwise diff --git a/debian/control b/debian/control index 76e8895..2cad628 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Package: python3-pyxattr Architecture: any Depends: ${python3:Depends}, ${shlibs:Depends}, ${misc:Depends} Provides: ${python3:Provides} -Suggests: python3-pyxattr-dbg, python-pyxattr-doc +Suggests: python-pyxattr-doc Multi-Arch: same Description: module for manipulating filesystem extended attributes (Python3) pyxattr is a Python interface to the libattr library. It allows -- 2.39.2 From cdf3f992e053f25662a42253289bc83cffe68533 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 18 Apr 2023 22:23:26 +0200 Subject: [PATCH 14/16] New upstream version 0.8.1 --- MANIFEST.in | 4 +- Makefile | 6 +-- NEWS => NEWS.md | 82 +++++++++++++++--------------------- PKG-INFO | 8 ++-- README.md | 13 ++++-- doc/conf.py | 4 +- doc/contributing.md | 65 ++++++++++++++++++++++++++++ doc/index.rst | 4 +- doc/{news.rst => news.md} | 82 +++++++++++++++--------------------- doc/readme.md | 13 ++++-- doc/security.md | 16 +++++++ pyxattr.egg-info/PKG-INFO | 8 ++-- pyxattr.egg-info/SOURCES.txt | 6 ++- setup.py | 8 ++-- 14 files changed, 194 insertions(+), 125 deletions(-) rename NEWS => NEWS.md (92%) create mode 100644 doc/contributing.md rename doc/{news.rst => news.md} (92%) create mode 100644 doc/security.md diff --git a/MANIFEST.in b/MANIFEST.in index 4c29306..5d433d5 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,5 @@ include COPYING -include NEWS +include NEWS.md include README.md include Makefile include doc/conf.py @@ -7,6 +7,8 @@ include doc/index.rst include doc/module.rst include doc/news.md include doc/readme.md +include doc/contributing.md +include doc/security.md include setup.cfg include tests/test_xattr.py include tests/__init__.py diff --git a/Makefile b/Makefile index 0fe2199..f476054 100644 --- a/Makefile +++ b/Makefile @@ -5,13 +5,13 @@ DOCDIR = doc DOCHTML = $(DOCDIR)/html DOCTREES = $(DOCDIR)/doctrees ALLSPHINXOPTS = -d $(DOCTREES) $(SPHINXOPTS) $(DOCDIR) -VERSION = 0.8.0 +VERSION = 0.8.1 FULLVER = pyxattr-$(VERSION) DISTFILE = $(FULLVER).tar.gz MODNAME = xattr.so -RSTFILES = doc/index.rst doc/module.rst doc/news.rst doc/readme.md doc/conf.py -PYVERS = 3.7 3.8 3.9 3.10 +RSTFILES = doc/index.rst doc/module.rst doc/news.md doc/readme.md doc/conf.py +PYVERS = 3.7 3.8 3.9 3.10 3.11 REPS = 5 all: doc test diff --git a/NEWS b/NEWS.md similarity index 92% rename from NEWS rename to NEWS.md index d92f428..b021388 100644 --- a/NEWS +++ b/NEWS.md @@ -1,8 +1,17 @@ -News -==== +# News -Version 0.8.0 -------------- +## Version 0.8.1 + +*Mon, 17 Apr 2023* + +Very minor release: + +* Fix the pypi declared python versions +* Add some more documentation - a security policy, and a contributing + guide. +* Restore yet again the CI environment :/ + +## Version 0.8.0 *Mon, 12 Dec 2022* @@ -16,8 +25,7 @@ Python versions, only Python 3.7+ is supported. Otherwise: * Move fully to `setuptools` (where available), in preparation for 3.12 dropping `distutils` support. -Version 0.7.2 -------------- +## Version 0.7.2 *Sun, 29 Nov 2020* @@ -28,15 +36,13 @@ Minor release: * Enable testing with Python 3.9 and confirm compatibility with it. * Fix documentation building with Sphinx 3.0+. -Version 0.7.1 -------------- +## Version 0.7.1 *released Tue, 26 Nov 2019* Typo fix release in the bug tracker link :/ -Version 0.7.0 -------------- +## Version 0.7.0 *released Tue, 26 Nov 2019* @@ -54,8 +60,7 @@ Other changes: needed. Additionally, expand test coverage, although not directly visible in actual coverage reports… -Version 0.6.1 -------------- +## Version 0.6.1 *released Tue, 24 Jul 2018* @@ -76,8 +81,7 @@ Minor bugfix, performance and compatibility release. appreciated! This also uncovered testing problems related to symlinks, which are now fixed (the bug would be caught by the updated tests). -Version 0.6.0 -------------- +## Version 0.6.0 *released Mon, 23 Jan 2017* @@ -97,8 +101,7 @@ As feature release, OSX support was contributed by Adam Knight , thanks a lot! I don't have access to OSX so the testing for it is done via Travis builds; please report any issues. -Version 0.5.6 -------------- +## Version 0.5.6 *released Sat, 09 Apr 2016* @@ -110,8 +113,7 @@ Small bugfix release: Tested with Python 2.7.11, Python 3.5.1 and PyPy 5.0.1. -Version 0.5.5 -------------- +## Version 0.5.5 *released Fri, 01 May 2015* @@ -128,16 +130,14 @@ Bugfix release: making the code `-Wconversion`-clean (although that warning is not enabled by default) -Version 0.5.4 -------------- +## Version 0.5.4 *released Thu, 30 Apr 2015* Fix memory leaks on some of the error-handling paths of the `get()` function. -Version 0.5.3 -------------- +## Version 0.5.3 *released Fri, 23 May 2014* @@ -155,8 +155,7 @@ Small optimisations release: (e.g. when using SELinux, or NFSv4); to enable this, define the attributes in the TEST_IGNORE_XATTRS environment variable -Version 0.5.2 -------------- +## Version 0.5.2 *released Thu, 03 Jan 2013* @@ -166,8 +165,7 @@ PyArg_ParseTuple use of et# (signed vs. unsigned, and lack of compiler warnings). This was fixed, and now the test suite passed with many CPython versions and PyPy (version 1.9). -Version 0.5.1 -------------- +## Version 0.5.1 *released Wed, 16 May 2012* @@ -185,21 +183,18 @@ Also, the project home page has changed from SourceForge to GitHub, and the documentation has been converted from epydoc-based to sphinx. -Version 0.5 ------------ +## Version 0.5 *released Sun, 27 Dec 2009* Implemented support for Python 3. This required a significant change to the C module, hence the new version number. -Version 0.4 ------------ +## Version 0.4 *released Mon, 30 Jun 2008* -API -~~~ +### API The old functions ({get,set,list,remove}xattr) are deprecated and replaced with a new API that is namespace-aware and hopefully will allow other OSes (e.g. @@ -208,25 +203,21 @@ FreeBSD) to be supported more naturally. Both the old and the new API are supported in the 0.4 versions, however users are encouraged to migrate to the new API. -New features -~~~~~~~~~~~~ +### New features A new bulk get function called get_all() has been added that should be somewhat faster in case of querying files which have many attributes. -License -~~~~~~~ +### License Since LGPLv3 is not compatible with GPLv2 (which unfortunately I didn't realize before), the license was changed to LGPLv2.1 or later. -Internals -~~~~~~~~~ +### Internals Unittest coverage was improved. -Version 0.3 ------------ +## Version 0.3 *released Sun, 09 Mar 2008* @@ -234,15 +225,13 @@ Version 0.3 * changed listxattr return type from tuple to a list * developer-related: added unittests -Version 0.2.2 -------------- +## Version 0.2.2 *released Sun, 01 Jul 2007* * fixed listing symlink xattrs -Version 0.2.1 -------------- +## Version 0.2.1 *released Sat, 11 Feb 2006* @@ -250,8 +239,3 @@ Version 0.2.1 do it, actually) * fixed a possible memory leak when the actual read of the EA failed but the call to get the length of the EA didn't - -.. Local Variables: -.. mode: rst -.. fill-column: 72 -.. End: diff --git a/PKG-INFO b/PKG-INFO index b088a2d..f1dc7c1 100644 --- a/PKG-INFO +++ b/PKG-INFO @@ -1,9 +1,9 @@ Metadata-Version: 2.1 Name: pyxattr -Version: 0.8.0 +Version: 0.8.1 Summary: Filesystem extended attributes for python -Home-page: http://pyxattr.k1024.org/ -Download-URL: http://pyxattr.k1024.org/downloads/ +Home-page: https://pyxattr.k1024.org/ +Download-URL: https://pyxattr.k1024.org/downloads/ Author: Iustin Pop Author-email: iustin@k1024.org License: LGPL @@ -19,7 +19,7 @@ Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX :: Linux Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Filesystems -Requires-Python: >=3.4 +Requires-Python: >=3.7 License-File: COPYING This is a C extension module for Python which diff --git a/README.md b/README.md index 59e5c0f..4cb49a1 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ This is the pyxattr module, a Python extension module which gives access to the extended attributes for filesystem objects available in some operating systems. -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/iustin/pyxattr/CI)](https://github.com/iustin/pyxattr/actions/workflows/ci.yml) +[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/iustin/pyxattr/ci.yml?branch=main)](https://github.com/iustin/pyxattr/actions/workflows/ci.yml) [![Codecov](https://img.shields.io/codecov/c/github/iustin/pyxattr)](https://codecov.io/gh/iustin/pyxattr) -[![Read the Docs](https://img.shields.io/readthedocs/pyxattr)](http://pyxattr.readthedocs.io/en/latest/?badge=latest) +[![Read the Docs](https://img.shields.io/readthedocs/pyxattr)](https://pyxattr.readthedocs.io/en/latest/?badge=latest) [![GitHub issues](https://img.shields.io/github/issues/iustin/pyxattr)](https://github.com/iustin/pyxattr/issues) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/iustin/pyxattr) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/iustin/pyxattr)](https://github.com/iustin/pyxattr/releases) @@ -16,11 +16,14 @@ operating systems. ![GitHub Release Date](https://img.shields.io/github/release-date/iustin/pyxattr) ![GitHub commits since latest release](https://img.shields.io/github/commits-since/iustin/pyxattr/latest) ![GitHub last commit](https://img.shields.io/github/last-commit/iustin/pyxattr) +[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7236/badge)](https://bestpractices.coreinfrastructure.org/projects/7236) Downloads: go to . The source -repository is either at or at +repository is either at or at . +See the `CONTRIBUTING.md` file for details on how to contribute. + ## Requirements The current supported Python versions are 3.7+ (tested up to 3.10), or @@ -49,6 +52,10 @@ e.g. in Debian: sudo apt install python3-pyxattr +## Security + +For reporting security vulnerabilities, please see `SECURITY.md`. + ## Basic example >>> import xattr diff --git a/doc/conf.py b/doc/conf.py index f5b8ed8..6924552 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -48,9 +48,9 @@ copyright = u'2002, 2003, 2006, 2008, 2012, 2013, 2014, 2015, Iustin Pop' # built documents. # # The short X.Y version. -version = '0.8.0' +version = '0.8.1' # The full version, including alpha/beta/rc tags. -release = '0.8.0' +release = '0.8.1' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/doc/contributing.md b/doc/contributing.md new file mode 100644 index 0000000..3e1a9d9 --- /dev/null +++ b/doc/contributing.md @@ -0,0 +1,65 @@ +# Contributing to pyxattr + +Hi, and thanks for any and all contributions! + +## Bugs and patches + +This is a small project, so let's keep things simple: + +- Please file all bug reports on github + (), as this allows + archival and discovery by other people; +- Send patches as pull requests; for larger changes, would be good to + first open a bug to discuss the plans; + +Due to simplicity, there are no old branches being kept alive, but if +it ever happens that a bug is found in older versions and there is +needed to support older Python versions, it is possible to do so. + +## Code standards + +There are no formal standards, but: + +- Code should be tested - this is why there's a [Codecov + integration](https://app.codecov.io/gh/iustin/pyxattr/tree/main). +- New functions should have good docstrings (in the C code). +- New functions/constants should be listed in the documentation, see + `doc/module.rst` for how to include them. +- All non-trivial changes should be listed in `NEWS.md` for further + inclusion in new releases documentation. Add an "unreleased" section + (if one doesn't exist yet) to list the changes. + +## Release process + +Right now, due to GPG signing, I'm doing releases and signing them +manually (offline, I mean). Basically, once GitHub workflows are fine: + +- Bump the version in all places - use `git grep -F $OLD_VER` and + update as needed. +- Ensure that `setup.py` has the right Python versions listed (bit me + more than once). +- Update the `NEWS.md` file is up to date (contents), and use the + right date. +- Check that the generated documentation (`make doc`) looks right. + +Then run these steps: + +``` +$ make clean +$ make distcheck # this leaves things in dist/ +$ git tag -m 'Release pyxattr-0.0.1' --sign v0.0.1 +$ gpg --sign -b -a dist/pyxattr-0.0.1.tar.gz +$ python3 -m twine upload dist/* +``` + +Separately: + +* Upload the `dist/` contents to GitHub and tag a new release. +* Upload the `dist/` contents to the old-style download area, + . + +Hopefully one day all this can be more automated. + +## Signing key + +The releases are currently signed by my key, see . diff --git a/doc/index.rst b/doc/index.rst index a918c2e..7179ace 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -12,7 +12,9 @@ Contents :maxdepth: 2 readme.md + contributing.md + security.md module.rst - news.rst + news.md Also see the :ref:`search`. diff --git a/doc/news.rst b/doc/news.md similarity index 92% rename from doc/news.rst rename to doc/news.md index d92f428..b021388 100644 --- a/doc/news.rst +++ b/doc/news.md @@ -1,8 +1,17 @@ -News -==== +# News -Version 0.8.0 -------------- +## Version 0.8.1 + +*Mon, 17 Apr 2023* + +Very minor release: + +* Fix the pypi declared python versions +* Add some more documentation - a security policy, and a contributing + guide. +* Restore yet again the CI environment :/ + +## Version 0.8.0 *Mon, 12 Dec 2022* @@ -16,8 +25,7 @@ Python versions, only Python 3.7+ is supported. Otherwise: * Move fully to `setuptools` (where available), in preparation for 3.12 dropping `distutils` support. -Version 0.7.2 -------------- +## Version 0.7.2 *Sun, 29 Nov 2020* @@ -28,15 +36,13 @@ Minor release: * Enable testing with Python 3.9 and confirm compatibility with it. * Fix documentation building with Sphinx 3.0+. -Version 0.7.1 -------------- +## Version 0.7.1 *released Tue, 26 Nov 2019* Typo fix release in the bug tracker link :/ -Version 0.7.0 -------------- +## Version 0.7.0 *released Tue, 26 Nov 2019* @@ -54,8 +60,7 @@ Other changes: needed. Additionally, expand test coverage, although not directly visible in actual coverage reports… -Version 0.6.1 -------------- +## Version 0.6.1 *released Tue, 24 Jul 2018* @@ -76,8 +81,7 @@ Minor bugfix, performance and compatibility release. appreciated! This also uncovered testing problems related to symlinks, which are now fixed (the bug would be caught by the updated tests). -Version 0.6.0 -------------- +## Version 0.6.0 *released Mon, 23 Jan 2017* @@ -97,8 +101,7 @@ As feature release, OSX support was contributed by Adam Knight , thanks a lot! I don't have access to OSX so the testing for it is done via Travis builds; please report any issues. -Version 0.5.6 -------------- +## Version 0.5.6 *released Sat, 09 Apr 2016* @@ -110,8 +113,7 @@ Small bugfix release: Tested with Python 2.7.11, Python 3.5.1 and PyPy 5.0.1. -Version 0.5.5 -------------- +## Version 0.5.5 *released Fri, 01 May 2015* @@ -128,16 +130,14 @@ Bugfix release: making the code `-Wconversion`-clean (although that warning is not enabled by default) -Version 0.5.4 -------------- +## Version 0.5.4 *released Thu, 30 Apr 2015* Fix memory leaks on some of the error-handling paths of the `get()` function. -Version 0.5.3 -------------- +## Version 0.5.3 *released Fri, 23 May 2014* @@ -155,8 +155,7 @@ Small optimisations release: (e.g. when using SELinux, or NFSv4); to enable this, define the attributes in the TEST_IGNORE_XATTRS environment variable -Version 0.5.2 -------------- +## Version 0.5.2 *released Thu, 03 Jan 2013* @@ -166,8 +165,7 @@ PyArg_ParseTuple use of et# (signed vs. unsigned, and lack of compiler warnings). This was fixed, and now the test suite passed with many CPython versions and PyPy (version 1.9). -Version 0.5.1 -------------- +## Version 0.5.1 *released Wed, 16 May 2012* @@ -185,21 +183,18 @@ Also, the project home page has changed from SourceForge to GitHub, and the documentation has been converted from epydoc-based to sphinx. -Version 0.5 ------------ +## Version 0.5 *released Sun, 27 Dec 2009* Implemented support for Python 3. This required a significant change to the C module, hence the new version number. -Version 0.4 ------------ +## Version 0.4 *released Mon, 30 Jun 2008* -API -~~~ +### API The old functions ({get,set,list,remove}xattr) are deprecated and replaced with a new API that is namespace-aware and hopefully will allow other OSes (e.g. @@ -208,25 +203,21 @@ FreeBSD) to be supported more naturally. Both the old and the new API are supported in the 0.4 versions, however users are encouraged to migrate to the new API. -New features -~~~~~~~~~~~~ +### New features A new bulk get function called get_all() has been added that should be somewhat faster in case of querying files which have many attributes. -License -~~~~~~~ +### License Since LGPLv3 is not compatible with GPLv2 (which unfortunately I didn't realize before), the license was changed to LGPLv2.1 or later. -Internals -~~~~~~~~~ +### Internals Unittest coverage was improved. -Version 0.3 ------------ +## Version 0.3 *released Sun, 09 Mar 2008* @@ -234,15 +225,13 @@ Version 0.3 * changed listxattr return type from tuple to a list * developer-related: added unittests -Version 0.2.2 -------------- +## Version 0.2.2 *released Sun, 01 Jul 2007* * fixed listing symlink xattrs -Version 0.2.1 -------------- +## Version 0.2.1 *released Sat, 11 Feb 2006* @@ -250,8 +239,3 @@ Version 0.2.1 do it, actually) * fixed a possible memory leak when the actual read of the EA failed but the call to get the length of the EA didn't - -.. Local Variables: -.. mode: rst -.. fill-column: 72 -.. End: diff --git a/doc/readme.md b/doc/readme.md index 59e5c0f..4cb49a1 100644 --- a/doc/readme.md +++ b/doc/readme.md @@ -4,9 +4,9 @@ This is the pyxattr module, a Python extension module which gives access to the extended attributes for filesystem objects available in some operating systems. -[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/iustin/pyxattr/CI)](https://github.com/iustin/pyxattr/actions/workflows/ci.yml) +[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/iustin/pyxattr/ci.yml?branch=main)](https://github.com/iustin/pyxattr/actions/workflows/ci.yml) [![Codecov](https://img.shields.io/codecov/c/github/iustin/pyxattr)](https://codecov.io/gh/iustin/pyxattr) -[![Read the Docs](https://img.shields.io/readthedocs/pyxattr)](http://pyxattr.readthedocs.io/en/latest/?badge=latest) +[![Read the Docs](https://img.shields.io/readthedocs/pyxattr)](https://pyxattr.readthedocs.io/en/latest/?badge=latest) [![GitHub issues](https://img.shields.io/github/issues/iustin/pyxattr)](https://github.com/iustin/pyxattr/issues) ![GitHub tag (latest by date)](https://img.shields.io/github/v/tag/iustin/pyxattr) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/iustin/pyxattr)](https://github.com/iustin/pyxattr/releases) @@ -16,11 +16,14 @@ operating systems. ![GitHub Release Date](https://img.shields.io/github/release-date/iustin/pyxattr) ![GitHub commits since latest release](https://img.shields.io/github/commits-since/iustin/pyxattr/latest) ![GitHub last commit](https://img.shields.io/github/last-commit/iustin/pyxattr) +[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/7236/badge)](https://bestpractices.coreinfrastructure.org/projects/7236) Downloads: go to . The source -repository is either at or at +repository is either at or at . +See the `CONTRIBUTING.md` file for details on how to contribute. + ## Requirements The current supported Python versions are 3.7+ (tested up to 3.10), or @@ -49,6 +52,10 @@ e.g. in Debian: sudo apt install python3-pyxattr +## Security + +For reporting security vulnerabilities, please see `SECURITY.md`. + ## Basic example >>> import xattr diff --git a/doc/security.md b/doc/security.md new file mode 100644 index 0000000..dbd4a7c --- /dev/null +++ b/doc/security.md @@ -0,0 +1,16 @@ +# Security Policy + +To report a (potential or confirmed) security issue, please email + with a description of the issue, steps to reproduce +it, affected versions, and if known, mitigations for the issue. + +Since this is a small project, there's no list of supported +versions. I will attempt to reply to reports within a working week, +and to fix and disclose vulnerabilities within 90 days, but this is +not a guarantee. + +Optionally, you can encrypt the email with my GPG key, see for details +. + +Alternatively, you can use the GitHub "Private vulnerability +reporting" functionality (but note this is beta). diff --git a/pyxattr.egg-info/PKG-INFO b/pyxattr.egg-info/PKG-INFO index b088a2d..f1dc7c1 100644 --- a/pyxattr.egg-info/PKG-INFO +++ b/pyxattr.egg-info/PKG-INFO @@ -1,9 +1,9 @@ Metadata-Version: 2.1 Name: pyxattr -Version: 0.8.0 +Version: 0.8.1 Summary: Filesystem extended attributes for python -Home-page: http://pyxattr.k1024.org/ -Download-URL: http://pyxattr.k1024.org/downloads/ +Home-page: https://pyxattr.k1024.org/ +Download-URL: https://pyxattr.k1024.org/downloads/ Author: Iustin Pop Author-email: iustin@k1024.org License: LGPL @@ -19,7 +19,7 @@ Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: POSIX :: Linux Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: System :: Filesystems -Requires-Python: >=3.4 +Requires-Python: >=3.7 License-File: COPYING This is a C extension module for Python which diff --git a/pyxattr.egg-info/SOURCES.txt b/pyxattr.egg-info/SOURCES.txt index 14ef93e..7961cfa 100644 --- a/pyxattr.egg-info/SOURCES.txt +++ b/pyxattr.egg-info/SOURCES.txt @@ -1,16 +1,18 @@ COPYING MANIFEST.in Makefile -NEWS +NEWS.md README.md setup.cfg setup.py xattr.c doc/conf.py +doc/contributing.md doc/index.rst doc/module.rst -doc/news.rst +doc/news.md doc/readme.md +doc/security.md pyxattr.egg-info/PKG-INFO pyxattr.egg-info/SOURCES.txt pyxattr.egg-info/dependency_links.txt diff --git a/setup.py b/setup.py index d4b2c72..08247f7 100755 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ except ImportError: long_desc = """This is a C extension module for Python which implements extended attributes manipulation. It is a wrapper on top of the attr C library - see attr(5).""" -version = "0.8.0" +version = "0.8.1" author = "Iustin Pop" author_email = "iustin@k1024.org" libraries = [] @@ -24,8 +24,8 @@ setup(name = "pyxattr", long_description = long_desc, author = author, author_email = author_email, - url = "http://pyxattr.k1024.org/", - download_url = "http://pyxattr.k1024.org/downloads/", + url = "https://pyxattr.k1024.org/", + download_url = "https://pyxattr.k1024.org/downloads/", license = "LGPL", ext_modules = [Extension("xattr", ["xattr.c"], libraries=libraries, @@ -33,7 +33,7 @@ setup(name = "pyxattr", extra_compile_args=["-Wall", "-Werror", "-Wsign-compare"], )], platforms = ["Linux"], - python_requires = ">=3.4", + python_requires = ">=3.7", project_urls={ "Bug Tracker": "https://github.com/iustin/pyxattr/issues", }, -- 2.39.2 From 67682b1c8a91df059d81ced6c6b8e1f96df151c7 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 18 Apr 2023 22:27:49 +0200 Subject: [PATCH 15/16] Bump changelog and adjust packaging for new upstream --- debian/changelog | 5 +++-- debian/rules | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 3b2ee10..bd4502e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,8 +1,9 @@ -python-pyxattr (0.8.0-2) UNRELEASED; urgency=medium +python-pyxattr (0.8.1-1) UNRELEASED; urgency=medium + * Minor upstream release (mostly non-code). * Drop the suggests on the -dbg package, was remove a long time ago. - -- Iustin Pop Sun, 22 Jan 2023 12:31:44 +0100 + -- Iustin Pop Tue, 18 Apr 2023 22:26:36 +0200 python-pyxattr (0.8.0-1) unstable; urgency=medium diff --git a/debian/rules b/debian/rules index 6805538..1d7b12c 100755 --- a/debian/rules +++ b/debian/rules @@ -30,4 +30,4 @@ override_dh_installdocs: dh_installdocs -A --remaining-packages README.md override_dh_installchangelogs: - dh_installchangelogs -A NEWS + dh_installchangelogs -A NEWS.md -- 2.39.2 From 87afda604aa54e3e816d7d0fbca44b564cb9e6e1 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Tue, 18 Apr 2023 22:44:11 +0200 Subject: [PATCH 16/16] Sigh, fix the distribution :( --- debian/changelog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index bd4502e..162f3f9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -python-pyxattr (0.8.1-1) UNRELEASED; urgency=medium +python-pyxattr (0.8.1-1) unstable; urgency=medium * Minor upstream release (mostly non-code). * Drop the suggests on the -dbg package, was remove a long time ago. -- 2.39.2