Skip to content

Commit 0fb0df4

Browse files
committed
0.0.3 release
2 parents a307c5a + 6fd90e2 commit 0fb0df4

File tree

7 files changed

+222
-42
lines changed

7 files changed

+222
-42
lines changed

AUTHORS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Core developer & maintainer: Sebastian M. Ernst <ernst@pleiszenburg.de>
44

55
Contributors, in alphabetical order:
66

7-
- (TBD)
7+
- Bill Zissimopoulos / @billziss-gh
8+
- Niko Fink / @N-Coder
89

910
## Legacy
1011

CHANGES.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changes
22

3+
## 0.0.3 (2019-05-18)
4+
5+
- Removed Python-2-compatibility code
6+
- Improved documentation, especially contribution guidelines
7+
- Added development infrastructure for determining current FUSE version (contribution)
8+
39
## 0.0.2 (2019-05-06)
410

511
- FIX: `README.md` was not rendered properly on [PyPI](https://pypi.python.org/pypi/refuse).

CONTRIBUTING.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,21 @@
22

33
Thank you for considering contributing to *refuse*!
44
**Contributions are highly welcomed!**
5+
6+
## Branching model
7+
8+
Development happens in the `develop` branch. Please issue pull requests against `develop`. The `master` branch is supposed to be kept at the least, more or less stable *preview release*.
9+
10+
## Language level & interpreters
11+
12+
This project targets Python 3 exclusively. Python 3.4 support is optional and can be dropped if required. Python 3.5 and later are mandatory as Python 3.5 is still widely used and supported. The primary target so far is CPython, although PyPy support is highly welcome.
13+
14+
## Operating system support
15+
16+
*refuse* is meant to be as generic as possible. Support for new operating systems and/or new platforms is always welcome. Have a look at the current support matrix in [README.md](https://github.com/pleiszenburg/refuse/blob/develop/README.md).
17+
18+
## General workflow
19+
20+
If you are planning on working on a "larger" issue or feature, please add yourself to the corresponding issue on GitHub or create a new one there - before you start working. This helps to reduce duplicate effort and allows to coordinate developers.
21+
22+
Everything is supposed to be tested. However, right now, *refuse* does not have a single test on its own. It can merely be tested through filesystems relying on it. This is currently done based on [LoggedFS-python](https://github.com/pleiszenburg/loggedfs-python) for x86_64 Linux. **The main objective therefore is to add a testing infrastructure.** New features are welcome, too, but tests come first. Tests based on Qemu are the likely way to go because Qemu can emulate all kinds of architectures on a single machine. Anything else that helps testing *refuse* is also highly welcome. Static code analysis comes to mind, for instance.

README.md

Lines changed: 134 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,145 @@
1212

1313
`refuse` originated as a fork of [`fusepy`](https://github.com/fusepy/fusepy). This fork will break with its origins in (at least) the following aspects:
1414

15-
* Dropping Python 2 support
16-
* Dropping the monolithic single-file-design
17-
* Adding ``libfuse3`` support
18-
* Marking ``libfuse2`` support as deprecated
19-
* A test suite
15+
- [x] Dropping Python 2 support
16+
- [ ] Dropping the monolithic single-file-design
17+
- [ ] Adding ``libfuse3`` support
18+
- [ ] Marking ``libfuse2`` support as deprecated
19+
- [ ] A test suite
2020

2121
**If you have a pending pull request against `fusepy` that you would like to see included into `refuse` please open an issue here.**
2222

23+
**If you want to contribute to `refuse`, please have a look at the [contributing guidelines](https://github.com/pleiszenburg/refuse/blob/develop/CONTRIBUTING.md).**
24+
2325
## Project status
2426

25-
THIS PROJECT HAS **ALPHA** STATUS. The high level API has been tested through [`LoggedFS-python`](https://github.com/pleiszenburg/loggedfs-python) with [`pjdfstest`](https://github.com/pjd/pjdfstest/) and [`fsx`](https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/fs/fsx-linux/fsx-linux.c), but not in all possible modes of operation. The low level API is completely untested at this point.
27+
THIS PROJECT HAS **ALPHA** STATUS.
2628

27-
## Installation
29+
The high level API has been tested through [`LoggedFS-python`](https://github.com/pleiszenburg/loggedfs-python) with [`pjdfstest`](https://github.com/pjd/pjdfstest/) and [`fsx`](https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/fs/fsx-linux/fsx-linux.c) on x86_64 Linux only, but not in all possible modes of operation. The low level API is completely untested at this point.
2830

29-
`refuse` requires `libfuse` 2.8 or 2.9 (highly recommended), `FUSE for macOS` or `WinFsp`. It (theoretically) runs on:
31+
## Installation
3032

31-
* Linux (i386, x86_64, PPC, arm64, MIPS)
32-
* Mac OS X (Intel, PowerPC)
33-
* FreeBSD (i386, amd64)
34-
* OpenBSD (all architectures, high level bindings only)
35-
* Windows (?)
36-
* Windows/Cygwin (?)
33+
`refuse` requires `libfuse` 2.8 or 2.9 (highly recommended), `FUSE for macOS` or `WinFsp`. The [`master` branch](https://github.com/pleiszenburg/refuse/tree/master) of its git repository is always kept at the latest *preview release*. It should be "sort of stable" (still ALPHA). Development happens in the [`develop` branch](https://github.com/pleiszenburg/refuse/tree/develop).
34+
35+
You can install the *preview releases* from PyPI:
36+
37+
```bash
38+
pip install refuse
39+
```
40+
41+
You can alternatively also install the current `HEAD`, most likely very unstable:
42+
43+
```bash
44+
pip install git+https://github.com/pleiszenburgrefuse.git@develop
45+
```
46+
47+
`refuse` (theoretically) runs on:
48+
49+
<table>
50+
<tr>
51+
<th>OS</th><th colspan="2">API</th><th colspan="6">arch</th>
52+
</tr>
53+
<tr>
54+
<th></th><th>level</th><th>version</th>
55+
<th>i386</th><th>x86_64</th><th>PPC</th><th>PPC64</th><th>arm64</th><th>MIPS</th>
56+
</tr>
57+
<tr>
58+
<td rowspan="4">Linux</td><td rowspan="2">high</td><td>2</td>
59+
<td>yes</td><td>yes</td><td>yes</td><td>yes</td><td>yes</td><td>yes</td>
60+
</tr>
61+
<tr>
62+
<td>3</td>
63+
<td>no</td><td>no</td><td>no</td><td>no</td><td>no</td><td>no</td>
64+
</tr>
65+
<tr>
66+
<td rowspan="2">low</td><td>2</td>
67+
<td>yes</td><td>yes</td><td>yes</td><td>yes</td><td>yes</td><td>yes</td>
68+
</tr>
69+
<tr>
70+
<td>3</td>
71+
<td>no</td><td>no</td><td>no</td><td>no</td><td>no</td><td>no</td>
72+
</tr>
73+
<tr>
74+
<td rowspan="4">Mac OS X</td><td rowspan="2">high</td><td>2</td>
75+
<td>yes</td><td>yes</td><td>yes</td><td>yes</td><td></td><td></td>
76+
</tr>
77+
<tr>
78+
<td>3</td>
79+
<td>no</td><td>no</td><td>no</td><td>no</td><td></td><td></td>
80+
</tr>
81+
<tr>
82+
<td rowspan="2">low</td><td>2</td>
83+
<td>yes</td><td>yes</td><td>yes</td><td>yes</td><td></td><td></td>
84+
</tr>
85+
<tr>
86+
<td>3</td>
87+
<td>no</td><td>no</td><td>no</td><td>no</td><td></td><td></td>
88+
</tr>
89+
<tr>
90+
<td rowspan="4">FreeBSD</td><td rowspan="2">high</td><td>2</td>
91+
<td>yes</td><td>yes</td><td>no</td><td>no</td><td>no</td><td>no</td>
92+
</tr>
93+
<tr>
94+
<td>3</td>
95+
<td>no</td><td>no</td><td>no</td><td>no</td><td>no</td><td>no</td>
96+
</tr>
97+
<tr>
98+
<td rowspan="2">low</td><td>2</td>
99+
<td>yes</td><td>yes</td><td>no</td><td>no</td><td>no</td><td>no</td>
100+
</tr>
101+
<tr>
102+
<td>3</td>
103+
<td>no</td><td>no</td><td>no</td><td>no</td><td>no</td><td>no</td>
104+
</tr>
105+
<tr>
106+
<td rowspan="4">OpenBSD</td><td rowspan="2">high</td><td>2</td>
107+
<td>yes</td><td>yes</td><td>yes</td><td>yes</td><td>yes</td><td>yes</td>
108+
</tr>
109+
<tr>
110+
<td>3</td>
111+
<td>no</td><td>no</td><td>no</td><td>no</td><td>no</td><td>no</td>
112+
</tr>
113+
<tr>
114+
<td rowspan="2">low</td><td>2</td>
115+
<td>no</td><td>no</td><td>no</td><td>no</td><td>no</td><td>no</td>
116+
</tr>
117+
<tr>
118+
<td>3</td>
119+
<td>no</td><td>no</td><td>no</td><td>no</td><td>no</td><td>no</td>
120+
</tr>
121+
<tr>
122+
<td rowspan="4">Windows</td><td rowspan="2">high</td><td>2</td>
123+
<td>yes</td><td>yes</td><td></td><td></td><td>no</td><td></td>
124+
</tr>
125+
<tr>
126+
<td>3</td>
127+
<td>no</td><td>no</td><td></td><td></td><td>no</td><td></td>
128+
</tr>
129+
<tr>
130+
<td rowspan="2">low</td><td>2</td>
131+
<td>no</td><td>no</td><td></td><td></td><td>no</td><td></td>
132+
</tr>
133+
<tr>
134+
<td>3</td>
135+
<td>no</td><td>no</td><td></td><td></td><td>no</td><td></td>
136+
</tr>
137+
<tr>
138+
<td rowspan="4">Windows/Cygwin</td><td rowspan="2">high</td><td>2</td>
139+
<td>yes</td><td>yes</td><td></td><td></td><td>no</td><td></td>
140+
</tr>
141+
<tr>
142+
<td>3</td>
143+
<td>no</td><td>no</td><td></td><td></td><td>no</td><td></td>
144+
</tr>
145+
<tr>
146+
<td rowspan="2">low</td><td>2</td>
147+
<td>no</td><td>no</td><td></td><td></td><td>no</td><td></td>
148+
</tr>
149+
<tr>
150+
<td>3</td>
151+
<td>no</td><td>no</td><td></td><td></td><td>no</td><td></td>
152+
</tr>
153+
</table>
37154

38155
## Porting a project from `fusepy` to `refuse`
39156

@@ -42,7 +159,8 @@ THIS PROJECT HAS **ALPHA** STATUS. The high level API has been tested through [`
42159
## Miscellaneous
43160

44161
- [Authors](https://github.com/pleiszenburg/refuse/blob/master/AUTHORS.md) (credit where credit is due)
45-
- [Change log](https://github.com/pleiszenburg/refuse/blob/master/CHANGES.md) (release history)
46-
- [Contributing](https://github.com/pleiszenburg/refuse/blob/master/CONTRIBUTING.md) (**Contributions are highly welcomed!**)
162+
- [Change log (current)](https://github.com/pleiszenburg/refuse/blob/develop/CHANGES.md) (changes in development branch since last release)
163+
- [Change log (past)](https://github.com/pleiszenburg/refuse/blob/master/CHANGES.md) (release history)
164+
- [Contributing](https://github.com/pleiszenburg/refuse/blob/develop/CONTRIBUTING.md) (**Contributions are highly welcomed!**)
47165
- [Documentation](https://github.com/pleiszenburg/refuse/tree/master/docs) (mostly notes at this point)
48166
- [License](https://github.com/pleiszenburg/refuse/blob/master/LICENSE) (**ISCL**)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3939

4040
# BUMP VERSION HERE!
41-
_version_ = '0.0.2'
41+
_version_ = '0.0.3'
4242

4343
# List all versions of Python which are supported
4444
confirmed_python_versions = [

src/refuse/high.py

Lines changed: 47 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"""
2626

2727

28-
from __future__ import print_function, absolute_import, division
28+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29+
# IMPORT
30+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2931

3032
import ctypes
3133
import errno
@@ -45,25 +47,12 @@
4547
except ImportError:
4648
time_ns = lambda: int(time() * 1e9)
4749

48-
try:
49-
from functools import partial
50-
except ImportError:
51-
# http://docs.python.org/library/functools.html#functools.partial
52-
def partial(func, *args, **keywords):
53-
def newfunc(*fargs, **fkeywords):
54-
newkeywords = keywords.copy()
55-
newkeywords.update(fkeywords)
56-
return func(*(args + fargs), **newkeywords)
57-
58-
newfunc.func = func
59-
newfunc.args = args
60-
newfunc.keywords = keywords
61-
return newfunc
50+
from functools import partial
6251

63-
try:
64-
basestring
65-
except NameError:
66-
basestring = str
52+
53+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
54+
# HEADER: TODO organize ...
55+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6756

6857
log = logging.getLogger("fuse")
6958
_system = system()
@@ -726,12 +715,39 @@ def fuse_exit():
726715
_libfuse.fuse_exit(fuse_ptr)
727716

728717

718+
def get_fuse_version():
719+
for method in [
720+
lambda: _libfuse.fuse_pkgversion(),
721+
lambda: _libfuse.fuse3_pkgversion(),
722+
lambda: _libfuse.fuse_version(),
723+
lambda: _libfuse.fuse3_version(),
724+
lambda: _libfuse.macfuse_version(),
725+
lambda: _libfuse.osxfuse_version(),
726+
]:
727+
try:
728+
val = method()
729+
if isinstance(val, int) and val > 10:
730+
return str(val / 10)
731+
else:
732+
return val
733+
except AttributeError:
734+
pass
735+
736+
737+
def get_fuse_libfile():
738+
return _libfuse._name
739+
740+
729741
class FuseOSError(OSError):
730742
def __init__(self, errno):
731743
super(FuseOSError, self).__init__(errno, os.strerror(errno))
732744

733745

734-
class FUSE(object):
746+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
747+
# CLASS: FUSE
748+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
749+
750+
class FUSE:
735751
'''
736752
This class is the lower level interface and should not be subclassed under
737753
normal use. Its methods are called by fuse.
@@ -1076,7 +1092,7 @@ def readdir(self, path, buf, filler, offset, fip):
10761092
for item in self.operations('readdir', self._decode_optional_path(path),
10771093
fip.contents.fh):
10781094

1079-
if isinstance(item, basestring):
1095+
if isinstance(item, str):
10801096
name, st, offset = item, None, 0
10811097
else:
10821098
name, attrs, offset = item
@@ -1188,7 +1204,12 @@ def ioctl(self, path, cmd, arg, fip, flags, data):
11881204
return self.operations('ioctl', path.decode(self.encoding),
11891205
cmd, arg, fh, flags, data)
11901206

1191-
class Operations(object):
1207+
1208+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1209+
# CLASS: Operations
1210+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1211+
1212+
class Operations:
11921213
'''
11931214
This class should be subclassed and passed as an argument to FUSE on
11941215
initialization. All operations should raise a FuseOSError exception on
@@ -1369,6 +1390,10 @@ def write(self, path, data, offset, fh):
13691390
raise FuseOSError(errno.EROFS)
13701391

13711392

1393+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1394+
# CLASS: LoggingMixIn
1395+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1396+
13721397
class LoggingMixIn:
13731398
log = logging.getLogger('fuse.log-mixin')
13741399

src/refuse/low.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
"""
2626

2727

28-
from __future__ import print_function, absolute_import, division
28+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29+
# IMPORT
30+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2931

3032
import ctypes
3133
import errno
@@ -38,6 +40,10 @@
3840
from stat import S_IFDIR
3941

4042

43+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
44+
# HEADER: TODO organize ...
45+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
46+
4147
_system = system()
4248
_machine = machine()
4349

@@ -57,6 +63,7 @@
5763
else:
5864
_libfuse = ctypes.CDLL(_libfuse_path)
5965

66+
6067
class LibFUSE(ctypes.CDLL):
6168
def __init__(self):
6269
if _system == 'Darwin':
@@ -478,7 +485,12 @@ def dict_to_stat(d, use_ns=False):
478485
def setattr_mask_to_list(mask):
479486
return [FUSE_SET_ATTR[i] for i in range(len(FUSE_SET_ATTR)) if mask & (1 << i)]
480487

481-
class FUSELL(object):
488+
489+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
490+
# CLASS: FUSELL
491+
# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
492+
493+
class FUSELL:
482494
use_ns = False
483495

484496
def __init__(self, mountpoint, encoding='utf-8'):

0 commit comments

Comments
 (0)