Skip to content

Commit

Permalink
support python 3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
donhui committed Sep 10, 2022
1 parent 857f405 commit eb4bbd5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', '3.11-dev']

steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1

- uses: actions/setup-python@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

Expand Down
22 changes: 21 additions & 1 deletion artifactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,17 @@ def __iter__(self):
return self.iterator


class _ArtifactoryAccessor(pathlib._Accessor):
_artifactory_access_parent_class = None
try:
_artifactory_access_parent_class = pathlib._Accessor
except AttributeError:
_artifactory_access_parent_class = (
pathlib.WindowsPath if os.name == "nt" else pathlib.PosixPath
)


class _ArtifactoryAccessor(_artifactory_access_parent_class):

"""
Implements operations with Artifactory REST API
"""
Expand Down Expand Up @@ -1897,6 +1907,16 @@ def lchmod(self, mode):
"""
raise NotImplementedError()

def unlink(self, missing_ok=False):
"""
Removes a file or folder
"""
try:
self._accessor.unlink(self)
except ArtifactoryException:
if not missing_ok:
raise

def symlink_to(self, target, target_is_directory=False):
"""
Throw NotImplementedError
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ envlist =
py38
py39
py310
py311
pre-commit

[testenv]
Expand Down

0 comments on commit eb4bbd5

Please sign in to comment.