fotolab 0.16.14__tar.gz → 0.16.17__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 (41) hide show
  1. {fotolab-0.16.14 → fotolab-0.16.17}/.pre-commit-config.yaml +1 -1
  2. {fotolab-0.16.14 → fotolab-0.16.17}/.python-version +1 -1
  3. {fotolab-0.16.14 → fotolab-0.16.17}/CHANGELOG.md +20 -0
  4. {fotolab-0.16.14 → fotolab-0.16.17}/CONTRIBUTING.md +3 -2
  5. {fotolab-0.16.14 → fotolab-0.16.17}/PKG-INFO +11 -11
  6. {fotolab-0.16.14 → fotolab-0.16.17}/Pipfile.lock +17 -17
  7. {fotolab-0.16.14 → fotolab-0.16.17}/README.md +10 -10
  8. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/__init__.py +1 -1
  9. {fotolab-0.16.14 → fotolab-0.16.17}/noxfile.py +51 -16
  10. {fotolab-0.16.14 → fotolab-0.16.17}/.coveragerc +0 -0
  11. {fotolab-0.16.14 → fotolab-0.16.17}/.gitignore +0 -0
  12. {fotolab-0.16.14 → fotolab-0.16.17}/LICENSE.md +0 -0
  13. {fotolab-0.16.14 → fotolab-0.16.17}/Pipfile +0 -0
  14. {fotolab-0.16.14 → fotolab-0.16.17}/docs/Makefile +0 -0
  15. {fotolab-0.16.14 → fotolab-0.16.17}/docs/make.bat +0 -0
  16. {fotolab-0.16.14 → fotolab-0.16.17}/docs/source/CHANGELOG.md +0 -0
  17. {fotolab-0.16.14 → fotolab-0.16.17}/docs/source/CONTRIBUTING.md +0 -0
  18. {fotolab-0.16.14 → fotolab-0.16.17}/docs/source/LICENSE.md +0 -0
  19. {fotolab-0.16.14 → fotolab-0.16.17}/docs/source/README.md +0 -0
  20. {fotolab-0.16.14 → fotolab-0.16.17}/docs/source/_static/logo.jpg +0 -0
  21. {fotolab-0.16.14 → fotolab-0.16.17}/docs/source/conf.py +0 -0
  22. {fotolab-0.16.14 → fotolab-0.16.17}/docs/source/index.rst +0 -0
  23. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/__main__.py +0 -0
  24. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/animate.py +0 -0
  25. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/auto.py +0 -0
  26. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/border.py +0 -0
  27. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/cli.py +0 -0
  28. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/contrast.py +0 -0
  29. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/env.py +0 -0
  30. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/info.py +0 -0
  31. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/montage.py +0 -0
  32. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/resize.py +0 -0
  33. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/rotate.py +0 -0
  34. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/sharpen.py +0 -0
  35. {fotolab-0.16.14 → fotolab-0.16.17}/fotolab/watermark.py +0 -0
  36. {fotolab-0.16.14 → fotolab-0.16.17}/pyproject.toml +0 -0
  37. {fotolab-0.16.14 → fotolab-0.16.17}/tests/__init__.py +0 -0
  38. {fotolab-0.16.14 → fotolab-0.16.17}/tests/conftest.py +0 -0
  39. {fotolab-0.16.14 → fotolab-0.16.17}/tests/test_env.py +0 -0
  40. {fotolab-0.16.14 → fotolab-0.16.17}/tests/test_help_flag.py +0 -0
  41. {fotolab-0.16.14 → fotolab-0.16.17}/tests/test_quiet_flag.py +0 -0
@@ -107,7 +107,7 @@ repos:
107
107
  - --disable=R0801,W0212
108
108
 
109
109
  - repo: https://github.com/pre-commit/mirrors-mypy
110
- rev: v1.11.1
110
+ rev: v1.11.2
111
111
  hooks:
112
112
  - id: mypy
113
113
  exclude: docs/
@@ -2,4 +2,4 @@
2
2
  3.9.19
3
3
  3.10.14
