Skip to content

Commit

Permalink
mkdocs
Browse files Browse the repository at this point in the history
  • Loading branch information
e3rd committed Jan 9, 2025
1 parent 45eba69 commit ba41f1a
Show file tree
Hide file tree
Showing 13 changed files with 314 additions and 274 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Upload Python Package
on:
push:
tags:
- '[0-9].[0-9].[0-9]'
- '[0-9].[0-9].[0-9]-rc.[0-9]'
- '[0-9]+\.[0-9]+\.[0-9]+'
- '[0-9]+\.[0-9]+\.[0-9]+-?rc\.?[0-9]+'

jobs:
pypi:
Expand All @@ -13,8 +13,11 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: python3 -m pip install --upgrade build && python3 -m build
- name: Replace media paths in README.md
run: sed -E 's#(\]\((asset/[a-zA-Z0-9._-]+))#](https://github.com/CZ-NIC/deduplidog/blob/main/\2?raw=True#g' README.md | less > README.md.tmp && mv README.md.tmp README.md
- name: Build the package
run: python3 -m pip install --upgrade build && python3 -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@v1.8.10
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_GITHUB_ORGAFOLD }}
password: ${{ secrets.PYPI_GITHUB_DEDUPLIDOG }}
2 changes: 1 addition & 1 deletion .github/workflows/run-unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11, 3.12, 3.13]
python-version: [3.11, 3.12]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
site
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export TAG := `grep version pyproject.toml | pz --search '"(\d+\.\d+\.\d+(?:rc\d
release:
git tag $(TAG)
git push origin $(TAG)
#mkdocs gh-deploy
mkdocs gh-deploy
261 changes: 0 additions & 261 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
8 changes: 3 additions & 5 deletions deduplidog/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@


def main():
# NOTE: I'd like to have the default in case work dir is not specified args=("--work-dir", str(Path.cwd()))
# Currently, args overthrows CLI arguments.
with run(Deduplidog, interface=None) as m:
try:
while True:
Expand All @@ -32,9 +30,9 @@ def main():
except KeyboardInterrupt:
print("")
sys.exit()
except Exception as e:
import ipdb
ipdb.post_mortem() # TODO
# except Exception as e:
# import ipdb
# ipdb.post_mortem()


if __name__ == "__main__":
Expand Down
13 changes: 12 additions & 1 deletion deduplidog/deduplidog.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@

@dataclass
class Action:
""" What is to be done with the duplicates. """

execute: bool = False
"If False, nothing happens, just a safe run is performed."

Expand All @@ -63,6 +65,8 @@ class Action:

@dataclass
class Execution:
""" Parameters affecting the way the execution runs. """

set_both_to_older_date: bool = False
"If `execute=True`, `media_magic=True` or (media_magic=False and `ignore_date=True`), both files are set to the older date. Ex: work file get's the original file's date or vice versa."

Expand All @@ -80,11 +84,15 @@ class Execution:
"By default, when a file with bigger size or older date should be affected, just warning is generated. Turn this to suppress it."

confirm_one_by_one: bool = True
""" Instead of executing changes all at once, confirm one by one. So that you may decide whether the media similarity detection works. """
""" Instead of executing changes all at once, confirm one by one.
So that you may decide whether the media similarity detection works.
If a warning occurs, the default is 'no' to perform the action. """


@dataclass
class Match:
""" The way the files are compared. """

casefold: bool = False
"Case insensitive file name comparing."
checksum: bool = False
Expand Down Expand Up @@ -123,6 +131,7 @@ class Match:

@dataclass
class Media:
""" Media files similarity detection. """

media_magic: bool = False
""" Media files similarity detection.
Expand All @@ -146,6 +155,8 @@ class Media:

@dataclass
class Helper:
""" Helper settings. """

log_level: int = logging.WARNING
"10 debug .. 50 critical" # NOTE check

Expand Down
4 changes: 4 additions & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Changelog

## 0.7.0 (2025-01-09)
Working as expected.
Loading

0 comments on commit ba41f1a

Please sign in to comment.