fotolab 0.31.2__tar.gz → 0.31.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.
- fotolab-0.31.5/.pre-commit-config.yaml +47 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/CHANGELOG.md +14 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/CONTRIBUTING.md +3 -3
- {fotolab-0.31.2 → fotolab-0.31.5}/PKG-INFO +7 -12
- {fotolab-0.31.2 → fotolab-0.31.5}/README.md +4 -10
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/__init__.py +2 -1
- {fotolab-0.31.2 → fotolab-0.31.5}/noxfile.py +62 -68
- {fotolab-0.31.2 → fotolab-0.31.5}/pyproject.toml +26 -1
- fotolab-0.31.5/uv.lock +1377 -0
- fotolab-0.31.2/.pre-commit-config.yaml +0 -120
- fotolab-0.31.2/Pipfile +0 -33
- fotolab-0.31.2/Pipfile.lock +0 -1103
- {fotolab-0.31.2 → fotolab-0.31.5}/.coveragerc +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/.gitignore +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/.python-version +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/LICENSE.md +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/Makefile +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/make.bat +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/source/CHANGELOG.md +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/source/CONTRIBUTING.md +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/source/LICENSE.md +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/source/README.md +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/source/_static/logo.jpg +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/source/conf.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/docs/source/index.rst +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/__main__.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/cli.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/__init__.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/animate.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/auto.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/border.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/contrast.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/env.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/halftone.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/info.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/montage.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/resize.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/rotate.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/sharpen.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/fotolab/subcommands/watermark.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/generate +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/__init__.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/conftest.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_animate_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_auto_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_border_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_contrast_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_env_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_halftone_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_help_flag.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_info_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_montage_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_quiet_flag.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_resize_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_rotate_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_sharpen_subcommand.py +0 -0
- {fotolab-0.31.2 → fotolab-0.31.5}/tests/test_watermark_subcommand.py +0 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
# See https://pre-commit.com for more information
|
2
|
+
# See https://pre-commit.com/hooks.html for more hooks
|
3
|
+
repos:
|
4
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
5
|
+
rev: v5.0.0
|
6
|
+
hooks:
|
7
|
+
- id: check-case-conflict
|
8
|
+
- id: check-merge-conflict
|
9
|
+
- id: check-toml
|
10
|
+
- id: check-yaml
|
11
|
+
- id: debug-statements
|
12
|
+
- id: detect-private-key
|
13
|
+
- id: end-of-file-fixer
|
14
|
+
- id: mixed-line-ending
|
15
|
+
- id: trailing-whitespace
|
16
|
+
|
17
|
+
- repo: https://github.com/abravalheri/validate-pyproject
|
18
|
+
rev: v0.24.1
|
19
|
+
hooks:
|
20
|
+
- id: validate-pyproject
|
21
|
+
name: validate-pyproject
|
22
|
+
|
23
|
+
- repo: https://github.com/codespell-project/codespell
|
24
|
+
rev: v2.4.1
|
25
|
+
hooks:
|
26
|
+
- id: codespell
|
27
|
+
args:
|
28
|
+
- --ignore-words-list=astroid
|
29
|
+
|
30
|
+
- repo: https://github.com/pre-commit/mirrors-prettier
|
31
|
+
rev: v4.0.0-alpha.8
|
32
|
+
hooks:
|
33
|
+
- id: prettier
|
34
|
+
exclude: (Pipfile.lock)
|
35
|
+
|
36
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
37
|
+
rev: v0.12.0
|
38
|
+
hooks:
|
39
|
+
- id: ruff-check
|
40
|
+
args: [--fix]
|
41
|
+
- id: ruff-format
|
42
|
+
|
43
|
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
44
|
+
rev: v1.16.1
|
45
|
+
hooks:
|
46
|
+
- id: mypy
|
47
|
+
exclude: docs/
|
@@ -7,6 +7,20 @@ and this project adheres to [0-based versioning](https://0ver.org/).
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## v0.31.5 (2025-06-22)
|
11
|
+
|
12
|
+
- Add missing example for `nox` release job
|
13
|
+
- Bump deps and `pre-commit` hooks
|
14
|
+
- Remove unused linting `pre-commit` hooks
|
15
|
+
|
16
|
+
## v0.31.4 (2025-06-15)
|
17
|
+
|
18
|
+
- Fix `deps` job in `nox` session due to migration to `uv`
|
19
|
+
- Fix `pre-commit` not available in `lint` session
|
20
|
+
- Initial migration from `pipenv` to `uv`
|
21
|
+
- Refactor release `nox` job to use uv version
|
22
|
+
- Resolve `uv` not using nox's `venv` warning
|
23
|
+
|
10
24
|
## v0.31.2 (2025-06-08)
|
11
25
|
|
12
26
|
- Add `ruff` to dev deps
|
@@ -31,14 +31,14 @@ pyenv install $(cat .python-version)
|
|
31
31
|
Install necessary packages:
|
32
32
|
|
33
33
|
```console
|
34
|
-
python -m pip install --upgrade pip
|
35
|
-
|
34
|
+
python -m pip install --upgrade pip uv nox
|
35
|
+
uv pip install -e .[dev]
|
36
36
|
```
|
37
37
|
|
38
38
|
Spawn a shell in virtual environment for your development:
|
39
39
|
|
40
40
|
```console
|
41
|
-
|
41
|
+
uv shell
|
42
42
|
```
|
43
43
|
|
44
44
|
Show all available `nox` sessions:
|
@@ -1,6 +1,6 @@
|
|
1
|
-
Metadata-Version: 2.
|
1
|
+
Metadata-Version: 2.4
|
2
2
|
Name: fotolab
|
3
|
-
Version: 0.31.
|
3
|
+
Version: 0.31.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>
|
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.12
|
17
17
|
Classifier: Programming Language :: Python :: 3.13
|
18
18
|
Classifier: Programming Language :: Python
|
19
|
+
License-File: LICENSE.md
|
19
20
|
Requires-Dist: pillow
|
20
21
|
Project-URL: Changelog, https://github.com/kianmeng/fotolab/blob/master/CHANGELOG.md
|
21
22
|
Project-URL: Issues, https://github.com/kianmeng/fotolab/issues
|
@@ -27,28 +28,22 @@ A console program to manipulate photos.
|
|
27
28
|
|
28
29
|
## Installation
|
29
30
|
|
30
|
-
Stable version From PyPI using `
|
31
|
+
Stable version From PyPI using `uv`:
|
31
32
|
|
32
33
|
```console
|
33
|
-
|
34
|
-
```
|
35
|
-
|
36
|
-
Stable version From PyPI using `pip`:
|
37
|
-
|
38
|
-
```console
|
39
|
-
python -m pip install fotolab
|
34
|
+
uv pip install fotolab
|
40
35
|
```
|
41
36
|
|
42
37
|
Upgrade to latest stable version:
|
43
38
|
|
44
39
|
```console
|
45
|
-
|
40
|
+
uv pip install fotolab --upgrade
|
46
41
|
```
|
47
42
|
|
48
43
|
Latest development version from GitHub:
|
49
44
|
|
50
45
|
```console
|
51
|
-
|
46
|
+
uv pip install -e git+https://github.com/kianmeng/fotolab.git
|
52
47
|
```
|
53
48
|
|
54
49
|
## Usage
|
@@ -4,28 +4,22 @@ A console program to manipulate photos.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
Stable version From PyPI using `
|
7
|
+
Stable version From PyPI using `uv`:
|
8
8
|
|
9
9
|
```console
|
10
|
-
|
11
|
-
```
|
12
|
-
|
13
|
-
Stable version From PyPI using `pip`:
|
14
|
-
|
15
|
-
```console
|
16
|
-
python -m pip install fotolab
|
10
|
+
uv pip install fotolab
|
17
11
|
```
|
18
12
|
|
19
13
|
Upgrade to latest stable version:
|
20
14
|
|
21
15
|
```console
|
22
|
-
|
16
|
+
uv pip install fotolab --upgrade
|
23
17
|
```
|
24
18
|
|
25
19
|
Latest development version from GitHub:
|
26
20
|
|
27
21
|
```console
|
28
|
-
|
22
|
+
uv pip install -e git+https://github.com/kianmeng/fotolab.git
|
29
23
|
```
|
30
24
|
|
31
25
|
## Usage
|
@@ -20,11 +20,12 @@ import logging
|
|
20
20
|
import os
|
21
21
|
import subprocess
|
22
22
|
import sys
|
23
|
+
from importlib import metadata
|
23
24
|
from pathlib import Path
|
24
25
|
|
25
26
|
from PIL import Image
|
26
27
|
|
27
|
-
__version__ =
|
28
|
+
__version__ = metadata.version("fotolab")
|
28
29
|
|
29
30
|
log = logging.getLogger(__name__)
|
30
31
|
|
@@ -17,19 +17,17 @@
|
|
17
17
|
|
18
18
|
"""Nox configuration."""
|
19
19
|
|
20
|
-
import
|
20
|
+
import argparse
|
21
21
|
import datetime
|
22
22
|
|
23
23
|
import nox
|
24
|
-
from packaging.version import Version
|
25
24
|
|
26
25
|
|
27
26
|
@nox.session(python="3.9")
|
28
27
|
def deps(session: nox.Session) -> None:
|
29
28
|
"""Update pre-commit hooks and deps."""
|
30
|
-
session
|
29
|
+
_uv_install(session)
|
31
30
|
session.run("pre-commit", "autoupdate", *session.posargs)
|
32
|
-
session.run("pipenv", "update", env={"PIPENV_VERBOSITY": "-1"})
|
33
31
|
|
34
32
|
|
35
33
|
@nox.session(python="3.13")
|
@@ -40,22 +38,23 @@ def lint(session: nox.Session) -> None:
|
|
40
38
|
|
41
39
|
nox -s lint -- pylint
|
42
40
|
"""
|
41
|
+
_uv_install(session)
|
43
42
|
session.run("pre-commit", "run", "--all-files", *session.posargs)
|
44
43
|
|
45
44
|
|
46
45
|
@nox.session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
|
47
46
|
def test(session: nox.Session) -> None:
|
48
47
|
"""Run test."""
|
49
|
-
|
50
|
-
session.run("
|
48
|
+
_uv_install(session)
|
49
|
+
session.run("uv", "run", "pytest", "--numprocesses", "auto", *session.posargs)
|
51
50
|
|
52
51
|
|
53
52
|
@nox.session(python="3.13")
|
54
53
|
def cov(session: nox.Session) -> None:
|
55
54
|
"""Run test coverage."""
|
56
|
-
|
55
|
+
_uv_install(session)
|
57
56
|
session.run(
|
58
|
-
"
|
57
|
+
"uv",
|
59
58
|
"run",
|
60
59
|
"pytest",
|
61
60
|
"--numprocesses",
|
@@ -70,16 +69,16 @@ def cov(session: nox.Session) -> None:
|
|
70
69
|
@nox.session(python="3.13")
|
71
70
|
def doc(session: nox.Session) -> None:
|
72
71
|
"""Build doc with sphinx."""
|
73
|
-
|
72
|
+
_uv_install(session)
|
74
73
|
session.run("sphinx-build", "docs/source/", "docs/build/html", *session.posargs)
|
75
74
|
|
76
75
|
|
77
76
|
@nox.session(python="3.13")
|
78
77
|
def readme(session: nox.Session) -> None:
|
79
78
|
"""Update console help menu to readme."""
|
80
|
-
|
79
|
+
_uv_install(session)
|
81
80
|
with open("README.md", "r+", encoding="utf8") as f:
|
82
|
-
help_message = session.run("fotolab", "-h", silent=True)
|
81
|
+
help_message = session.run("uv", "run", "fotolab", "-h", silent=True)
|
83
82
|
help_codeblock = f"\n\n```console\n{help_message}```\n\n"
|
84
83
|
|
85
84
|
content = f.read()
|
@@ -99,7 +98,9 @@ def readme(session: nox.Session) -> None:
|
|
99
98
|
"watermark",
|
100
99
|
"env",
|
101
100
|
]:
|
102
|
-
help_message = session.run(
|
101
|
+
help_message = session.run(
|
102
|
+
"uv", "run", "fotolab", subcommand, "-h", silent=True
|
103
|
+
)
|
103
104
|
help_codeblock = f"\n\n```console\n{help_message}```\n\n"
|
104
105
|
|
105
106
|
marker = readme_md.split(f"<!--help-{subcommand} !-->")[1]
|
@@ -119,67 +120,41 @@ def release(session: nox.Session) -> None:
|
|
119
120
|
nox -s release -- major
|
120
121
|
nox -s release -- minor
|
121
122
|
nox -s release -- micro (default)
|
123
|
+
nos -s release -- -h
|
122
124
|
"""
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
before_version = Version(current_version)
|
137
|
-
|
138
|
-
(major, minor, micro) = (
|
139
|
-
before_version.major,
|
140
|
-
before_version.minor,
|
141
|
-
before_version.micro,
|
142
|
-
)
|
143
|
-
if "major" in session.posargs:
|
144
|
-
major = major + 1
|
145
|
-
minor = 0
|
146
|
-
micro = 0
|
147
|
-
|
148
|
-
if "minor" in session.posargs:
|
149
|
-
minor = minor + 1
|
150
|
-
micro = 0
|
151
|
-
|
152
|
-
if "micro" in session.posargs or session.posargs == []:
|
153
|
-
micro = micro + 1
|
154
|
-
|
155
|
-
after_version = f"{major}.{minor}.{micro}"
|
156
|
-
|
157
|
-
_search_and_replace("fotolab/__init__.py", str(before_version), after_version)
|
158
|
-
|
159
|
-
session.log(f"Bumping version from {before_version} to {after_version}")
|
160
|
-
|
161
|
-
date = datetime.date.today().strftime("%Y-%m-%d")
|
162
|
-
before_header = "## [Unreleased]\n\n"
|
163
|
-
after_header = f"## [Unreleased]\n\n## v{after_version} ({date})\n\n"
|
164
|
-
_search_and_replace("CHANGELOG.md", before_header, after_header)
|
125
|
+
_uv_install(session)
|
126
|
+
|
127
|
+
parser = argparse.ArgumentParser(description="Release a semver version.")
|
128
|
+
parser.add_argument(
|
129
|
+
"semver",
|
130
|
+
type=str,
|
131
|
+
nargs="?",
|
132
|
+
help="The type of semver release to make.",
|
133
|
+
default="patch",
|
134
|
+
choices={"major", "minor", "patch"},
|
135
|
+
)
|
136
|
+
args = parser.parse_args(args=session.posargs)
|
165
137
|
|
166
|
-
|
167
|
-
|
168
|
-
"commit",
|
169
|
-
"--no-verify",
|
170
|
-
"-am",
|
171
|
-
f"Bump {after_version} release",
|
172
|
-
external=True,
|
173
|
-
)
|
138
|
+
session.run("uv", "version", "--bump", args.semver)
|
139
|
+
after_version = session.run("uv", "version", "--short", silent=True).strip()
|
174
140
|
|
175
|
-
|
176
|
-
|
177
|
-
|
141
|
+
date = datetime.date.today().strftime("%Y-%m-%d")
|
142
|
+
before_header = "## [Unreleased]\n\n"
|
143
|
+
after_header = f"## [Unreleased]\n\n## v{after_version} ({date})\n\n"
|
144
|
+
_search_and_replace("CHANGELOG.md", before_header, after_header)
|
178
145
|
|
146
|
+
session.run(
|
147
|
+
"git",
|
148
|
+
"commit",
|
149
|
+
"--no-verify",
|
150
|
+
"-am",
|
151
|
+
f"Bump {after_version} release",
|
152
|
+
external=True,
|
153
|
+
)
|
179
154
|
|
180
|
-
|
181
|
-
|
182
|
-
|
155
|
+
if input("Publish package to pypi? (y/n): ").lower() in ["y", "yes"]:
|
156
|
+
session.run("flit", "build")
|
157
|
+
session.run("flit", "publish")
|
183
158
|
|
184
159
|
|
185
160
|
def _search_and_replace(file, search, replace) -> None:
|
@@ -189,3 +164,22 @@ def _search_and_replace(file, search, replace) -> None:
|
|
189
164
|
f.seek(0)
|
190
165
|
f.write(content)
|
191
166
|
f.truncate()
|
167
|
+
|
168
|
+
|
169
|
+
def _uv_install(session: nox.Session) -> None:
|
170
|
+
"""Install the project and its development dependencies using uv.
|
171
|
+
|
172
|
+
This also resolves the following error:
|
173
|
+
warning: `VIRTUAL_ENV=.nox/lint` does not match the project environment
|
174
|
+
path `.venv` and will be ignored
|
175
|
+
|
176
|
+
See https://nox.thea.codes/en/stable/cookbook.html#using-a-lockfile
|
177
|
+
"""
|
178
|
+
session.run_install(
|
179
|
+
"uv",
|
180
|
+
"sync",
|
181
|
+
"--upgrade",
|
182
|
+
"--all-packages",
|
183
|
+
f"--python={session.virtualenv.location}",
|
184
|
+
env={"UV_PROJECT_ENVIRONMENT": session.virtualenv.location},
|
185
|
+
)
|
@@ -20,7 +20,8 @@ classifiers = [
|
|
20
20
|
"Programming Language :: Python :: 3.13",
|
21
21
|
"Programming Language :: Python",
|
22
22
|
]
|
23
|
-
|
23
|
+
version = "0.31.5"
|
24
|
+
dynamic = ["description"]
|
24
25
|
keywords = ["photography", "photo"]
|
25
26
|
dependencies = [
|
26
27
|
"pillow",
|
@@ -33,3 +34,27 @@ Source = "https://github.com/kianmeng/fotolab"
|
|
33
34
|
|
34
35
|
[project.scripts]
|
35
36
|
fotolab = "fotolab.cli:main"
|
37
|
+
|
38
|
+
[dependency-groups]
|
39
|
+
dev = [
|
40
|
+
"exceptiongroup",
|
41
|
+
"flake8-docstrings",
|
42
|
+
"flake8-print",
|
43
|
+
"flake8-pytest-style",
|
44
|
+
"flake8-simplify",
|
45
|
+
"flit",
|
46
|
+
"importlib-metadata",
|
47
|
+
"myst-parser",
|
48
|
+
"nox",
|
49
|
+
"pre-commit",
|
50
|
+
"pytest",
|
51
|
+
"pytest-cov",
|
52
|
+
"pytest-randomly",
|
53
|
+
"pytest-xdist",
|
54
|
+
"ruff",
|
55
|
+
"scripttest",
|
56
|
+
"sphinx",
|
57
|
+
"sphinx-autodoc-typehints",
|
58
|
+
"sphinx-copybutton",
|
59
|
+
"tomli",
|
60
|
+
]
|