fotolab 0.28.4__tar.gz → 0.28.5__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 (44) hide show
  1. {fotolab-0.28.4 → fotolab-0.28.5}/CHANGELOG.md +8 -0
  2. {fotolab-0.28.4 → fotolab-0.28.5}/PKG-INFO +1 -1
  3. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/__init__.py +3 -2
  4. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/contrast.py +19 -5
  5. {fotolab-0.28.4 → fotolab-0.28.5}/noxfile.py +3 -1
  6. fotolab-0.28.5/tests/__init__.py +0 -0
  7. {fotolab-0.28.4 → fotolab-0.28.5}/.coveragerc +0 -0
  8. {fotolab-0.28.4 → fotolab-0.28.5}/.gitignore +0 -0
  9. {fotolab-0.28.4 → fotolab-0.28.5}/.pre-commit-config.yaml +0 -0
  10. {fotolab-0.28.4 → fotolab-0.28.5}/.python-version +0 -0
  11. {fotolab-0.28.4 → fotolab-0.28.5}/CONTRIBUTING.md +0 -0
  12. {fotolab-0.28.4 → fotolab-0.28.5}/LICENSE.md +0 -0
  13. {fotolab-0.28.4 → fotolab-0.28.5}/Pipfile +0 -0
  14. {fotolab-0.28.4 → fotolab-0.28.5}/Pipfile.lock +0 -0
  15. {fotolab-0.28.4 → fotolab-0.28.5}/README.md +0 -0
  16. {fotolab-0.28.4 → fotolab-0.28.5}/docs/Makefile +0 -0
  17. {fotolab-0.28.4 → fotolab-0.28.5}/docs/make.bat +0 -0
  18. {fotolab-0.28.4 → fotolab-0.28.5}/docs/source/CHANGELOG.md +0 -0
  19. {fotolab-0.28.4 → fotolab-0.28.5}/docs/source/CONTRIBUTING.md +0 -0
  20. {fotolab-0.28.4 → fotolab-0.28.5}/docs/source/LICENSE.md +0 -0
  21. {fotolab-0.28.4 → fotolab-0.28.5}/docs/source/README.md +0 -0
  22. {fotolab-0.28.4 → fotolab-0.28.5}/docs/source/_static/logo.jpg +0 -0
  23. {fotolab-0.28.4 → fotolab-0.28.5}/docs/source/conf.py +0 -0
  24. {fotolab-0.28.4 → fotolab-0.28.5}/docs/source/index.rst +0 -0
  25. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/__main__.py +0 -0
  26. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/cli.py +0 -0
  27. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/__init__.py +0 -0
  28. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/animate.py +0 -0
  29. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/auto.py +0 -0
  30. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/border.py +0 -0
  31. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/env.py +0 -0
  32. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/halftone.py +0 -0
  33. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/info.py +0 -0
  34. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/montage.py +0 -0
  35. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/resize.py +0 -0
  36. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/rotate.py +0 -0
  37. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/sharpen.py +0 -0
  38. {fotolab-0.28.4 → fotolab-0.28.5}/fotolab/subcommands/watermark.py +0 -0
  39. /fotolab-0.28.4/tests/__init__.py → /fotolab-0.28.5/generate +0 -0
  40. {fotolab-0.28.4 → fotolab-0.28.5}/pyproject.toml +0 -0
  41. {fotolab-0.28.4 → fotolab-0.28.5}/tests/conftest.py +0 -0
  42. {fotolab-0.28.4 → fotolab-0.28.5}/tests/test_env_subcommand.py +0 -0
  43. {fotolab-0.28.4 → fotolab-0.28.5}/tests/test_help_flag.py +0 -0
  44. {fotolab-0.28.4 → fotolab-0.28.5}/tests/test_quiet_flag.py +0 -0
@@ -7,6 +7,14 @@ and this project adheres to [0-based versioning](https://0ver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## v0.28.5 (2025-04-13)
11
+
12
+ - Group build and publish package commands together
13
+ - Improve contrast subcommand and add pylint disable
14
+ - Prompt to publish package in release nox job
15
+ - Resolve pylint raised issue
16
+ - Validate cutoff value is between 0 and 50 in contrast subcommand
17
+
10
18
  ## v0.28.4 (2025-04-06)
11
19
 
12
20
  - Build the release after release `nox` job
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fotolab
3
- Version: 0.28.4
3
+ Version: 0.28.5
4
4
  Summary: A console program that manipulate images.
5
5
  Keywords: photography,photo
6
6
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
@@ -23,7 +23,7 @@ from pathlib import Path
23
23
 
24
24
  from PIL import Image
25
25
 
26
- __version__ = "0.28.4"
26
+ __version__ = "0.28.5"
27
27
 
28
28
  log = logging.getLogger(__name__)
29
29
 
@@ -99,7 +99,8 @@ def _open_image(filename):
99
99
  elif sys.platform == "darwin":
100
100
  subprocess.call(["open", filename])
101
101
  elif sys.platform == "windows":
102
- subprocess.Popen(["open", filename])
102
+ with subprocess.Popen(["open", filename], shell=True) as proc:
103
+ proc.wait()
103
104
  log.info("open image: %s", filename.resolve())
104
105
 
105
106
  except OSError as error:
@@ -25,10 +25,24 @@ from fotolab import save_image
25
25
  log = logging.getLogger(__name__)
26
26
 
27
27
 
28
- def build_subparser(subparsers) -> None:
28
+ # pylint: disable=protected-access
29
+ def _validate_cutoff(value: str) -> float:
30
+ """Validate the cutoff value."""
31
+ try:
32
+ f_value = float(value)
33
+ except ValueError as e:
34
+ raise argparse.ArgumentTypeError(f"invalid float value: '{value}'") from e
35
+ if not 0 <= f_value <= 50:
36
+ raise argparse.ArgumentTypeError(
37
+ f"cutoff value {f_value} must be between 0 and 50"
38
+ )
39
+ return f_value
40
+
41
+
42
+ def build_subparser(subparsers: argparse._SubParsersAction) -> None:
29
43
  """Build the subparser."""
30
44
  contrast_parser = subparsers.add_parser(
31
- "contrast", help="contrast an image"
45
+ "contrast", help="contrast an image."
32
46
  )
33
47
 
34
48
  contrast_parser.set_defaults(func=run)
@@ -46,10 +60,10 @@ def build_subparser(subparsers) -> None:
46
60
  "-c",
47
61
  "--cutoff",
48
62
  dest="cutoff",
49
- type=float,
50
- default=1,
63
+ type=_validate_cutoff,
64
+ default=1.0,
51
65
  help=(
52
- "set the percentage of lightest or darkest pixels"
66
+ "set the percentage (0-50) of lightest or darkest pixels"
53
67
  " to discard from histogram"
54
68
  " (default: '%(default)s')"
55
69
  ),
@@ -184,7 +184,9 @@ def release(session: nox.Session) -> None:
184
184
  external=True,
185
185
  )
186
186
 
187
- session.run("flit", "build")
187
+ if input("Publish package to pypi? (y/n): ").lower() in ["y", "yes"]:
188
+ session.run("flit", "build")
189
+ session.run("flit", "publish")
188
190
 
189
191
 
190
192
  def _pipenv_install(session: nox.Session) -> None:
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes