Skip to content

Commit c3114dd

Browse files
committed
Merge branch 'qa' of github.com:NYPL/python-utils into qa
2 parents 87a6682 + 139a550 commit c3114dd

3 files changed

Lines changed: 22 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Changelog
22

3-
## v1.0.2 - 5/18/23
3+
## v1.0.3 - 5/19/23
44
- Add research_catalog_identifier_helper function
55

6+
## v1.0.2 - 5/18/23
7+
- Identical to v1.0.1 -- this was mistakenly deployed to QA without any changes
8+
69
## v1.0.1 - 4/3/23
710
- Add transaction support to RedshiftClient
811

README.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,22 @@ When a new client or helper file is created, a new optional dependency set shoul
5858
The optional dependency sets also give the developer the option to manually list out the dependencies of the clients rather than relying upon what the package thinks is required, which can be beneficial in certain circumstances. For instance, AWS lambda functions come with `boto3` and `botocore` pre-installed, so it's not necessary to include these (rather hefty) dependencies in the lambda deployment package.
5959

6060
### Troubleshooting
61-
If running `main.py` in this virtual environment produces the following error:
61+
#### Using PostgreSQLClient in an AWS Lambda
62+
Because `psycopg` requires a statically linked version of the `libpq` library, the `PostgreSQLClient` cannot be installed as-is in an AWS Lambda function. Instead, it must be packaged as follows:
63+
```bash
64+
pip install --target ./package nypl-py-utils[postgresql-client]==1.0.1
65+
66+
pip install \
67+
--platform manylinux2014_x86_64 \
68+
--target=./package \
69+
--implementation cp \
70+
--python 3.9 \
71+
--only-binary=:all: --upgrade \
72+
'psycopg[binary]'
73+
```
74+
75+
#### Using PostgreSQLClient locally
76+
If using the `PostgreSQLClient` produces the following error locally:
6277
```
6378
ImportError: no pq wrapper available.
6479
Attempts made:
@@ -68,7 +83,7 @@ Attempts made:
6883
```
6984

7085
then try running:
71-
```
86+
```bash
7287
pip uninstall psycopg
7388
pip install "psycopg[c]"
7489
```

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "nypl_py_utils"
7-
version = "1.0.2"
7+
version = "1.0.3"
88
authors = [
99
{ name="Aaron Friedman", email="aaronfriedman@nypl.org" },
1010
]

0 commit comments

Comments
 (0)