From 529363089729713c9350c94c11544dc73def940a Mon Sep 17 00:00:00 2001 From: moanos Date: Tue, 19 Dec 2023 12:42:33 +0100 Subject: [PATCH] refactor: Rename to fediverse blocklist tool/fbt --- DEVELOPMENT.md | 6 +++--- Dockerfile | 2 +- README.md | 2 +- .../__init__.py | 0 .../cli.py | 6 +++--- .../helpers.py | 2 +- .../models.py | 0 pyproject.toml | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) rename {fediverse_blocklist_deploy => fediverse_blocklist_tool}/__init__.py (100%) rename {fediverse_blocklist_deploy => fediverse_blocklist_tool}/cli.py (95%) rename {fediverse_blocklist_deploy => fediverse_blocklist_tool}/helpers.py (96%) rename {fediverse_blocklist_deploy => fediverse_blocklist_tool}/models.py (100%) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index b12e98a..d76b22c 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -4,14 +4,14 @@ In order to have a common development environment, its nice to use docker. Its quite easy. To build a new image, simply run -`docker build . -t fediverse_blocklist_deploy` +`docker build . -t fediverse_blocklist_tool` Now you can execute any commands using -`docker run --rm fediverse_blocklist_deploy --help` +`docker run --rm fediverse_blocklist_tool --help` If you want to avoid building new containers for each change, simply mount your code into the container using -`docker run --rm -v $(pwd):/app fediverse_blocklist_deploy` +`docker run --rm -v $(pwd):/app fediverse_blocklist_tool` Please be aware that changes to the package itself require a rebuild anyways. diff --git a/Dockerfile b/Dockerfile index f3eb817..2ee4d18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 COPY pyproject.toml poetry.lock README.md /app/ -COPY fediverse_blocklist_deploy /app/fediverse_blocklist_deploy +COPY fediverse_blocklist_tool /app/fediverse_blocklist_tool WORKDIR /app ENTRYPOINT ["fediverse_blocklist_deploy"] diff --git a/README.md b/README.md index 8e34dcd..6c22f90 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# fediverse-blocklist-deploy +# fediverse-blocklist-tool A small tool to deploy blocklist updates to a fediverse server using its API. diff --git a/fediverse_blocklist_deploy/__init__.py b/fediverse_blocklist_tool/__init__.py similarity index 100% rename from fediverse_blocklist_deploy/__init__.py rename to fediverse_blocklist_tool/__init__.py diff --git a/fediverse_blocklist_deploy/cli.py b/fediverse_blocklist_tool/cli.py similarity index 95% rename from fediverse_blocklist_deploy/cli.py rename to fediverse_blocklist_tool/cli.py index 5192282..7ab04f4 100644 --- a/fediverse_blocklist_deploy/cli.py +++ b/fediverse_blocklist_tool/cli.py @@ -6,8 +6,8 @@ import requests import os import toml -from fediverse_blocklist_deploy.models import Instance -from fediverse_blocklist_deploy.helpers import blocklist_to_markdown, blocklist_to_toml, blocklist_to_csv, \ +from fediverse_blocklist_tool.models import Instance +from fediverse_blocklist_tool.helpers import blocklist_to_markdown, blocklist_to_toml, blocklist_to_csv, \ blocklist_to_json @@ -96,7 +96,7 @@ def merge(input_file, merge_target, format: str = "toml", private: bool = False, def cli(): - parser = argparse.ArgumentParser(description='Deploy blocklist updates to a fediverse server') + parser = argparse.ArgumentParser(description='Compare, merge, export and deploy blocklist of a fediverse server') parser.add_argument('action', choices=['diff', 'deploy', 'export', 'merge'], help="Either use 'diff' to check the difference between local blockĺist and the blocklist on " "the server, 'deploy' to apply the current local blocklist or 'export' to export the remote " diff --git a/fediverse_blocklist_deploy/helpers.py b/fediverse_blocklist_tool/helpers.py similarity index 96% rename from fediverse_blocklist_deploy/helpers.py rename to fediverse_blocklist_tool/helpers.py index 5ec9f75..bee82a4 100644 --- a/fediverse_blocklist_deploy/helpers.py +++ b/fediverse_blocklist_tool/helpers.py @@ -1,4 +1,4 @@ -from fediverse_blocklist_deploy.models import Instance +from fediverse_blocklist_tool.models import Instance import toml import io import csv diff --git a/fediverse_blocklist_deploy/models.py b/fediverse_blocklist_tool/models.py similarity index 100% rename from fediverse_blocklist_deploy/models.py rename to fediverse_blocklist_tool/models.py diff --git a/pyproject.toml b/pyproject.toml index 7dec660..51986e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [tool.poetry] -name = "fediverse-blocklist-deploy" +name = "fediverse-blocklist-tool" version = "0.1.0" description = "A small tool to export, compareof merge and deploy blocklists of a fediverse server" authors = ["Georg Krause ", "Julian-Samuel Gebühr "] readme = "README.md" -packages = [{include = "fediverse_blocklist_deploy"}] +packages = [{include = "fediverse_blocklist_tool"}] license = "MIT" keywords = ["fediverse", "blocklist", "mastodon", "gotosocial", "safety"] @@ -16,7 +16,7 @@ rich = "^13.0.1" toml = "^0.10.2" [tool.poetry.scripts] -fediverse_blocklist_deploy = 'fediverse_blocklist_deploy.cli:cli' +fbt = 'fediverse_blocklist_tool.cli:cli' [tool.poetry.group.test.dependencies]