heatmap_cli 0.22.28__tar.gz → 0.22.30__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. {heatmap_cli-0.22.28/src/heatmap_cli.egg-info → heatmap_cli-0.22.30}/PKG-INFO +1 -1
  2. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/pyproject.toml +1 -1
  3. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli/cli.py +8 -7
  4. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30/src/heatmap_cli.egg-info}/PKG-INFO +1 -1
  5. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_week_option.py +13 -0
  6. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/LICENSE.md +0 -0
  7. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/README.md +0 -0
  8. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/setup.cfg +0 -0
  9. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli/__init__.py +0 -0
  10. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli/__main__.py +0 -0
  11. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli/heatmap.py +0 -0
  12. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/SOURCES.txt +0 -0
  13. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/dependency_links.txt +0 -0
  14. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/entry_points.txt +0 -0
  15. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/requires.txt +0 -0
  16. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/src/heatmap_cli.egg-info/top_level.txt +0 -0
  17. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_animate_by_week.py +0 -0
  18. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_annotate_flag.py +0 -0
  19. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_cbar_flag.py +0 -0
  20. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_cmap_option.py +0 -0
  21. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_cmax_option.py +0 -0
  22. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_cmin_option.py +0 -0
  23. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_debug_flag.py +0 -0
  24. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_demo_option.py +0 -0
  25. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_end_date_option.py +0 -0
  26. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_env_flag.py +0 -0
  27. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_heatmap_direct.py +0 -0
  28. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_heatmap_errors.py +0 -0
  29. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_heatmap_utils.py +0 -0
  30. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_help_flag.py +0 -0
  31. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_output_dir_option.py +0 -0
  32. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_purge_flag.py +0 -0
  33. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_quiet_flag.py +0 -0
  34. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_start_date_option.py +0 -0
  35. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_title_option.py +0 -0
  36. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_verbose_flag.py +0 -0
  37. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_version_flag.py +0 -0
  38. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_year_option.py +0 -0
  39. {heatmap_cli-0.22.28 → heatmap_cli-0.22.30}/tests/test_yes_flag.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: heatmap_cli
3
- Version: 0.22.28
3
+ Version: 0.22.30
4
4
  Summary: A console program that generates a yearly calendar heatmap.
5
5
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -25,7 +25,7 @@ classifiers = [
25
25
  "Programming Language :: Python",
26
26
  "Topic :: Scientific/Engineering :: Visualization",
27
27
  ]
28
- version = "0.22.28"
28
+ version = "0.22.30"
29
29
  keywords = ["heatmap", "cli", "visualization", "calendar", "data-viz"]
30
30
  dependencies = [
31
31
  "matplotlib",
@@ -127,12 +127,10 @@ def build_parser() -> argparse.ArgumentParser:
127
127
  "--week",
128
128
  dest="week",
129
129
  type=int,
130
- default=datetime.datetime.now(tz=datetime.timezone.utc)
131
- .isocalendar()
132
- .week,
130
+ default=None,
133
131
  help=(
134
132
  "filter until week of the year from the CSV file "
135
- "(default: '%(default)s')"
133
+ "(default: current week)"
136
134
  ),
137
135
  metavar="WEEK",
138
136
  )
@@ -413,10 +411,13 @@ def _process_args(
413
411
  if not parsed_args.demo and parsed_args.input_filename is None:
414
412
  parser.error("the following arguments are required: CSV_FILENAME")
415
413
 
416
- # Handle default for year
414
+ # Handle defaults for year and week
415
+ if parsed_args.year is None or parsed_args.week is None:
416
+ now = datetime.datetime.now(tz=datetime.timezone.utc)
417
417
  if parsed_args.year is None:
418
- current_year = datetime.datetime.now(tz=datetime.timezone.utc).year
419
- parsed_args.year = [current_year]
418
+ parsed_args.year = [now.year]
419
+ if parsed_args.week is None:
420
+ parsed_args.week = now.isocalendar().week
420
421
 
421
422
  # Handle default for cmap
422
423
  if parsed_args.cmap is None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: heatmap_cli
3
- Version: 0.22.28
3
+ Version: 0.22.30
4
4
  Summary: A console program that generates a yearly calendar heatmap.
5
5
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
6
6
  License-Expression: AGPL-3.0-or-later
@@ -13,9 +13,22 @@
13
13
  # You should have received a copy of the GNU Affero General Public License
14
14
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
15
15
 
16
+ import datetime
17
+
16
18
  import pytest
17
19
 
18
20
 
21
+ def test_default_week_is_current_week(cli_runner, csv_file):
22
+ """Test that --week defaults to the current ISO week when not provided."""
23
+ csv = csv_file("sample.csv")
24
+ expected_week = (
25
+ datetime.datetime.now(tz=datetime.timezone.utc).isocalendar().week
26
+ )
27
+ ret = cli_runner(csv, "-y", "2024", "-d")
28
+
29
+ assert f"week={expected_week}" in ret.stderr
30
+
31
+
19
32
  @pytest.mark.parametrize("option", ["-w", "--week"])
20
33
  def test_debug_logs(cli_runner, csv_file, option):
21
34
  csv = csv_file("sample.csv")
File without changes
File without changes
File without changes