Skip to content
Merged

Dev #29

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[flake8]
max-line-length = 120
per-file-ignores =
generic_connection_pool/*__init__.py: F401
*/__init__.py: F401
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: publish

on:
release:
types:
- published

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install poetry
run: pip install poetry
- name: Build and publish
run: |
poetry build
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
38 changes: 23 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
name: release

on:
release:
workflow_run:
workflows:
- test
branches:
- master
types:
- released
- completed

jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip poetry
poetry install
- name: Build and publish
run: |
poetry build
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
- uses: actions/checkout@v6
- uses: codfish/semantic-release-action@v4
with:
additional-packages: |
[
'@covage/semantic-release-pyproject-plugin',
'@semantic-release/changelog',
'@semantic-release/git',
'@semantic-release/github'
]
env:
GH_TOKEN: ${{ secrets.RELEASE_BOT_TOKEN }}
49 changes: 27 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,35 @@ on:
- master

jobs:
pre-commit-hooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Setup python
uses: actions/setup-python@v6
with:
python-version: '3.x'
- name: Install poetry
run: pip install poetry
- name: Install dependencies
run: poetry install --no-root --only pre-commit
- name: Run pre-commit hooks
run: poetry run pre-commit run --hook-stage merge-commit --all-files

test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install --no-root
- name: Run pre-commit hooks
run: poetry run pre-commit run --hook-stage merge-commit --all-files
- name: Run tests
run: PYTHONPATH="$(pwd):$PYTHONPATH" poetry run py.test --cov=generic_connection_pool --cov-report=xml tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
fail_ci_if_error: true
- uses: actions/checkout@v6
- name: Setup python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install poetry
run: pip install poetry
- name: Install dependencies
run: poetry install --no-root --all-extras
- name: Run tests
run: PYTHONPATH="$(pwd):$PYTHONPATH" poetry run pytest tests
11 changes: 11 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[mypy]
python_version = 3.12
allow_redefinition = true
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_decorators = false
disallow_untyped_defs = true
no_implicit_optional = true
show_error_codes = true
strict_equality = true
warn_unused_ignores = true
45 changes: 28 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,73 +1,84 @@
default_stages:
- commit
- merge-commit
- pre-commit
- pre-merge-commit

repos:
- repo: https://github.com/commitizen-tools/commitizen
rev: v4.16.3
hooks:
- id: commitizen
stages:
- commit-msg
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: check-yaml
- id: check-toml
- id: trailing-whitespace
- id: end-of-file-fixer
stages:
- commit
- pre-commit
- id: mixed-line-ending
name: fix line ending
stages:
- commit
- pre-commit
args:
- --fix=lf
- id: mixed-line-ending
name: check line ending
stages:
- merge-commit
- pre-merge-commit
args:
- --fix=no
- id: no-commit-to-branch
stages:
- pre-commit
args:
- --branch=master
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
rev: v4.0.0
hooks:
- id: add-trailing-comma
stages:
- commit
- repo: https://github.com/pre-commit/mirrors-autopep8
rev: v2.0.4
- pre-commit
- repo: https://github.com/hhatto/autopep8
rev: v2.3.2
hooks:
- id: autopep8
stages:
- commit
- pre-commit
args:
- --diff
- repo: https://github.com/pycqa/flake8
rev: 6.1.0
rev: 7.3.0
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: 5.12.0
rev: 9.0.0a3
hooks:
- id: isort
name: fix import order
stages:
- commit
- pre-commit
args:
- --line-length=120
- --multi-line=9
- --project=generic_connection_pool
- id: isort
name: check import order
stages:
- merge-commit
- pre-merge-commit
args:
- --check-only
- --line-length=120
- --multi-line=9
- --project=generic_connection_pool
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v2.1.0
hooks:
- id: mypy
stages:
- commit
- pre-commit
name: mypy
pass_filenames: false
additional_dependencies:
Expand Down
20 changes: 20 additions & 0 deletions .releaserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
branches:
- "master"
plugins:
- "@semantic-release/commit-analyzer"
- "@semantic-release/release-notes-generator"
- "@covage/semantic-release-pyproject-plugin"

- - "@semantic-release/changelog"
- changelogFile: "CHANGELOG.md"

- - "@semantic-release/git"
- assets:
- "CHANGELOG.md"
- "pyproject.toml"
message: |-
chore(release): ${nextRelease.version}

${nextRelease.notes}

- "@semantic-release/github"
81 changes: 81 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# 0.7.0 (2023-12-09)


### Features

* asyncpg connection manager added.


# 0.6.1 (2023-10-06)


### Bug Fixes

* some refactoring done.


# 0.6.0 (2023-10-05)


### Features

* python 3.12 support added.


# 0.5.0 (2023-08-17)


### Features

* unix socket managers implemented.


# 0.4.1 (2023-08-16)


### Bug Fixes

* aliveness checking extracted to mixins.


# 0.4.0 (2023-08-15)


### Features

* socket connection manager aliveness check added.
* shared lock bug fixed.


# 0.3.0 (2023-08-10)


### Features

* refactoring done.


# 0.2.0 (2023-04-19)


### Features

* socket_timeout contex manager works with ssl sockets.
* graceful_timeout default set to 0.
* connection release bug fixed.


# 0.1.1 (2023-03-17)


### Bug Fixes

* Contrib bugs fixed.


# 0.1.0 (2023-03-15)


### Features

* Initial release.
Loading