4
4
  3.11.9
5
- 3.12.4
5
+ 3.12.5
@@ -7,6 +7,26 @@ and this project adheres to [0-based versioning](https://0ver.org/).
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## v0.16.17 (2024-09-08)
11
+
12
+ - Add `posargs` to most sessions in `nox`
13
+ - Bump deps
14
+ - Update comment on running specific task in `lint` session in `nox`
15
+ - Update missing deps and `nox` sessions in contributing doc
16
+
17
+ ## v0.16.16 (2024-09-01)
18
+
19
+ - Bump deps and `pre-commit` hooks
20
+ - Fix `readme` session in `nox` cannot run due to missing deps
21
+ - Install all deps in all `nox` session
22
+
23
+ ## v0.16.15 (2024-08-25)
24
+
25
+ - Bump deps and `pyenv` versions
26
+ - Refactor updating files in `release` session
27
+ - Resolve `mypy` warnings
28
+ - Update all subcommands in readme
29
+
10
30
  ## v0.16.14 (2024-08-18)
11
31
 
12
32
  - Add `release` session in `nox` to bump release
@@ -31,7 +31,7 @@ pyenv install $(cat .python-version)
31
31
  Install necessary packages:
32
32
 
33
33
  ```console
34
- python -m pip install --upgrade pip pipenv
34
+ python -m pip install --upgrade pip pipenv nox
35
35
  pipenv install --dev
36
36
  ```
37
37
 
@@ -50,7 +50,7 @@ nox -l
50
50
  ```console
51
51
  ...
52
52
  * deps -> Update pre-commit hooks and deps.
53
- * lint -> Run pre-commit linter.
53
+ * lint -> Run pre-commit tasks.
54
54
  * test-3.8 -> Run test.
55
55
  * test-3.9 -> Run test.
56
56
  * test-3.10 -> Run test.
@@ -59,6 +59,7 @@ nox -l
59
59
  * cov -> Run test coverage.
60
60
  * doc -> Build doc with sphinx.
61
61
  * readme -> Update console help menu to readme.
62
+ * release -> Bump release.
62
63
 
63
64
  sessions marked with * are selected, sessions marked with - are skipped.
64
65
  ```
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fotolab
3
- Version: 0.16.14
3
+ Version: 0.16.17
4
4
  Summary: A console program that manipulate images.
5
5
  Keywords: photography,photo
6
6
  Author-email: Kian-Meng Ang <kianmeng@cpan.org>
@@ -113,7 +113,7 @@ usage: fotolab animate [-h] [-f FORMAT] [-d DURATION] [-l LOOP]
113
113
  positional arguments:
114
114
  IMAGE_FILENAMES set the image filenames
115
115
 
116
- optional arguments:
116
+ options:
117
117
  -h, --help show this help message and exit
118
118
  -f FORMAT, --format FORMAT
119
119
  set the image format (default: 'gif')
@@ -138,7 +138,7 @@ usage: fotolab auto [-h] IMAGE_FILENAMES [IMAGE_FILENAMES ...]
138
138
  positional arguments:
139
139
  IMAGE_FILENAMES set the image filename
140
140
 
141
- optional arguments:
141
+ options:
142
142
  -h, --help show this help message and exit
143
143
  ```
144
144
 
@@ -160,7 +160,7 @@ usage: fotolab border [-h] [-c COLOR] [-w WIDTH] [-wt WIDTH] [-wr WIDTH]
160
160
  positional arguments:
161
161
  IMAGE_FILENAMES set the image filenames
162
162
 
163
- optional arguments:
163
+ options:
164
164
  -h, --help show this help message and exit
165
165
  -c COLOR, --color COLOR
166
166
  set the color of border (default: 'black')
@@ -192,7 +192,7 @@ usage: fotolab contrast [-h] [-c CUTOFF] IMAGE_FILENAMES [IMAGE_FILENAMES ...]
192
192
  positional arguments:
193
193
  IMAGE_FILENAMES set the image filename
194
194
 
195
- optional arguments:
195
+ options:
196
196
  -h, --help show this help message and exit
197
197
  -c CUTOFF, --cutoff CUTOFF
198
198
  set the percentage of lightest or darkest pixels to
@@ -215,7 +215,7 @@ usage: fotolab info [-h] IMAGE_FILENAME
215
215
  positional arguments:
216
216
  IMAGE_FILENAME set the image filename
217
217
 
218
- optional arguments:
218
+ options:
219
219
  -h, --help show this help message and exit
220
220
  ```
221
221
 
@@ -235,7 +235,7 @@ usage: fotolab rotate [-h] IMAGE_FILENAMES [IMAGE_FILENAMES ...]
235
235
  positional arguments:
236
236
  IMAGE_FILENAMES set the image filenames
237
237
 
238
- optional arguments:
238
+ options:
239
239
  -h, --help show this help message and exit
240
240
  ```
241
241
 
@@ -255,7 +255,7 @@ usage: fotolab montage [-h] IMAGE_FILENAMES [IMAGE_FILENAMES ...]
255
255
  positional arguments:
256
256
  IMAGE_FILENAMES set the image filenames
257
257
 
258
- optional arguments:
258
+ options:
259
259
  -h, --help show this help message and exit
260
260
  ```
261
261
 
@@ -276,7 +276,7 @@ usage: fotolab resize [-h] [-wh WIDTH | -ht HEIGHT]
276
276
  positional arguments:
277
277
  IMAGE_FILENAMES set the image filename
278
278
 
279
- optional arguments:
279
+ options:
280
280
  -h, --help show this help message and exit
281
281
  -wh WIDTH, --width WIDTH
282
282
  set the width of the image (default: '600')
@@ -301,7 +301,7 @@ usage: fotolab sharpen [-h] [-r RADIUS] [-p PERCENT] [-t THRESHOLD]
301
301
  positional arguments:
302
302
  IMAGE_FILENAMES set the image filenames
303
303
 
304
- optional arguments:
304
+ options:
305
305
  -h, --help show this help message and exit
306
306
  -r RADIUS, --radius RADIUS
307
307
  set the radius or size of edges (default: '1')
@@ -333,7 +333,7 @@ usage: fotolab watermark [-h] [-t WATERMARK_TEXT]
333
333
  positional arguments:
334
334
  IMAGE_FILENAMES set the image filenames
335
335
 
336
- optional arguments:
336
+ options:
337
337
  -h, --help show this help message and exit
338
338
  -t WATERMARK_TEXT, --text WATERMARK_TEXT
339
339
  set the watermark text (default: 'kianmeng.org')
@@ -139,11 +139,11 @@
139
139
  },
