Skip to content

Commit d2f4627

Browse files
committed
turn off color if rich dependency is present, and enforce its presence
1 parent f103008 commit d2f4627

File tree

5 files changed

+105
-21
lines changed

5 files changed

+105
-21
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.7.1] - 2023-12-26
9+
### Fixed
10+
- turn off color if rich dependency is present, and enforce its presence
11+
812
## [0.7.0] - 2023-12-24
913
### Added
1014
- command 'next' to list upcoming events, filtered by minimum rating

README.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,25 @@ pip install optimal-congress
2020
`optimal-congress` provides the following commands:
2121

2222
```
23-
$ optimal-congress --help
24-
Usage: optimal-congress [OPTIONS] COMMAND [ARGS]...
25-
26-
Optimize your personal schedule for the 37c3.
27-
28-
Options:
29-
-v, --verbose
30-
-h, --help Show this message and exit.
31-
32-
Commands:
33-
dump Export all latest ratings to CSV, for bulk editing.
34-
fetch Fetch events and rooms from API, and update local cache.
35-
load Bulk import ratings from CSV.
36-
next List next upcoming events, filtered by minimum rating.
37-
optimize Optimize the schedule based on ratings.
38-
rate Interactively rate those events that have not been rated yet.
39-
ratings List all latest ratings.
23+
$ optimal-congress -h
24+
25+
Usage: optimal-congress [OPTIONS] COMMAND [ARGS]...
26+
27+
Optimize your personal schedule for the 37c3.
28+
29+
╭─ Options ────────────────────────────────────────────────────────────────────────────╮
30+
│ --verbose -v Include debug messages in output. │
31+
│ --help -h Show this message and exit. │
32+
╰──────────────────────────────────────────────────────────────────────────────────────╯
33+
╭─ Commands ───────────────────────────────────────────────────────────────────────────╮
34+
│ dump Export all latest ratings to CSV, for bulk editing. │
35+
│ fetch Fetch events and rooms from API, and update local cache. │
36+
│ load Bulk import ratings from CSV. │
37+
│ next List next upcoming events, filtered by minimum rating. │
38+
│ optimize Optimize the schedule based on ratings. │
39+
│ rate Interactively rate those events that have not been rated yet. │
40+
│ ratings List all latest ratings. │
41+
╰──────────────────────────────────────────────────────────────────────────────────────╯
4042
```
4143

4244
## Example Workflow

optimal_congress/cli.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Main entry point for the 37c3 schedule optimizer."""
22
# %%
33
import logging
4+
import os
45
from pathlib import Path
56

67
import pandas as pd
@@ -25,6 +26,9 @@
2526
join_events_with_ratings,
2627
)
2728

29+
# deactivate color for rich/colorama
30+
os.environ["NO_COLOR"] = "1"
31+
2832
app = typer.Typer(
2933
add_completion=False,
3034
context_settings={"help_option_names": ["-h", "--help"]},
@@ -33,7 +37,14 @@
3337

3438
# %%
3539
@app.callback()
36-
def users_callback(verbose: bool = typer.Option(False, "-v", "--verbose")) -> None:
40+
def users_callback(
41+
verbose: bool = typer.Option(
42+
False,
43+
"-v",
44+
"--verbose",
45+
help="Include debug messages in output.",
46+
),
47+
) -> None:
3748
"""Optimize your personal schedule for the 37c3."""
3849
# set log level
3950
log_level = logging.DEBUG if verbose else logging.INFO

poetry.lock

Lines changed: 68 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "optimal-congress"
3-
version = "0.7.0"
3+
version = "0.7.1"
44
description = "CLI to find an optimal, personal schedule for the 37c3 congress."
55
homepage = "https://github.com/top-on/optimal-congress"
66
authors = ["top-on <top-on@posteo.de>"]
@@ -10,7 +10,7 @@ packages = [{ include = "optimal_congress" }]
1010
[tool.poetry.dependencies]
1111
python = "^3.10"
1212
pydantic = "^2.5.2"
13-
typer = "^0.9.0"
13+
typer = { extras = ["all"], version = "^0.9.0" } # extras include rich
1414
pytz = "^2023.3.post1"
1515
pulp = "^2.7.0"
1616
pandas = "^2.1.4"

0 commit comments

Comments
 (0)