Skip to content

Commit

Permalink
Move project's dependency management to pipenv - closes #701
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Apr 7, 2023
1 parent 9aabf93 commit 29752b2
Show file tree
Hide file tree
Showing 27 changed files with 468 additions and 114 deletions.
67 changes: 31 additions & 36 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ name: Run linters
on:
push:
branches: [ main ]
paths:
- '**.py'
- .github/workflows/linters.yml
- requirements-lint.txt
pull_request:
branches: [ main ]


jobs:
lint:
uses: fizyk/actions-reuse/.github/workflows/linters-python.yml@v1.3.2
uses: fizyk/actions-reuse/.github/workflows/linters-python.yml@v1.7.1
with:
pipenv: true
pipenv-install-options: "--skip-lock"
mypy: true
pycodestyle: false
flake8:
Expand All @@ -23,36 +22,32 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
- name: Run flake8 checker
uses: fizyk/actions-reuse/.github/actions/[email protected]
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt
- name: Run flake8
run: |
flake8 src/ tests/
python-version: ${{ matrix.python-version }}
pipenv-install-options: "--skip-lock"
command: flake8 pytest_postgresql/ tests/


imports:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt
- name: Check if the code can be imported without psycopg
run: |
python -c "import pytest_postgresql"
python -c "import pytest_postgresql.plugin"
python -c "import pytest_postgresql.factories"
python -c "import pytest_postgresql.factories.client"
python -c "import pytest_postgresql.factories.noprocess"
python -c "import pytest_postgresql.factories.process"
python -c "import pytest_postgresql.janitor"
# imports:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python 3.11
# uses: actions/setup-python@v4
# with:
# python-version: "3.11"
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements-test.txt
# - name: Check if the code can be imported without psycopg
# run: |
# python -c "import pytest_postgresql"
# python -c "import pytest_postgresql.plugin"
# python -c "import pytest_postgresql.factories"
# python -c "import pytest_postgresql.factories.client"
# python -c "import pytest_postgresql.factories.noprocess"
# python -c "import pytest_postgresql.factories.process"
# python -c "import pytest_postgresql.janitor"
24 changes: 5 additions & 19 deletions .github/workflows/tests-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,8 @@ name: Run tests on macos
on:
push:
branches: [ main ]
paths:
- '**.py'
- .github/workflows/tests-macos.yml
- requirements-test.txt
- requirements-test-withpsycopg.txt
pull_request:
branches: [ main ]
paths:
- '**.py'
- .github/workflows/tests-macos.yml
- requirements-test.txt
- requirements-test-withpsycopg.txt

jobs:
macostests:
Expand All @@ -41,16 +31,12 @@ jobs:
- name: Check installed locales
run: |
locale -a
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test-withpsycopg.txt
- name: Install dependencies
run: |
echo "TMPDIR=$TMPDIR" >> $GITHUB_ENV
- name: Run test
run: |
py.test -n 0 --postgresql-exec="/usr/lib/postgresql/${{ matrix.postgres-version }}/bin/pg_ctl" -k "not docker" --cov-report=xml
uses: fizyk/actions-reuse/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
pipenv-install-options: "--skip-lock"
command: py.test -n 0 --postgresql-exec="/usr/lib/postgresql/${{ matrix.postgres-version }}/bin/pg_ctl" -k "not docker" --cov-report=xml
- uses: actions/upload-artifact@v3
if: failure()
with:
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ name: Run tests
on:
push:
branches: [ main ]
paths:
- '**.py'
- .github/workflows/tests.yml
- requirements-test.txt
- requirements-test-withpsycopg.txt
pull_request:
branches: [ main ]

Expand Down Expand Up @@ -62,24 +57,30 @@ jobs:
run: |
locale -a
sudo locale-gen de_DE.UTF-8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test-withpsycopg.txt
- name: Run test
run: |
py.test -n 0 --postgresql-exec="/usr/lib/postgresql/${{ matrix.postgres-version }}/bin/pg_ctl" -k "not docker" --cov-report=xml
uses: fizyk/actions-reuse/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
pipenv-install-options: "--skip-lock"
command: py.test -n 0 --postgresql-exec="/usr/lib/postgresql/${{ matrix.postgres-version }}/bin/pg_ctl" -k "not docker" --cov-report=xml
- name: Run xdist test
run: |
py.test -n 1 --postgresql-exec="/usr/lib/postgresql/${{ matrix.postgres-version }}/bin/pg_ctl" -k "not docker" --cov-report=xml:coverage-xdist.xml
uses: fizyk/actions-reuse/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
pipenv-install-options: "--skip-lock"
command: py.test -n 1 --postgresql-exec="/usr/lib/postgresql/${{ matrix.postgres-version }}/bin/pg_ctl" -k "not docker" --cov-report=xml:coverage-xdist.xml
- uses: actions/upload-artifact@v3
if: failure()
with:
name: postgresql-${{ matrix.python-version }}-${{ matrix.postgres-version }}
path: /tmp/pytest-of-runner/**
- name: Run test noproc fixture on docker
run: |
pytest -n 0 -k docker --postgresql-host=localhost --postgresql-port 5433 --postgresql-password=postgres --cov-report=xml:coverage-docker.xml
uses: fizyk/actions-reuse/.github/actions/[email protected]
with:
python-version: ${{ matrix.python-version }}
pipenv-install-options: "--skip-lock"
command: pytest -n 0 -k docker --postgresql-host=localhost --postgresql-port 5433 --postgresql-password=postgres --cov-report=xml:coverage-docker.xml
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
Expand Down
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include *.rst *.py
include src/pytest_postgresql/py.typed
recursive-include src/pytest_postgresql *.py
include pytest_postgresql/py.typed
recursive-include pytest_postgresql *.py
15 changes: 15 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,21 @@ verify_ssl = true
name = "pypi"

[packages]
pytest = "==7.2.0"
port-for = "==0.6.2"
mirakuru = "==2.4.2"
psycopg = "==3.1.4"

[dev-packages]
towncrier = "==22.12"
pytest-cov = "==4.0.0"
pytest-xdist = "==3.0.2"
mock = "==4.0.3"
pydocstyle = {version = "==6.1.1", extras = ["toml"]}
black = "==22.10.0"
mypy = "==0.982"
pyflakes = "==2.5.0"
mccabe = "==0.7.0"
flake8 = "==5.0.4"
types-setuptools = "==67.6.0.7"
pycodestyle = "==2.9.0"
Loading

0 comments on commit 29752b2

Please sign in to comment.