140
140
  "certifi": {
141
141
  "hashes": [
142
- "sha256:5a1e7645bc0ec61a09e26c36f6106dd4cf40c6db3a1fb6352b0244e7fb057c7b",
143
- "sha256:c198e21b1289c2ab85ee4e67bb4b4ef3ead0892059901a8d5b622f24a1101e90"
142
+ "sha256:922820b53db7a7257ffbda3f597266d435245903d80737e34f8a45ff3e3230d8",
143
+ "sha256:bec941d2aa8195e248a60b31ff9f0558284cf01a52591ceda73ea9afffd69fd9"
144
144
  ],
145
145
  "markers": "python_version >= '3.6'",
146
- "version": "==2024.7.4"
146
+ "version": "==2024.8.30"
147
147
  },
148
148
  "cfgv": {
149
149
  "hashes": [
@@ -444,11 +444,11 @@
444
444
  },
445
445
  "idna": {
446
446
  "hashes": [
447
- "sha256:028ff3aadf0609c1fd278d8ea3089299412a7a8b9bd005dd08b9f8285bcb5cfc",
448
- "sha256:82fee1fc78add43492d3a1898bfa6d8a904cc97d8427f683ed8e798d07761aa0"
447
+ "sha256:050b4e5baadcd44d760cedbd2b8e639f2ff89bbc7a5730fcc662954303377aac",
448
+ "sha256:d838c2c0ed6fced7693d5e8ab8e734d5f8fda53a039c0164afb0b82e771e3603"
449
449
  ],
450
- "markers": "python_version >= '3.5'",
451
- "version": "==3.7"
450
+ "markers": "python_version >= '3.6'",
451
+ "version": "==3.8"
452
452
  },
453
453
  "imagesize": {
454
454
  "hashes": [
@@ -460,12 +460,12 @@
460
460
  },
461
461
  "importlib-metadata": {
462
462
  "hashes": [
463
- "sha256:11901fa0c2f97919b288679932bb64febaeacf289d18ac84dd68cb2e74213369",
464
- "sha256:72e8d4399996132204f9a16dcc751af254a48f8d1b20b9ff0f98d4a8f901e73d"
463
+ "sha256:66f342cc6ac9818fc6ff340576acd24d65ba0b3efabb2b4ac08b598965a4a2f1",
464
+ "sha256:9a547d3bc3608b025f93d403fdd1aae741c24fbb8314df4b155675742ce303c5"
465
465
  ],
466
466
  "index": "pypi",
467
467
  "markers": "python_version >= '3.8'",
468
- "version": "==8.2.0"
468
+ "version": "==8.4.0"
469
469
  },
470
470
  "iniconfig": {
471
471
  "hashes": [
@@ -887,12 +887,12 @@
887
887
  },
888
888
  "sphinx-autodoc-typehints": {
889
889
  "hashes": [
890
- "sha256:b7058e8c5831e5598afca1a78fda0695d3291388d954464a6e480c36198680c0",
891
- "sha256:fde3d888949bd0a91207cf1e54afda58121dbb4bf1f183d0cc78a0826654c974"
890
+ "sha256:8f8281654ddf5709875429b7120d367f4edee39a131e13d5806e4f779a81bf0f",
891
+ "sha256:c9774d47e7d304cf975e073df49ebf19763dca94ac0295e7013b522b26cb18de"
892
892
  ],
893
893
  "index": "pypi",
894
- "markers": "python_version >= '3.9'",
895
- "version": "==2.2.3"
894
+ "markers": "python_version >= '3.10'",
895
+ "version": "==2.4.0"
896
896
  },
897
897
  "sphinx-copybutton": {
898
898
  "hashes": [
@@ -978,11 +978,11 @@
978
978
  },
979
979
  "zipp": {
980
980
  "hashes": [
981
- "sha256:0145e43d89664cfe1a2e533adc75adafed82fe2da404b4bbb6b026c0157bdb31",
982
- "sha256:58da6168be89f0be59beb194da1250516fdaa062ccebd30127ac65d30045e10d"
981
+ "sha256:9960cd8967c8f85a56f920d5d507274e74f9ff813a0ab8889a5b5be2daf44064",
982
+ "sha256:c22b14cc4763c5a5b04134207736c107db42e9d3ef2d9779d465f5f1bcba572b"
983
983
  ],
984
984
  "markers": "python_version >= '3.8'",
985
- "version": "==3.20.0"
985
+ "version": "==3.20.1"
986
986
  }
987
987
  }
988
988
  }
@@ -91,7 +91,7 @@ usage: fotolab animate [-h] [-f FORMAT] [-d DURATION] [-l LOOP]
91
91
  positional arguments:
92
92
  IMAGE_FILENAMES set the image filenames
93
93
 
94
- optional arguments:
94
+ options:
95
95
  -h, --help show this help message and exit
96
96
  -f FORMAT, --format FORMAT
97
97
  set the image format (default: 'gif')
@@ -116,7 +116,7 @@ usage: fotolab auto [-h] IMAGE_FILENAMES [IMAGE_FILENAMES ...]
116
116
  positional arguments:
117
117
  IMAGE_FILENAMES set the image filename
118
118
 
119
- optional arguments:
119
+ options:
120
120
  -h, --help show this help message and exit
121
121
  ```
122
122
 
@@ -138,7 +138,7 @@ usage: fotolab border [-h] [-c COLOR] [-w WIDTH] [-wt WIDTH] [-wr WIDTH]
138
138
  positional arguments:
139
139
  IMAGE_FILENAMES set the image filenames
140
140
 
141
- optional arguments:
141
+ options:
142
142
  -h, --help show this help message and exit
143
143
  -c COLOR, --color COLOR
144
144
  set the color of border (default: 'black')
@@ -170,7 +170,7 @@ usage: fotolab contrast [-h] [-c CUTOFF] IMAGE_FILENAMES [IMAGE_FILENAMES ...]
170
170
  positional arguments:
171
171
  IMAGE_FILENAMES set the image filename
172
172
 
173
- optional arguments:
173
+ options:
174
174
  -h, --help show this help message and exit
175
175
  -c CUTOFF, --cutoff CUTOFF
176
176
  set the percentage of lightest or darkest pixels to
@@ -193,7 +193,7 @@ usage: fotolab info [-h] IMAGE_FILENAME
193
193
  positional arguments:
194
194
  IMAGE_FILENAME set the image filename
195
195
 
196
- optional arguments:
196
+ options:
197
197
  -h, --help show this help message and exit
198
198
  ```
199
199
 
@@ -213,7 +213,7 @@ usage: fotolab rotate [-h] IMAGE_FILENAMES [IMAGE_FILENAMES ...]
213
213
  positional arguments:
214
214
  IMAGE_FILENAMES set the image filenames
215
215
 
216
- optional arguments:
216
+ options:
217
217
  -h, --help show this help message and exit
218
218
  ```
219
219
 
@@ -233,7 +233,7 @@ usage: fotolab montage [-h] IMAGE_FILENAMES [IMAGE_FILENAMES ...]
233
233
  positional arguments:
234
234
  IMAGE_FILENAMES set the image filenames
235
235
 
236
- optional arguments:
236
+ options:
237
237
  -h, --help show this help message and exit
238
238
  ```
239
239
 
@@ -254,7 +254,7 @@ usage: fotolab resize [-h] [-wh WIDTH | -ht HEIGHT]
254
254
  positional arguments:
255
255
  IMAGE_FILENAMES set the image filename
256
256
 
257
- optional arguments:
257
+ options:
258
258
  -h, --help show this help message and exit
259
259
  -wh WIDTH, --width WIDTH
260
260
  set the width of the image (default: '600')
@@ -279,7 +279,7 @@ usage: fotolab sharpen [-h] [-r RADIUS] [-p PERCENT] [-t THRESHOLD]
279
279
  positional arguments:
280
280
  IMAGE_FILENAMES set the image filenames
281
281
 
282
- optional arguments:
282
+ options:
283
283
  -h, --help show this help message and exit
284
284
  -r RADIUS, --radius RADIUS
285
285
  set the radius or size of edges (default: '1')
@@ -311,7 +311,7 @@ usage: fotolab watermark [-h] [-t WATERMARK_TEXT]
311
311
  positional arguments:
312
312
  IMAGE_FILENAMES set the image filenames
313
313
 
314
- optional arguments:
314
+ options:
315
315
  -h, --help show this help message and exit
316
316
  -t WATERMARK_TEXT, --text WATERMARK_TEXT
317
317
  set the watermark text (default: 'kianmeng.org')
@@ -21,7 +21,7 @@ import subprocess
21
21
  import sys
22
22
  from pathlib import Path
23
23
 
24
- __version__ = "0.16.14"
24
+ __version__ = "0.16.17"
25
25
 
26
26
  log = logging.getLogger(__name__)
27
27
 
@@ -13,6 +13,8 @@
13
13
  # You should have received a copy of the GNU General Public License
14
14
  # along with this program. If not, see <https://www.gnu.org/licenses/>.
15
15
 
16
+ # mypy: disable-error-code="attr-defined"
17
+
16
18
  """Nox configuration."""
17
19
 
18
20
  import ast
@@ -33,7 +35,12 @@ def deps(session: nox.Session) -> None:
33
35
  @nox.session()
34
36
  @nox.session(python="3.12")
35
37
  def lint(session: nox.Session) -> None:
36
- """Run pre-commit linter."""
38
+ """Run pre-commit tasks.
39
+
40
+ For running selected task within pre-commit:
41
+
42
+ nox -s lint -- pylint
43
+ """
37
44
  session.install("pre-commit")
38
45
  session.run("pre-commit", "run", "--all-files", *session.posargs)
39
46
 
@@ -60,6 +67,7 @@ def cov(session: nox.Session) -> None:
60
67
  "--cov",
61
68
  "--cov-report=term",
62
69
  "--cov-report=html",
70
+ *session.posargs,
63
71
  )
64
72
 
65
73
 
@@ -67,7 +75,9 @@ def cov(session: nox.Session) -> None:
67
75
  def doc(session: nox.Session) -> None:
68
76
  """Build doc with sphinx."""
69
77
  _pipenv_install(session)
70
- session.run("sphinx-build", "docs/source/", "docs/build/html")
78
+ session.run(
79
+ "sphinx-build", "docs/source/", "docs/build/html", *session.posargs
80
+ )
71
81
 
72
82
 
73
83
  @nox.session(python="3.12")
@@ -82,6 +92,27 @@ def readme(session: nox.Session) -> None:
82
92
  marker = content.split("<!--help !-->")[1]
83
93
  readme_md = content.replace(marker, help_codeblock)
84
94
 
95
+ for subcommand in [
96
+ "animate",
97
+ "auto",
98
+ "border",
99
+ "contrast",
100
+ "info",
101
+ "resize",
102
+ "rotate",
103
+ "montage",
104
+ "sharpen",
105
+ "watermark",
106
+ "env",
107
+ ]:
108
+ help_message = session.run(
109
+ "fotolab", subcommand, "-h", silent=True
110
+ )
111
+ help_codeblock = f"\n\n```console\n{help_message}```\n\n"
112
+
113
+ marker = readme_md.split(f"<!--help-{subcommand} !-->")[1]
114
+ readme_md = readme_md.replace(marker, help_codeblock)
115
+
85
116
  f.seek(0)
86
117
  f.write(readme_md)
87
118
  f.truncate()
@@ -109,26 +140,30 @@ def release(_session: nox.Session) -> None:
109
140
  f"{before_version.minor}."
110
141
  f"{before_version.micro + 1}"
111
142
  )
