Skip to content

Commit

Permalink
Update for libcamera v0.3.2+rpt20241119
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Dec 3, 2024
1 parent 91f9e7d commit 768dff6
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
build
check-version
libcamera
libcamera
dist
env
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ If you get the error `This package works with libcamera version ..., but you hav

| System and Date | libcamera Reported Version | Pip Package Version |
| --------------- | -------------------------- | ------------------- |
| Raspberry Pi Bookworm 19/11/2024 | v0.3.2+99-1230f78d | 0.1a7 |
| Raspberry Pi Bookworm 06/09/2024 | v0.3.1+50-69a894c4 | 0.1a6 |
| Raspberry Pi Bookworm 17/06/2024 | v0.3.0+65-6ddd79b5 | 0.1a5 |
| Raspberry Pi Bookworm 18/04/2024 | v0.2.0+120-eb00c13d | 0.1a4 |
Expand Down
16 changes: 10 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,21 @@ libcamera_private = dependency(
not_found_message : 'Requires libcamera-dev package to be installed - apt install libcamera-dev'
)

py = import('python').find_installation()
# Sub-directories fill py_modules with their dependencies.
py_modules = []
subdir('libcamera/utils/codegen')

py = import('python').find_installation(modules : py_modules)

controls_files = [
'control_ids_core.yaml',
'control_ids_draft.yaml',
'control_ids_rpi.yaml',
files('libcamera/src/libcamera/control_ids_core.yaml'),
files('libcamera/src/libcamera/control_ids_draft.yaml'),
files('libcamera/src/libcamera/control_ids_rpi.yaml'),
]

properties_files = [
'property_ids_core.yaml',
'property_ids_draft.yaml',
files('libcamera/src/libcamera/property_ids_core.yaml'),
files('libcamera/src/libcamera/property_ids_draft.yaml'),
]

subdir('libcamera/src/py')
Expand Down
8 changes: 4 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
build-backend = 'mesonpy'
requires = ['meson-python', 'pyyaml', 'pybind11']
requires = ['meson-python', 'pyyaml', 'pybind11', 'jinja2', 'ply']

[project]
name = 'rpi-libcamera'
version = '0.1a6'
version = '0.1a7'
description = 'libcamera python bindings'
readme = 'README.md'

Expand All @@ -14,9 +14,9 @@ Source = "https://github.com/raspberrypi/pylibcamera"

[tool.meson-python.args]
setup = [
'-Drevision=v0.3.1+rpt20240906',
'-Drevision=v0.3.2+rpt20241119',
'-Drepository=https://github.com/raspberrypi/libcamera.git',
'-Dversion=v0.3.1+50-69a894c4'
'-Dversion=v0.3.2+99-1230f78d'
]

[tool.flit.module]
Expand Down
18 changes: 18 additions & 0 deletions update-version.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
elif "-Dversion" in line:
version_line = i
lines.append(line)
pyproject_orig = lines.copy()

new_version = subprocess.check_output("./check-version.sh", text=True).strip()
old_version = lines[version_line][len(" '-Dversion="):-len("'\n")]
Expand Down Expand Up @@ -48,12 +49,29 @@
if "| --------------- | -------------------------- | ------------------- |" in line:
table_end_line = i+1
lines.append(line)
readme_orig = lines.copy()

new_table_line = f"| {input('System and Date (eg Raspberry Pi Bookworm 22/11/2023): ')} | {new_version} | {new_pyversion} |\n"
lines.insert(table_end_line, new_table_line)

with open("README.md", "w") as f:
f.writelines(lines)

# Commit changes for build
ret = subprocess.run(("git", "add", "."))
ret = subprocess.run(("git", "commit", "-m", f"Update for libcamera {new_revision}"))

# Run build - should now succeed
ret = subprocess.run(("python", "-m", "build"))

print(f"Finished with ret {ret.returncode}")
if ret.returncode:
print("Failed - reverting changes")

with open("pyproject.toml", "w") as f:
f.writelines(pyproject_orig)

with open("README.md", "w") as f:
f.writelines(readme_orig)

ret = subprocess.run(("git", "reset", "HEAD~1"))

0 comments on commit 768dff6

Please sign in to comment.