Skip to content

Commit

Permalink
Shebang magic and dump plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
dragomirp committed Jan 16, 2024
1 parent 490107d commit a4d93f1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 75 deletions.
10 changes: 7 additions & 3 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ parts:
- rustc
- cargo
- pkg-config
charm-binary-python-packages:
- psycopg2-binary
- psycopg-binary
- libpq-dev
libpq:
plugin: dump
source: http://archive.ubuntu.com/ubuntu/pool/main/p/postgresql-14/libpq5_14.10-0ubuntu0.22.04.1_amd64.deb
source-type: deb
organize:
'usr/lib/*-linux-gnu/libpq.so*': binlibs/
94 changes: 26 additions & 68 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ poetry-core = "^1.8.1"
lightkube = "^0.15.0"
lightkube-models = "^1.29.0.6"
pydantic = "^1.10.13"
psycopg2-binary = "^2.9.9"
psycopg = {extras = ["binary"], version = "^3.1.17"}
psycopg2 = "^2.9.9"
psycopg = {extras = ["c"], version = "^3.1.17"}

[tool.poetry.group.charm-libs.dependencies]
# data_platform_libs/v0/data_interfaces.py
Expand Down Expand Up @@ -58,6 +58,7 @@ pytest = "^7.4.4"
pytest-asyncio = "*"
jinja2 = "^3.1.2"
psycopg2-binary = "^2.9.9"
lightkube = "*"

[tool.poetry.group.integration]
optional = true
Expand Down
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python3
#!/usr/bin/env -S LD_LIBRARY_PATH=binlibs python3
# Copyright 2023 Canonical Ltd.
# See LICENSE file for licensing details.

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ commands =
[testenv:unit]
description = Run unit tests
commands_pre =
poetry install --only main,charm-libs,unit --no-root
poetry install --only charm-libs,unit --no-root
commands =
poetry run coverage run --source={[vars]src_path},{[vars]lib_path} \
-m pytest -v --tb native -s {posargs} {[vars]tests_path}/unit
Expand Down

0 comments on commit a4d93f1

Please sign in to comment.