Skip to content

Commit

Permalink
fix: Mark --update deprecated (#194)
Browse files Browse the repository at this point in the history
* fix: Mark --update deprecated

* build(autofix): Auto-fix linting issues

---------

Co-authored-by: Jan Willhaus [bot] <bot@janw.xyz>
  • Loading branch information
janw and janw-bot authored Oct 27, 2024
1 parent 045d333 commit 85a8f00
Show file tree
Hide file tree
Showing 11 changed files with 416 additions and 146 deletions.
282 changes: 165 additions & 117 deletions .assets/podcast-archiver-help.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 15 additions & 6 deletions .github/workflows/linters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,30 @@ jobs:
python-version: 3.x

- name: Install dependencies
run: poetry install --no-root --sync
run: poetry install --sync

- uses: actions/cache@v4
- id: cache-restore
uses: actions/cache/restore@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-v0|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
save-always: true
key: pre-commit-v0|${{ steps.setup-python.outputs.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}

- run: poetry run pre-commit run --show-diff-on-failure --color=always --all-files
shell: bash

- uses: stefanzweifel/git-auto-commit-action@v5
if: always()
if: >
always()
&& !startsWith(github.event.head_commit.message, 'build(autofix):')
with:
commit_message: "build(lint): Auto-fix linting issues"
commit_message: "build(autofix): Auto-fix linting issues"
commit_user_name: "Jan Willhaus [bot]"
commit_user_email: "bot@janw.xyz"
commit_author: Jan Willhaus [bot] <bot@janw.xyz>

- id: cache-save
uses: actions/cache/save@v4
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
with:
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
path: ~/.cache/pre-commit
12 changes: 0 additions & 12 deletions .github/workflows/rich-codex.yaml

This file was deleted.

172 changes: 170 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,175 @@
!.github/**/*.yaml

archive/
.ruff_cache/

.coverage*
### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at /~https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

### Python Patch ###
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
poetry.toml

# ruff
.ruff_cache/

# LSP config files
pyrightconfig.json
12 changes: 12 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
repos:
- repo: meta
hooks:
- id: check-hooks-apply

- repo: /~https://github.com/janw/pre-commit-hooks
rev: v0.1.0
hooks:
Expand Down Expand Up @@ -43,3 +47,11 @@ repos:
require_serial: true
pass_filenames: false
types: [python]

- id: rich-codex
name: rich-codex
entry: ./hack/rich-codex.sh
language: system
require_serial: true
pass_filenames: false
types: [python]
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ By default, the docker image downloads episodes to a volume mounted at `/archive

Run `podcast-archiver --help` for details on how to use it:

<!-- RICH-CODEX fake_command: "podcast-archiver --help" -->
![`poetry run podcast-archiver --help`](.assets/podcast-archiver-help.svg)
![`podcast-archiver --help`](.assets/podcast-archiver-help.svg)

### Example invocation

Expand Down
1 change: 1 addition & 0 deletions cspell.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ words:
- janwxyz
- mccabe
- mktime
- MONOKAI
- mypy
- pipx
- posix
Expand Down
12 changes: 12 additions & 0 deletions hack/rich-codex.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

export FORCE_COLOR="1"
export TERMINAL_WIDTH="140"
export TERMINAL_THEME=MONOKAI
export CREATED_FILES="created.txt"
export DELETED_FILES="deleted.txt"
export NO_CONFIRM="true"
export SKIP_GIT_CHECKS="true"
export CLEAN_IMG_PATHS='./assets/*.svg'

exec poetry run rich-codex
8 changes: 5 additions & 3 deletions podcast_archiver/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
click.rich_click.OPTIONS_PANEL_TITLE = "Miscellaneous Options"
click.rich_click.OPTION_GROUPS = {
constants.PROG_NAME: [
{
"name": f":warning: Deprecated, {constants.DEPRECATION_MESSAGE}",
"options": list(Settings.get_deprecated_options().keys()),
},
{
"name": "Basic parameters",
"options": [
Expand All @@ -46,10 +50,9 @@
{
"name": "Processing parameters",
"options": [
"--update",
"--sleep-seconds",
"--max-episodes",
"--ignore-database",
"--sleep",
],
},
]
Expand Down Expand Up @@ -179,7 +182,6 @@ def generate_default_config(ctx: click.Context, param: click.Parameter, value: b
"update_archive",
type=bool,
is_flag=True,
show_envvar=True,
help=Settings.model_fields["update_archive"].description,
)
@click.option(
Expand Down
Loading

0 comments on commit 85a8f00

Please sign in to comment.