143
+ _search_and_replace(
144
+ "fotolab/__init__.py", str(before_version), after_version
145
+ )
112
146
 
113
- with open("fotolab/__init__.py", "r+", encoding="utf8") as f:
114
- content = f.read()
115
- content = content.replace(str(before_version), after_version)
116
- f.seek(0)
117
- f.write(content)
118
- f.truncate()
119
-
120
- with open("CHANGELOG.md", "r+", encoding="utf8") as f:
121
147
  date = datetime.date.today().strftime("%Y-%m-%d")
122
148
  before_header = "## [Unreleased]\n\n"
123
149
  after_header = f"## [Unreleased]\n\n## v{after_version} ({date})\n\n"
150
+ _search_and_replace("CHANGELOG.md", before_header, after_header)
124
151
 
152
+
153
+ def _pipenv_install(session: nox.Session) -> None:
154
+ session.install("pipenv")
155
+ session.run(
156
+ "pipenv",
157
+ "install",
158
+ "--dev",
159
+ env={"PIPENV_VERBOSITY": "-1"}
160
+ )
161
+
162
+
163
+ def _search_and_replace(file, search, replace) -> None:
164
+ with open(file, "r+", encoding="utf8") as f:
125
165
  content = f.read()
126
- content = content.replace(before_header, after_header)
166
+ content = content.replace(search, replace)
127
167
  f.seek(0)
128
168
  f.write(content)
129
169
  f.truncate()
130
-
131
-
132
- def _pipenv_install(session: nox.Session) -> None:
133
- session.install("pipenv")
134
- session.run("pipenv", "install", "--dev", env={"PIPENV_VERBOSITY": "-1"})
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
File without changes
File without changes
File without changes
File without changes
File without changes