Skip to content

Commit

Permalink
Merge pull request #81 from tomviner/sqla14-with-improved-github-actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tomviner authored Apr 13, 2023
2 parents 7222192 + c53c8da commit e182378
Show file tree
Hide file tree
Showing 11 changed files with 192 additions and 138 deletions.
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[coverage:run]
plugins =
coverage_conditional_plugin

[coverage:coverage_conditional_plugin]
rules =
"package_version('sqlalchemy') < (1, 4)": no_cover_sqlalchemy_lt_1_4
"package_version('sqlalchemy') >= (1, 4)": no_cover_sqlalchemy_gte_1_4
70 changes: 70 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Tests CI
on:
- push
- pull_request

jobs:
tests:
name: ${{ matrix.tox }}
runs-on: ubuntu-20.04

services:
mariadb:
image: mariadb:latest
ports:
- 3306:3306
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3

postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_DB: test_sqlalchemy_filters
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --lc-collate=en_US.utf8 --lc-ctype=en_US.utf8"
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5


strategy:
fail-fast: false
matrix:
include:
# sqlalchemylatest (i.e. > 2.0.0) is not yet supported
# for any version of python

- {python: '3.7', tox: "py37-sqlalchemy1.0"}
- {python: '3.7', tox: "py37-sqlalchemy1.1"}
- {python: '3.7', tox: "py37-sqlalchemy1.2"}
- {python: '3.7', tox: "py37-sqlalchemy1.3"}
- {python: '3.7', tox: "py37-sqlalchemy1.4"}

- {python: '3.8', tox: "py38-sqlalchemy1.0"}
- {python: '3.8', tox: "py38-sqlalchemy1.1"}
- {python: '3.8', tox: "py38-sqlalchemy1.2"}
- {python: '3.8', tox: "py38-sqlalchemy1.3"}
- {python: '3.8', tox: "py38-sqlalchemy1.4"}

- {python: '3.9', tox: "py39-sqlalchemy1.0"}
- {python: '3.9', tox: "py39-sqlalchemy1.1"}
- {python: '3.9', tox: "py39-sqlalchemy1.2"}
- {python: '3.9', tox: "py39-sqlalchemy1.3"}
- {python: '3.9', tox: "py39-sqlalchemy1.4"}

# python3.10 with sqlalchemy <= 1.1 errors with:
# AttributeError: module 'collections' has no attribute 'MutableMapping'
- {python: '3.10', tox: "py310-sqlalchemy1.2"}
- {python: '3.10', tox: "py310-sqlalchemy1.3"}
- {python: '3.10', tox: "py310-sqlalchemy1.4"}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}

- run: pip install tox~=3.28
- run: tox -e ${{ matrix.tox }}
87 changes: 0 additions & 87 deletions .travis.yml

This file was deleted.

8 changes: 8 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ Release Notes
Here you can see the full list of changes between sqlalchemy-filters
versions, where semantic versioning is used: *major.minor.patch*.

0.13.0
------

Released 2023-04-13

* Add support for SQLAlchemy 1.4 (#69) thanks to @bodik
* Add support for Python 3.9 & Python 3.10
* Drop support for Python 2.7, 3.5 & 3.6

0.12.0
------
Expand Down
14 changes: 3 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ SQLAlchemy filters
.. image:: https://img.shields.io/pypi/format/sqlalchemy-filters.svg
:target: https://pypi.org/project/sqlalchemy-filters/

.. image:: https://travis-ci.org/juliotrigo/sqlalchemy-filters.svg?branch=master
:target: https://travis-ci.org/juliotrigo/sqlalchemy-filters
.. image:: https://github.com/juliotrigo/sqlalchemy-filters/actions/workflows/tests.yml/badge.svg
:target: https://github.com/juliotrigo/sqlalchemy-filters/actions


Filtering
Expand Down Expand Up @@ -487,19 +487,11 @@ The following RDBMS are supported (tested):
- PostgreSQL
Python 2
--------
There is no active support for Python 2. However, it is compatible as of
February 2019, if you install ``funcsigs``, included in the ``python2``
extra requirements.
SQLAlchemy support
------------------
The following SQLAlchemy_ versions are supported: ``1.0``, ``1.1``,
``1.2``, ``1.3``.
``1.2``, ``1.3``, ``1.4``.
Changelog
Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 88
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,28 @@

setup(
name='sqlalchemy-filters',
version='0.12.0',
version='0.13.0',
description='A library to filter SQLAlchemy queries.',
long_description=readme,
long_description_content_type='text/x-rst',
author='Student.com',
author_email='wearehiring@student.com',
url='https://github.com/juliotrigo/sqlalchemy-filters',
packages=find_packages(exclude=['test', 'test.*']),
python_requires='>=3.7',
install_requires=['sqlalchemy>=1.0.16', 'six>=1.10.0'],
extras_require={
'dev': [
'pytest>=4.6.9',
'coverage~=5.0.4',
'sqlalchemy-utils~=0.36.3',
'sqlalchemy-utils>=0.37',
'flake8',
'restructuredtext-lint',
'Pygments',
'coverage-conditional-plugin',
],
'mysql': ['mysql-connector-python-rf==2.2.2'],
'postgresql': ['psycopg2==2.8.4'],
'python2': ['funcsigs>=1.0.2'],
},
zip_safe=True,
license='Apache License, Version 2.0',
Expand All @@ -42,10 +43,10 @@
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Database",
"Topic :: Database :: Front-Ends",
"Topic :: Software Development :: Libraries :: Python Modules",
Expand Down
14 changes: 2 additions & 12 deletions sqlalchemy_filters/filters.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# -*- coding: utf-8 -*-
from collections import namedtuple
try:
from collections.abc import Iterable
except ImportError: # pragma: no cover
# For python2 capability.
from collections import Iterable
try:
from inspect import signature
except ImportError: # pragma: no cover
# For python2 capability. NOTE: This is in not handled in install_requires
# but rather in extras_require. You can install with
# 'pip install sqlalchemy-filters[python2]'
from funcsigs import signature
from collections.abc import Iterable
from inspect import signature
from itertools import chain

from six import string_types
Expand Down
Loading

0 comments on commit e182378

Please sign in to comment.