Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add python 3.10 support #21

Merged
merged 1 commit into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
name: "Python ${{ matrix.python-version }}"
runs-on: "ubuntu-latest"
env:
USING_COVERAGE: '3.8,3.9'
USING_COVERAGE: '3.8,3.9,3.10'

strategy:
matrix:
python-version: ["3.8", "3.9"]
python-version: ["3.8", "3.9", "3.10"]

steps:
- uses: "actions/checkout@v2"
Expand Down
5 changes: 4 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classifiers =
Programming Language :: Python :: 3
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
License :: OSI Approved :: MIT License
Operating System :: OS Independent

Expand Down Expand Up @@ -58,14 +59,15 @@ test =

# content of: tox.ini , put in same dir as setup.py
[tox:tox]
envlist = linters, twine, py38, py39, coverage-report
envlist = linters, twine, py38, py39, py310, coverage-report
isolated_build = True
requires = tox-conda; platform_system=="Darwin"

[gh-actions]
python =
3.8: py38, linters
3.9: py39,
3.10: py310,

[testenv]
# install pytest in the virtualenv where commands will be executed
Expand Down Expand Up @@ -102,6 +104,7 @@ parallel_show_output = true
depends =
py38
py39
py310
commands =
coverage combine
coverage report
Expand Down
12 changes: 4 additions & 8 deletions src/photomanager/actions/fileops.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ def index_photos(
priority=priority,
)
photos.append(pf)
except Exception as e:
except Exception:
tqdm.write(f"Error indexing {current_file}", file=sys.stderr)
tb_str = "".join(
traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__)
)
tb_str = "".join(traceback.format_exc())
tqdm.write(tb_str, file=sys.stderr)
photos.append(None)
exiftool.terminate()
Expand Down Expand Up @@ -202,13 +200,11 @@ def copy_photos(
chmod(abs_store_path, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)
if rel_store_path is not None:
photo.sto = rel_store_path
except Exception as e:
except Exception:
tqdm.write(
f"Error copying {photo.src} to {abs_store_path}", file=sys.stderr
)
tb_str = "".join(
traceback.format_exception(etype=type(e), value=e, tb=e.__traceback__)
)
tb_str = "".join(traceback.format_exc())
tqdm.write(tb_str, file=sys.stderr)
num_error_photos += 1
else:
Expand Down
4 changes: 2 additions & 2 deletions tests/unit_tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def __init__(
self.stdin = NopProtocol()
self.stdout = io.BytesIO(b"".join(stdout_messages))

def communicate(self, _=None):
def communicate(self, *_, **__):
return self.final_stdout, self.final_stderr


Expand Down Expand Up @@ -102,7 +102,7 @@ async def _read_stream(self, _):
self.stdout_i += 1
return message

async def communicate(self, _=None):
async def communicate(self, *_, **__):
if self.final_delay:
await asyncio.sleep(self.final_delay)
return self.final_stdout, self.final_stderr