Merge pull request #12 from sashacmc/update-ci

Add python workflow and requirements file
This commit is contained in:
Alexander authored and GitHub committed 2023-05-26 12:07:05 +02:00
commit 8b838def9e
4 files changed
+44 -6

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
name: Python package
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
sudo apt install exiftran exiftool pmount
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
ruff --format=github --select=E9,F63,F7,F82 --target-version=py37 .
# default set of ruff rules with GitHub Annotations
ruff --format=github --target-version=py37 .
- name: Test with pytest
run: |
pytest
+7 -5
View File
@@ -50,11 +50,13 @@ class Config(object):
self.__config = configparser.ConfigParser()
self.__config.read_dict(self.DEFAULTS)
self.__config.read(
[
filename,
]
)
if filename is not None:
self.__config.read(
[
filename,
]
)
if create:
self.__create_if_not_exists()
+1 -1
View File
@@ -95,7 +95,7 @@ class Importer(threading.Thread):
def __remove_empty_dirs(self, dirs):
logging.info('Removing empty dirs')
len_dirs = reversed(sorted([(len(d), d) for d in dirs]))
for l, d in len_dirs:
for _, d in len_dirs:
try:
os.rmdir(d)
logging.info('Removed: %s', d)
+3
View File
@@ -0,0 +1,3 @@
progressbar==2.5
psutil==5.9.5
PyExifTool==0.5.5