Skip to content

Commit

Permalink
Merge pull request #34 from M1ha-Shvn/minimize-dependencies
Browse files Browse the repository at this point in the history
Removed psycopg2 from dependencies as any version can be used in background
  • Loading branch information
M1ha-Shvn authored Jan 4, 2024
2 parents 167d276 + 4df8c52 commit 3b57cb7
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
postgres-version: ["9.6", "11", "12", "13", "14", "15"]
django-version: ["2.2", "3.0", "3.1", "3.2", "4.0", "4.1", "4.2"]
exclude:
# Django 4.0+ doesn't support Pythhon 3.7
# Django 4.0+ doesn't support Python 3.7
- django-version: "4.0"
python-version: "3.7"
- django-version: "4.1"
Expand Down Expand Up @@ -62,15 +62,15 @@ jobs:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
key: ${{ runner.os }}-pip-${{ hashFiles('requirements-test.txt') }}
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install pip dependencies
run: |
python -m pip install --upgrade pip wheel setuptools flake8
python -m pip install -r requirements.txt
python -m pip install -r requirements-test.txt
python -m pip install -U django==${{ matrix.django-version }}.*
python setup.py -q install
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ WORKDIR /app/src

# Install dependencies
# set -eu "breaks" pipeline on first error
COPY ./requirements.txt /app/requirements.txt
COPY ./requirements-test.txt /app/requirements-test.txt
RUN --mount=type=cache,target=/root/.cache/pip \
set -eu && \
apt-get update && \
apt-get install -y libpq-dev python3-dev && \
python3 -m pip install --upgrade pip setuptools wheel && \
python3 -m pip install --upgrade --requirement /app/requirements.txt
python3 -m pip install --upgrade --requirement /app/requirements-test.txt

COPY . /app/src

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ A small library implementing PostgreSQL ability to return rows in DML statements
* django >= 1.8
Previous versions may also work, but are not tested with CI.
bulk_create_returning method doesn't support .only() and .defer() filters for django before 1.10.
* psycopg2
* psycopg2 or psycopg2-binary
This library is not added to requirements file as it is not used directly (thorugh django cursor only).
Any form of psycopg2 installation can be used.
* typing for python < 3.5
* PostgreSQL 9.4+
Previous versions may also work, but are not tested with CI.
Expand Down
3 changes: 3 additions & 0 deletions requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
django>=1.7
psycopg2-binary
typing; python_version < '3.5'
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
django>=1.7
psycopg2
typing; python_version < '3.5'
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name='django-pg-returning',
version='2.0.1',
version='2.0.2',
packages=['django_pg_returning'],
package_dir={'': 'src'},
url='https://github.com/M1hacka/django-pg-returning',
Expand Down

0 comments on commit 3b57cb7

Please sign in to comment.