Skip to content

Commit

Permalink
Merge pull request #7 from ramonaoptics/compatibility_with_filelock_3.13
Browse files Browse the repository at this point in the history
Compatibility with filelock 3.13
  • Loading branch information
hmaarrfk authored Oct 30, 2023
2 parents ffde78f + e143aa1 commit 78a781f
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.9', '3.11']
python-version: ['3.7', '3.9', '3.10', '3.11', '3.12']
fail-fast: false

steps:
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 0.0.6 (2023/04/18)
## 0.0.8 (2023/10/30)

- Fix compatibility with filelock 3.13.0.

## 0.0.7 (2023/04/18)

- Fix compatibility with filelock 3.12.0.
- multiuserfilelock (all version) are incompatible with filelock 3.11.0.
Expand Down
15 changes: 15 additions & 0 deletions multiuserfilelock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,21 @@


class MultiUserFileLock(FileLock):
def __new__(cls, *args, **kwargs):
# Can be removed if upstream accepts our fix for this
# https://github.com/tox-dev/filelock/pull/284
if Version(filelock.__version__) >= Version("3.13.0"):
if 'group' in kwargs:
kwargs.pop('group')
if 'chmod' in kwargs:
kwargs.pop('chmod')
if 'user' in kwargs:
kwargs.pop('user')

return super().__new__(cls, *args, **kwargs)
else:
return super().__new__(cls)

def __init__(self, *args, user=None, group=None, chmod=0o666, **kwargs):
if os.name == 'nt':
self._user = None
Expand Down
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
long_description_content_type='text/markdown',
license='BSD',
python_requires='>=3.7',
classifiers=[
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
install_requires=[
'filelock!=3.11.0',
],
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ setenv =
deps =
-r{toxinidir}/requirements_dev.txt
3.9: filelock==3.10.7
3.10: filelock==3.12.4
3.11: filelock==3.13.0
; If you want to make tox run the tests with the same versions, create a
; requirements.txt with the pinned versions and uncomment the following line:
; -r{toxinidir}/requirements.txt
Expand Down

0 comments on commit 78a781f

Please sign in to comment.