fotolab 0.16.13__tar.gz → 0.16.15__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.
- {fotolab-0.16.13 → fotolab-0.16.15}/.pre-commit-config.yaml +1 -1
- {fotolab-0.16.13 → fotolab-0.16.15}/.python-version +1 -1
- {fotolab-0.16.13 → fotolab-0.16.15}/CHANGELOG.md +14 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/PKG-INFO +11 -11
- {fotolab-0.16.13 → fotolab-0.16.15}/Pipfile.lock +6 -6
- {fotolab-0.16.13 → fotolab-0.16.15}/README.md +10 -10
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/__init__.py +1 -1
- {fotolab-0.16.13 → fotolab-0.16.15}/noxfile.py +70 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/.coveragerc +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/.gitignore +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/CONTRIBUTING.md +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/LICENSE.md +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/Pipfile +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/Makefile +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/make.bat +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/source/CHANGELOG.md +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/source/CONTRIBUTING.md +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/source/LICENSE.md +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/source/README.md +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/source/_static/logo.jpg +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/source/conf.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/docs/source/index.rst +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/__main__.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/animate.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/auto.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/border.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/cli.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/contrast.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/env.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/info.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/montage.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/resize.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/rotate.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/sharpen.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/fotolab/watermark.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/pyproject.toml +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/tests/__init__.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/tests/conftest.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/tests/test_env.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/tests/test_help_flag.py +0 -0
- {fotolab-0.16.13 → fotolab-0.16.15}/tests/test_quiet_flag.py +0 -0
@@ -7,6 +7,20 @@ and this project adheres to [0-based versioning](https://0ver.org/).
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## v0.16.15 (2024-08-25)
|
11
|
+
|
12
|
+
- Bump deps and `pyenv` versions
|
13
|
+
- Refactor updating files in `release` session
|
14
|
+
- Resolve `mypy` warnings
|
15
|
+
- Update all subcommands in readme
|
16
|
+
|
17
|
+
## v0.16.14 (2024-08-18)
|
18
|
+
|
19
|
+
- Add `release` session in `nox` to bump release
|
20
|
+
- Bump deps and `pre-commit` hooks
|
21
|
+
- Run `lint` session in `nox` using latest Python
|
22
|
+
- Trunate updated readme during write
|
23
|
+
|
10
24
|
## v0.16.13 (2024-08-11)
|
11
25
|
|
12
26
|
- Bump deps and `pre-commit` hooks
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: fotolab
|
3
|
-
Version: 0.16.
|
3
|
+
Version: 0.16.15
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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')
|
@@ -460,12 +460,12 @@
|
|
460
460
|
},
|
461
461
|
"importlib-metadata": {
|
462
462
|
"hashes": [
|
463
|
-
"sha256:
|
464
|
-
"sha256:
|
463
|
+
"sha256:66f342cc6ac9818fc6ff340576acd24d65ba0b3efabb2b4ac08b598965a4a2f1",
|
464
|
+
"sha256:9a547d3bc3608b025f93d403fdd1aae741c24fbb8314df4b155675742ce303c5"
|
465
465
|
],
|
466
466
|
"index": "pypi",
|
467
467
|
"markers": "python_version >= '3.8'",
|
468
|
-
"version": "==8.
|
468
|
+
"version": "==8.4.0"
|
469
469
|
},
|
470
470
|
"iniconfig": {
|
471
471
|
"hashes": [
|
@@ -978,11 +978,11 @@
|
|
978
978
|
},
|
979
979
|
"zipp": {
|
980
980
|
"hashes": [
|
981
|
-
"sha256:
|
982
|
-
"sha256:
|
981
|
+
"sha256:0145e43d89664cfe1a2e533adc75adafed82fe2da404b4bbb6b026c0157bdb31",
|
982
|
+
"sha256:58da6168be89f0be59beb194da1250516fdaa062ccebd30127ac65d30045e10d"
|
983
983
|
],
|
984
984
|
"markers": "python_version >= '3.8'",
|
985
|
-
"version": "==3.
|
985
|
+
"version": "==3.20.0"
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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')
|
@@ -13,9 +13,15 @@
|
|
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
|
|
20
|
+
import ast
|
21
|
+
import datetime
|
22
|
+
|
18
23
|
import nox
|
24
|
+
from packaging.version import Version
|
19
25
|
|
20
26
|
|
21
27
|
@nox.session()
|
@@ -27,6 +33,7 @@ def deps(session: nox.Session) -> None:
|
|
27
33
|
|
28
34
|
|
29
35
|
@nox.session()
|
36
|
+
@nox.session(python="3.12")
|
30
37
|
def lint(session: nox.Session) -> None:
|
31
38
|
"""Run pre-commit linter."""
|
32
39
|
session.install("pre-commit")
|
@@ -77,10 +84,73 @@ def readme(session: nox.Session) -> None:
|
|
77
84
|
marker = content.split("<!--help !-->")[1]
|
78
85
|
readme_md = content.replace(marker, help_codeblock)
|
79
86
|
|
87
|
+
for subcommand in [
|
88
|
+
"animate",
|
89
|
+
"auto",
|
90
|
+
"border",
|
91
|
+
"contrast",
|
92
|
+
"info",
|
93
|
+
"resize",
|
94
|
+
"rotate",
|
95
|
+
"montage",
|
96
|
+
"sharpen",
|
97
|
+
"watermark",
|
98
|
+
"env",
|
99
|
+
]:
|
100
|
+
help_message = session.run(
|
101
|
+
"fotolab", subcommand, "-h", silent=True
|
102
|
+
)
|
103
|
+
help_codeblock = f"\n\n```console\n{help_message}```\n\n"
|
104
|
+
|
105
|
+
marker = readme_md.split(f"<!--help-{subcommand} !-->")[1]
|
106
|
+
readme_md = readme_md.replace(marker, help_codeblock)
|
107
|
+
|
80
108
|
f.seek(0)
|
81
109
|
f.write(readme_md)
|
110
|
+
f.truncate()
|
111
|
+
|
112
|
+
|
113
|
+
@nox.session(python="3.12", reuse_venv=True)
|
114
|
+
def release(_session: nox.Session) -> None:
|
115
|
+
"""Bump release."""
|
116
|
+
with open("fotolab/__init__.py", "r", encoding="utf8") as f:
|
117
|
+
tree = ast.parse(f.read())
|
118
|
+
current_version = None
|
119
|
+
for node in ast.walk(tree):
|
120
|
+
if isinstance(node, ast.Assign) and len(node.targets) == 1:
|
121
|
+
target, value = node.targets[0], node.value
|
122
|
+
if target.id == "__version__" and isinstance(value, ast.Str):
|
123
|
+
current_version = value.s
|
124
|
+
break
|
125
|
+
|
126
|
+
if current_version is None:
|
127
|
+
raise ValueError("Missing __version__ variable in __init__.py")
|
128
|
+
|
129
|
+
before_version = Version(current_version)
|
130
|
+
after_version = (
|
131
|
+
f"{before_version.major}."
|
132
|
+
f"{before_version.minor}."
|
133
|
+
f"{before_version.micro + 1}"
|
134
|
+
)
|
135
|
+
_search_and_replace(
|
136
|
+
"fotolab/__init__.py", str(before_version), after_version
|
137
|
+
)
|
138
|
+
|
139
|
+
date = datetime.date.today().strftime("%Y-%m-%d")
|
140
|
+
before_header = "## [Unreleased]\n\n"
|
141
|
+
after_header = f"## [Unreleased]\n\n## v{after_version} ({date})\n\n"
|
142
|
+
_search_and_replace("CHANGELOG.md", before_header, after_header)
|
82
143
|
|
83
144
|
|
84
145
|
def _pipenv_install(session: nox.Session) -> None:
|
85
146
|
session.install("pipenv")
|
86
147
|
session.run("pipenv", "install", "--dev", env={"PIPENV_VERBOSITY": "-1"})
|
148
|
+
|
149
|
+
|
150
|
+
def _search_and_replace(file, search, replace) -> None:
|
151
|
+
with open(file, "r+", encoding="utf8") as f:
|
152
|
+
content = f.read()
|
153
|
+
content = content.replace(search, replace)
|
154
|
+
f.seek(0)
|
155
|
+
f.write(content)
|
156
|
+
f.truncate()
|
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
|
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
|