Skip to content

Commit

Permalink
Merge pull request #168 from mandarons/infra-updates
Browse files Browse the repository at this point in the history
infra updates
  • Loading branch information
mandarons committed Nov 2, 2023
2 parents a4135fd + 15cce6b commit b95808d
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-main-test-coverage-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ jobs:
NEW_HEARTBEAT_ENDPOINT=${{ secrets.NEW_HEARTBEAT_ENDPOINT }}
APP_VERSION=main
push: true
# platforms: linux/arm64, linux/amd64, linux/arm/v7, linux/386
# platforms: linux/arm64, linux/amd64, linux/arm/v7, linux/386
platforms: linux/arm64, linux/amd64
tags: mandarons/icloud-drive:main
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/official-release-to-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
NEW_HEARTBEAT_ENDPOINT=${{ secrets.NEW_HEARTBEAT_ENDPOINT }}
APP_VERSION=${{ steps.prep.outputs.version }}
push: true
# platforms: linux/386,linux/amd64, linux/arm64, linux/arm/7
# platforms: linux/386,linux/amd64, linux/arm64, linux/arm/7
platforms: linux/386,linux/amd64, linux/arm64
tags: ${{ steps.prep.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
Expand Down
121 changes: 66 additions & 55 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,92 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.10.1
hooks:
- id: black
args:
- --quiet
files: ^((src|tests)/.+)?[^/]+\.py$
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
hooks:
- id: codespell
args:
- --skip="./.*,*.csv,*.json"
- --quiet-level=2
exclude: ^tests/data/
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: check-json
exclude: (.vscode|.devcontainer)
- id: no-commit-to-branch
args:
- --branch=main
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
hooks:
- id: yamllint
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
- repo: https://github.com/cdce8p/python-typing-update
rev: v0.6.0
hooks:
# Run `python-typing-update` hook manually from time to time
# to update python typing syntax.
# Will require manual work, before submitting changes!
# pre-commit run --hook-stage manual python-typing-update --all-files
- id: python-typing-update
stages: [manual]
args:
- --py311-plus
- --force
- --keep-updates
files: ^(src|tests)/.+\.py$

- repo: https://github.com/asottile/pyupgrade
rev: v3.3.1
rev: v3.15.0
hooks:
- id: pyupgrade
args: [--py39-plus]
- repo: https://github.com/PyCQA/autoflake
rev: v2.0.0
rev: v2.2.1
hooks:
- id: autoflake
args:
- --in-place
- --remove-all-unused-imports
- repo: https://github.com/psf/black
rev: 22.12.0
rev: 23.10.1
hooks:
- id: black
args:
- --quiet
files: ^((src|tests)/.+)?[^/]+\.py$

- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
args:
# - --ignore-words-list=additionals,alle,alot,ba,bre,bund,datas,dof,dur,ether,farenheit,falsy,fo,haa,hass,hist,iam,iff,iif,incomfort,ines,ist,lightsensor,mut,nam,nd,pres,pullrequests,referer,resset,rime,ser,serie,sur,te,technik,ue,uint,unsecure,visability,wan,wanna,withing,zar
- --skip="./.*,*.csv,*.json"
- --quiet-level=2
# exclude_types: [csv, json]
exclude: ^tests/data/
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- pycodestyle==2.10.0
- pyflakes==3.0.1
- flake8-docstrings==1.6.0
- pydocstyle==6.1.1
- flake8-comprehensions==3.10.1
- flake8-noqa==1.3.0
- mccabe==0.7.0
- pycodestyle
- pyflakes
- flake8-docstrings
- pydocstyle
- flake8-comprehensions
- flake8-noqa
- mccabe
files: ^(src|tests)/.+\.py$
- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
rev: 1.7.5
hooks:
- id: bandit
args:
Expand All @@ -57,38 +100,6 @@ repos:
- id: isort
args:
- --profile=black
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-executables-have-shebangs
stages: [manual]
- id: check-json
exclude: (.vscode|.devcontainer)
- id: no-commit-to-branch
args:
- --branch=main
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.28.0
hooks:
- id: yamllint
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.7.1
hooks:
- id: prettier
# - repo: https://github.com/cdce8p/python-typing-update
# rev: v0.5.0
# hooks:
# # Run `python-typing-update` hook manually from time to time
# # to update python typing syntax.
# # Will require manual work, before submitting changes!
# # pre-commit run --hook-stage manual python-typing-update --all-files
# - id: python-typing-update
# stages: [manual]
# args:
# - --py39-plus
# - --force
# - --keep-updates
# files: ^(src|tests)/.+\.py$
- repo: local
hooks:
# - id: mypy
Expand Down
7 changes: 7 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
"env": {
"PYTHONPATH": "${workspaceFolder}"
}
},
{
"name": "Python: Debug Tests",
"type": "python",
"request": "attach",
"purpose": ["debug-test"],
"justMyCode": false
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ photos:
destination: "photos"
remove_obsolete: false
sync_interval: 500
all_albums: false # Optional, default false. If true preserve album structure. If same photo is in multpile albums creates duplicates on filesystem
all_albums: false # Optional, default false. If true preserve album structure. If same photo is in multiple albums creates duplicates on filesystem
folder_format: "%Y/%m" # optional, if set put photos in subfolders according to format. Format cheatsheet - https://strftime.org
filters:
# List of libraries to download. If omitted (default), photos from all libraries (own and shared) are downloaded. If included, photos only
Expand Down
3 changes: 2 additions & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
### ICloud-Drive-Docker Usage
### ICloud-Drive-Docker Usage

We collect following information to analyze usage of `mandarons/icloud-drive-docker` project:

1. `Application version` - to track which versions of `mandarons/icloud-drive-docker` are currently in use
Expand Down
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ photos:
destination: "photos"
remove_obsolete: false
sync_interval: 500
all_albums: false # Optional, default false. If true preserve album structure. If same photo is in multpile albums creates duplicates on filesystem
all_albums: false # Optional, default false. If true preserve album structure. If same photo is in multiple albums creates duplicates on filesystem
# folder_format: "%Y/%m" # optional, if set put photos in subfolders according to format. Format cheatsheet - https://strftime.org
filters:
# List of libraries to download. If omitted (default), photos from all libraries (own and shared) are downloaded. If included, photos only
Expand Down
2 changes: 1 addition & 1 deletion src/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def send(config, last_send=None, dry_run=False):

smtp.sendmail(from_addr=email, to_addrs=to_email, msg=msg.as_string())
smtp.quit()
except (Exception) as e:
except Exception as e:
sent_on = None
LOGGER.error(f"Failed to send email: {str(e)}.")
else:
Expand Down
1 change: 0 additions & 1 deletion tests/bandit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ tests:
- B318
- B319
- B320
- B325
- B601
- B602
- B604
Expand Down

0 comments on commit b95808d

Please sign in to comment.