Iustin Pop [Mon, 25 Nov 2019 03:34:59 +0000 (04:34 +0100)]
Don't compute coverage for external files
Usually includes are caught here.
Iustin Pop [Mon, 25 Nov 2019 03:24:57 +0000 (04:24 +0100)]
Reduce manyops count
We test more (object types), so let's reduce the call count for
each. Too slow otherwise.
Iustin Pop [Mon, 25 Nov 2019 03:22:15 +0000 (04:22 +0100)]
Convert test suite to pytest
Much more parametrisation, which means:
- more test cases covered (testing more/all object types in most
functions)
- more granular tests, which should help diagnose of failures
Iustin Pop [Mon, 25 Nov 2019 02:07:51 +0000 (03:07 +0100)]
tests: stop trying to set user attributes on symlinks
According to xattr(7), by design setting/modifying user attributes on
symlinks is not allowed, due to the way access control works, so stop
trying to test it.
Iustin Pop [Mon, 25 Nov 2019 01:03:38 +0000 (02:03 +0100)]
Stop supporting Python 2
Bump minimum Python version to 3.4, which covers e.g. in Debian even
old-old-stable (Jessie), which is good enough.
This will allow code simplification and supporting new
features (e.g. to implement #20).
Iustin Pop [Mon, 25 Nov 2019 00:37:05 +0000 (01:37 +0100)]
tests: move helper function outside the test class
Not sure why these were there in the first place…
Iustin Pop [Mon, 25 Nov 2019 00:26:49 +0000 (01:26 +0100)]
tests: move constants outside the class
In preparation for pytest conversion.
Iustin Pop [Sun, 24 Nov 2019 14:41:02 +0000 (15:41 +0100)]
Travis: remove hack for Python 3.7 test
Current config was testing 3.7 twice :/
Iustin Pop [Sun, 24 Nov 2019 13:54:56 +0000 (14:54 +0100)]
Only export COVERALLS_PARALLEL in coveralls upload
Having it shown as per-job env makes things more confusing.
Iustin Pop [Sun, 24 Nov 2019 13:53:57 +0000 (14:53 +0100)]
Travis: test on py3.7 and 3.8 too
Iustin Pop [Sun, 24 Nov 2019 13:53:12 +0000 (14:53 +0100)]
Also export coverage results to codecov
Will have to decide which to keep, but codecov at least supports
partial line coverage (while missing nicer overall dashboard :/).
Iustin Pop [Sat, 23 Nov 2019 21:34:29 +0000 (22:34 +0100)]
Add a distcheck Makefile target
Too bad setuptools doesn't have it built-in…
Iustin Pop [Sat, 23 Nov 2019 21:33:36 +0000 (22:33 +0100)]
Switch README file to Markdown and expand it
Let's get a bit more up with the times.
Iustin Pop [Sat, 23 Nov 2019 20:53:37 +0000 (21:53 +0100)]
Fix a docstring formatting issue
This resulted in Sphinx altering the layout significantly.
Iustin Pop [Sat, 23 Nov 2019 20:08:17 +0000 (21:08 +0100)]
Switch build system to Python 3
But still allow easy override (make ... PYTHON=python2).
Iustin Pop [Fri, 22 Nov 2019 23:00:48 +0000 (00:00 +0100)]
Update Travis config to export coverage information
Also enable newer Python (3.7, so not so new) under Linux.
Iustin Pop [Sun, 13 Oct 2019 15:57:04 +0000 (17:57 +0200)]
Travis: remove obsolete python versions
Some of them, at least.
Iustin Pop [Sat, 2 Mar 2019 20:14:41 +0000 (21:14 +0100)]
Travis: remove "sudo:false"
Per the deprecation of container-based
builds (https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration),
remove the sudo:false setting.
Iustin Pop [Tue, 24 Jul 2018 21:45:55 +0000 (23:45 +0200)]
Travis: add python 3.5 and 3.6 to build matrix
Tests pass locally, so all seems good.
Iustin Pop [Tue, 24 Jul 2018 21:39:00 +0000 (23:39 +0200)]
Travis: remove python 3.2 from build list
It seems the setuptools libraries that are installed in the travis
environments don't support anymore 3.2, which causes the builds to be
wrongly marked as failed.
Iustin Pop [Tue, 24 Jul 2018 21:38:15 +0000 (23:38 +0200)]
Further test suite fixes to symlink ops
I forgot about the deprecated ones…
Iustin Pop [Tue, 24 Jul 2018 21:34:22 +0000 (23:34 +0200)]
Update NEWS for proper contents of 0.6.1 release
Iustin Pop [Tue, 24 Jul 2018 21:24:09 +0000 (23:24 +0200)]
Travis build: remove dependency on libattr-dev
One more cleanup as part of the migration to the glibc header.
adamlin [Mon, 20 Mar 2017 10:19:25 +0000 (18:19 +0800)]
Fix nofollow not work in MAC
Iustin Pop [Tue, 24 Jul 2018 21:20:53 +0000 (23:20 +0200)]
Tests: fix symlink testing
On Linux, non-root users are not allowed to set extended attributes,
so normal testing has hidden this. A fix to the Mac OS support
proposed in #14 uncovered this problem, which led to investigation and
this fix.
Manual testing on Linux with root and namespace=trusted now passes the
tests.
Iustin Pop [Tue, 24 Jul 2018 21:14:37 +0000 (23:14 +0200)]
Tests: introduce an alias for NS_USER
Using NS_USER directly makes it hard to change it for a one-off manual
test, so let's virtualise it, and additionally allow overriding from
the command line.
xwhuang [Fri, 9 Mar 2018 01:56:16 +0000 (09:56 +0800)]
Release GIL when do I/O operations
Release GIL in _list_obj, _get_obj, _set_obj, and _remove_obj. These
functions do I/O operations which take long time. We should release
GIL to allow other threads work.
Iustin Pop [Tue, 24 Jul 2018 20:36:23 +0000 (22:36 +0200)]
Further improvements to benchmark code
Iustin Pop [Tue, 24 Jul 2018 20:29:07 +0000 (22:29 +0200)]
Makefile: move list of python versions to a variable
This way, it can be overridden from the command line, to allow a more
targeted test/benchmark.
Iustin Pop [Tue, 24 Jul 2018 20:17:02 +0000 (22:17 +0200)]
Add a mini-benchmark suite
This will make it easy to see the impact of changes, for example the
one proposed in #16.
Iustin Pop [Tue, 24 Jul 2018 19:54:53 +0000 (21:54 +0200)]
Bump version to 0.6.1
Also switch downloads repository to HTTPS.
Iustin Pop [Tue, 24 Jul 2018 19:46:48 +0000 (21:46 +0200)]
Remove use of and mentions of the attr library
Commit
a799657 removed its use, so let's drop the mention and the
linking against it.
Lars Wendler [Wed, 10 Jan 2018 10:45:35 +0000 (11:45 +0100)]
xattr.c: There is no more attr/xattr.h with >=attr-2.4.48
See also:
http://git.savannah.nongnu.org/cgit/attr.git/commit/?id=
7921157890d07858d092f4003ca4c6bae9fd2c38
Iustin Pop [Mon, 23 Jan 2017 21:38:35 +0000 (22:38 +0100)]
Version bump for releasing 0.6.0
Signed-off-by: Iustin Pop <iustin@k1024.org>
Iustin Pop [Mon, 14 Nov 2016 21:02:25 +0000 (22:02 +0100)]
Expand the testing of invalid arguments
This is not significant advantage, but it does increase coverage. And
any coverage (even if not testing the logic too much) is better than
no coverage.
Iustin Pop [Sun, 13 Nov 2016 23:57:35 +0000 (00:57 +0100)]
Test writing large values
This exercises one more code path.
Iustin Pop [Sun, 13 Nov 2016 23:55:28 +0000 (00:55 +0100)]
Also run tests using python-dbg
Iustin Pop [Tue, 25 Oct 2016 23:27:54 +0000 (01:27 +0200)]
Add a makefile coverage target
And expand a tiny bit the test suite to exercise one more error
path. Current coverage is not bad, ~87% lines coverage. For some
reason, no branch coverage is available :/
Iustin Pop [Tue, 25 Oct 2016 22:34:07 +0000 (00:34 +0200)]
Rework getting and listing attributes
Currently, getting and listing attributes is inconsistent in how it
deals with allocating memory for the data returned by the syscall:
- in most cases, we ask the kernel for the value, allocate memory,
then retrieve the value; if the value changed (increased) in the
meantime, this will lead to what should be preventable failures
- in the single case of getall, there is a loop for getting the
individual values, but not for initially get the list of values
Hence the bug report #12. This rather large change refactors a lot of
the code:
- doing a get/list is abstracted away into a helper function that
always does retries until we can read the value or fail with a
different error than ERANGE; this helper deal with all allocations
and resize operations.
- this means most of the single get/list operations are heavily
simplified
- and also means that we can always start optimistically with an
initial buffer size (currently set to 1K), instead of asking the
kernel first: this saves one out of two syscalls in the case the
value will indeed be smaller, but adds one extra syscall (the failed
initial read) in the case it's not.
The optimisation is a double-edged sword: for small attributes, it
will be a win (e.g. the test suite is ~5% faster now), but for large
attribute/lists, it will be potentially slower (50% more
syscalls). Not sure how to nicely deal with this; it would be good to
have a keyword argument maybe? Or build flag? Left for future
enhancements.
Closes #12.
Iustin Pop [Tue, 25 Oct 2016 21:59:02 +0000 (23:59 +0200)]
A few small improvements to the test suite
Especially testing empty attribute value and ensuring not found
attribute raises an exception.
Iustin Pop [Sun, 23 Oct 2016 10:49:42 +0000 (12:49 +0200)]
Initialise target_t members on error paths
This is a no-op from the point of view of the actual code flow, but
not doing so can trigger false positives in some versions of GCC (4.9
from Jessie) at high optimisation levels (-O3). For an interesting
discussion of why this happens at `-O3` vs. at `-O2`, see
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60165.
Closes #13.
Iustin Pop [Mon, 23 May 2016 10:14:33 +0000 (12:14 +0200)]
Spelling fix in documentation
Iustin Pop [Mon, 23 May 2016 10:13:48 +0000 (12:13 +0200)]
Fix name space information in documentation
Closes #11.
Iustin Pop [Mon, 2 May 2016 20:53:00 +0000 (22:53 +0200)]
Revert "Add build status badge to README"
This reverts commit
de9bc00d145874b5a7a63ef382de215b735e8961. First,
it was markdown and README is rst, but that's not the point: sphinx
wants to warn about 'non-local image in URI', and the silencing of
this is only present in 1.4 and later, so for now just revert.
Iustin Pop [Mon, 2 May 2016 20:41:37 +0000 (22:41 +0200)]
Add build status badge to README
Iustin Pop [Sun, 1 May 2016 02:59:51 +0000 (04:59 +0200)]
Mark OSX build non-experimental
Also override Python list, since we only care about system python (OSX
doesn't support yet multiple Python versions), and the current state
shows a strange build summary (one build with N python versions).
Iustin Pop [Sun, 1 May 2016 02:53:22 +0000 (04:53 +0200)]
Fix tabs in travis config
Iustin Pop [Sun, 1 May 2016 02:50:30 +0000 (04:50 +0200)]
Try to enable OSX builds in travis configuration
Based on recent patch, the test suite should pass, so let's try to
enable it.
Iustin Pop [Sun, 1 May 2016 02:46:32 +0000 (04:46 +0200)]
Merge pull request #9 from ahknight/osx-support
Added support for OS X's slightly different xattr calls.
Adam Knight [Sat, 9 Apr 2016 20:38:22 +0000 (15:38 -0500)]
Added support for OS X's slightly different xattr calls.
Iustin Pop [Sat, 9 Apr 2016 15:26:49 +0000 (17:26 +0200)]
Bump version to 0.5.6
Pending commits fix compilation issues due to sign-compare, let's make
a very much overdue release.
Iustin Pop [Wed, 12 Aug 2009 19:58:36 +0000 (21:58 +0200)]
Fix building on systems which don't have ENODATA
This patch (a modified form of the original patch from Cyril Brulebois
<kibi@debian.org>) fixes building on systems which don't have ENODATA
(e.g. GNU/kFreeBSD).
Iustin Pop [Fri, 1 May 2015 23:25:51 +0000 (01:25 +0200)]
Fix potential name truncation in merge_ns()
It seems I misread the snprintf man page: a return value of exactly
the buffer size means truncation has occurred, so we need to fix the
operator (`>` → `≥`).
Additionally, improve slightly the error message raised in such a
case; this shouldn't ever happen.
Iustin Pop [Fri, 1 May 2015 23:01:18 +0000 (01:01 +0200)]
travis-ci: less build log noise
Surprisingly, the integration works! But we can reduce some noise in
the build log:
- be explicit that we don't require sudo (silences YELLOW! notice)
- override install since we don't require/use pip requirements
Iustin Pop [Fri, 1 May 2015 23:20:52 +0000 (01:20 +0200)]
Always enable -Wsign-compare
The code is clean, and this is an important warning (due to extensive
use of both signed and unsigned integers), so let's enable it.
Iustin Pop [Fri, 1 May 2015 23:17:37 +0000 (01:17 +0200)]
Fix sign-compare warning in merge_ns()
Thanks to travis-ci - the code does what seems an unsafe sign compare,
but actually it is a valid comparison (we test/handle the `< 0` case
as well, which is the only way the comparison could be invalid). To
silence this, do an explicit (safe) cast.
Iustin Pop [Fri, 1 May 2015 22:58:25 +0000 (00:58 +0200)]
Add a .travis.yml file
Not sure if the travis-ci environment supports C extension modules or
attributes on filesystems, but let's try.
Iustin Pop [Fri, 1 May 2015 19:41:36 +0000 (21:41 +0200)]
Rename README→README.rst
Should trigger better formatting, e.g. in github project page.
Iustin Pop [Fri, 1 May 2015 19:40:38 +0000 (21:40 +0200)]
Bump version to 0.5.5 for a new release
Iustin Pop [Fri, 1 May 2015 18:31:39 +0000 (20:31 +0200)]
Add release dates to NEWS file
Iustin Pop [Fri, 1 May 2015 01:00:35 +0000 (03:00 +0200)]
Make the code -Wconversion ready: explicit casts only
This patch, while adding lots of extra boilerplate, converts all code
to explicit casts only; it now builds with `-Wconversion` cleanly,
although that's a bit too strong to turn on by default (for now).
Iustin Pop [Thu, 30 Apr 2015 23:02:59 +0000 (01:02 +0200)]
Fix a few int/size_t conversion issues
From https://bugzilla.redhat.com/show_bug.cgi?id=
1127310: the
'#'-variats of parsing (s#, et#, etc.) take a size_t if
PY_SSIZE_T_CLEAN is defined (which the code does). On some
architectures (little-endian only?) this doesn't seem to be a problem,
but on PPC this is a failure in unit tests (at least yay).
The patch changes the type of bufsize to Py_ssize_t, and does an
explicit cast to size_t with underflow check in order to make the code
safer (assuming this is the right thing to do). This should result in
no unexpected conversion issues.
Iustin Pop [Thu, 30 Apr 2015 22:52:52 +0000 (00:52 +0200)]
Improve error checking in get_all()
After getting a too big value via ERANGE, making the call with the
proper length could still fail due to other issues, and this check is
missing. A negative value here would be changed into something weird
in the realloc call (which takes size_t), so the error reporting would
be bogus.
Iustin Pop [Thu, 30 Apr 2015 22:48:35 +0000 (00:48 +0200)]
Style change: name all jump labels uniformly
Iustin Pop [Thu, 30 Apr 2015 22:43:16 +0000 (00:43 +0200)]
Fix memory leak on get_all OutOfMemory handling path
It's unlikely that the situation is recoverable when failing to
allocate memory, but the current code is clearly buggy: PyMem_Realloc
doesn't clobber the existing buffer on failure, so not deallocating it
will result in a leak.
Iustin Pop [Thu, 30 Apr 2015 15:32:50 +0000 (17:32 +0200)]
Update my email address
Iustin Pop [Thu, 30 Apr 2015 15:31:18 +0000 (17:31 +0200)]
Bump upper python version test in Makefile
Iustin Pop [Thu, 30 Apr 2015 15:29:37 +0000 (17:29 +0200)]
Bump version for 0.5.4 release
Iustin Pop [Thu, 30 Apr 2015 11:40:25 +0000 (13:40 +0200)]
Remove all .so files on make clean
Iustin Pop [Thu, 30 Apr 2015 11:39:20 +0000 (13:39 +0200)]
Update copyright year
Sigh, boring.
Iustin Pop [Thu, 30 Apr 2015 11:31:06 +0000 (13:31 +0200)]
Fix memory leaks in get() failure handling path
The freeing memory labels were used wrongly; easily reproducible by
simulating failures in a loop.
Iustin Pop [Fri, 23 May 2014 15:42:04 +0000 (17:42 +0200)]
Update changelog and bump version for 0.5.3
Iustin Pop [Fri, 23 May 2014 15:36:44 +0000 (17:36 +0200)]
Add helpers to test suite for easier checking
Since the _ignore/_ignore_tuples methods are always called with
assertEqual, let's add two wrappers to simplify the code a bit.
Iustin Pop [Fri, 23 May 2014 11:10:34 +0000 (13:10 +0200)]
Make the environment variable TEST_DIR match the python var
Having things inconsistent just leads to confusion.
Iustin Pop [Fri, 23 May 2014 10:57:44 +0000 (12:57 +0200)]
Merge pull request #3 from jborg/surrogateescape
Use "surrogateescape" error handler when encoding unicode paths.
Iustin Pop [Fri, 23 May 2014 10:49:21 +0000 (12:49 +0200)]
Merge pull request #4 from edelkind/master
Better handling of files without xattrs
Iustin Pop [Fri, 23 May 2014 10:41:01 +0000 (12:41 +0200)]
Merge pull request #5 from quantheory/master
Add workaround for tests on SELinux systems.
Sean Patrick Santos [Sun, 9 Mar 2014 02:17:26 +0000 (19:17 -0700)]
Fix tests when tmp files have attributes.
SELinux systems may have the security.selinux attribute defined for
temporary files upon creation. This can cause problems for the tests,
which assumed that new files have no attributes. Similar problems can
arise in other cases where temporary files created by python start out
with attributes.
To work around this, a comma-separated list of attributes to ignore can
be specified in the environment variable "TEST_IGNORE_XATTRS". Any
attributes specified in this way will be filtered out by tests.
ari edelkind [Tue, 17 Sep 2013 18:20:33 +0000 (14:20 -0400)]
Better handling of files without xattrs
Return an empty list immediately if a file has no xattrs (as most would
not on most systems). The number of system calls for files with no
extended attributes is reduced by (at least) half.
Jonas Borgström [Thu, 13 Jun 2013 20:17:32 +0000 (22:17 +0200)]
Use "surrogateescape" error handler when encoding unicode paths.
On Python 3 functions like os.listdir() always returns unicode
paths. "invalid" byte paths are decoded using the "surrogateescape" error
handler which must also be used when decoding.
See os.fsencodefs() and os.fsdecode().
Iustin Pop [Thu, 3 Jan 2013 21:27:40 +0000 (22:27 +0100)]
Update docs for the 0.5.2 release
Of course I forgot this, and as github has also deprecated downloads,
we should switch to something else…
Iustin Pop [Thu, 3 Jan 2013 20:45:14 +0000 (21:45 +0100)]
Bump version and update NEWS for the 0.5.2 release
All tests pass, let's release!
Iustin Pop [Thu, 3 Jan 2013 20:36:36 +0000 (21:36 +0100)]
Fix string/unicode buffer size parsing
It seems that CPython allows passing "wrong" pointers for et#
(Py_ssize_t instead of int), but PyPy has problems with this, and
wrongly casts the pointers, leading to unsigned/signed conversion
failures.
This bug was introduced in commits
433c5852 and
8aa6fd81; I'm no
longer sure why bufsize was changed from int to Py_ssize_t as well,
but passing an int value to a C function expecting an ssize_t should
be safe as the compiler should do the required conversions behind the
scenes (as long as it has correct information about the types).
Closes gh-1.
Iustin Pop [Thu, 3 Jan 2013 20:35:44 +0000 (21:35 +0100)]
Enable testing with python 3.3 and pypy as well
The pypy test is not versioned, since Debian only provides a single
pypy binary, so I don't have an environment with multiple pypy
installations.
Iustin Pop [Thu, 3 Jan 2013 20:27:03 +0000 (21:27 +0100)]
Enable compiler warnings
`-Wall -Werror` should make compiler warnings much more obvious,
hopefully catching more latent bugs.
Iustin Pop [Thu, 3 Jan 2013 20:26:15 +0000 (21:26 +0100)]
Make setup.py behave nicely without setuptools
Currently, it would fail hard, whereas we can at least build the
extension (even though the testsuite will not work) when setuptools is
missing.
Mike Gilbert [Fri, 21 Dec 2012 21:33:18 +0000 (16:33 -0500)]
Python 2.5 can't parse byte literals, so use bytes() instead.
Iustin Pop [Tue, 15 May 2012 23:48:26 +0000 (01:48 +0200)]
Fix title in index page
Iustin Pop [Tue, 15 May 2012 23:34:42 +0000 (01:34 +0200)]
Clarify the namespace type under Py3
Iustin Pop [Tue, 15 May 2012 23:23:20 +0000 (01:23 +0200)]
Update NEWS file for the 0.5.1 release
Iustin Pop [Tue, 15 May 2012 23:19:58 +0000 (01:19 +0200)]
Complete the change of namespace handling
This disables None as a valid namespace under Python 2.x too; now only
an empty string is accepted.
The patch also documents the change.
Iustin Pop [Tue, 15 May 2012 23:11:13 +0000 (01:11 +0200)]
Fix bug in get_all for empty namespace handling
Also add an unit test for it.
Iustin Pop [Tue, 15 May 2012 22:58:24 +0000 (00:58 +0200)]
More setup.py updates
Iustin Pop [Tue, 15 May 2012 22:46:42 +0000 (00:46 +0200)]
Add a download_url for pypi
Iustin Pop [Tue, 15 May 2012 22:31:56 +0000 (00:31 +0200)]
Bump version number for new release
Also switch the homepage URL.
Iustin Pop [Tue, 15 May 2012 22:25:12 +0000 (00:25 +0200)]
Update gitignore file
Iustin Pop [Tue, 15 May 2012 22:23:43 +0000 (00:23 +0200)]
Makefile improvements
… and remove old run-tests file, obsoleted by the Makefile.
Iustin Pop [Tue, 15 May 2012 22:22:15 +0000 (00:22 +0200)]
Update manifest file
Iustin Pop [Tue, 15 May 2012 22:16:03 +0000 (00:16 +0200)]
Update README to include the old website info
Iustin Pop [Tue, 15 May 2012 22:07:07 +0000 (00:07 +0200)]
Convert NEWS file
This allows it to be included in the doc nicely.