Skip to content

Commit 9e58702

Browse files
authored
Merge pull request #26 from xsuite/release/v0.3.3
Release 0.3.3
2 parents 7b4ccda + 6ca2193 commit 9e58702

File tree

5 files changed

+24
-3
lines changed

5 files changed

+24
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "xaux"
3-
version = "0.3.2"
3+
version = "0.3.3"
44
description = "Support tools for Xsuite packages"
55
authors = ["Frederik F. Van der Veken <[email protected]>",
66
"Thomas Pugnat <[email protected]>",

tests/test_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
from xaux import __version__
77

88
def test_version():
9-
assert __version__ == '0.3.2'
9+
assert __version__ == '0.3.3'
1010

xaux/fs/afs.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@
1212

1313

1414
_afs_path = Path('/afs')
15+
_afs_mounted = False
16+
try:
17+
cmd = run(['mount'], stdout=PIPE, stderr=PIPE)
18+
if cmd.returncode == 0:
19+
stdout = cmd.stdout.decode('UTF-8').strip()
20+
mounts = [line.split(' on ')[1].split()[0] for line in stdout if 'AFS' in line]
21+
if len(mounts) == 1:
22+
_afs_mounted = True
23+
_afs_path = Path(mounts[0])
24+
elif len(mounts) > 1:
25+
raise OSError("Multiple AFS mounts detected.")
26+
except (CalledProcessError, FileNotFoundError):
27+
pass
1528

1629
try:
1730
cmd = run(['fs', '--version'], stdout=PIPE, stderr=PIPE)

xaux/fs/fs.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,14 @@ def rmdir(self, *args, **kwargs):
177177
raise NotADirectoryError(f"{self} is not a directory.")
178178
Path.rmdir(self.expanduser(), *args, **kwargs)
179179

180+
def __eq__(self, other):
181+
other = FsPath(other).expanduser().resolve()
182+
self = self.expanduser().resolve()
183+
return self.as_posix() == other.as_posix()
184+
185+
def __ne__(self, other):
186+
return not self.__eq__(other)
187+
180188

181189
# New methods
182190
# ===========

xaux/general.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010
# ===================
1111
# Do not change
1212
# ===================
13-
__version__ = '0.3.2'
13+
__version__ = '0.3.3'
1414
# ===================

0 commit comments

Comments
 (0)