Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: migrate from travis ci to github workflows #112

Merged
merged 1 commit into from
Aug 7, 2023
Merged
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
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
- push
- pull_request

jobs:
test:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade tox setuptools

- name: Run linting
run: tox -e lint
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Test

on:
- push
- pull_request

jobs:
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
services:
postgres:
image: postgres:12
env:
POSTGRES_DB: sqlalchemy_searchable_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
strategy:
fail-fast: false
matrix:
include:
- name: "Python 3.9"
python: "3.9"

- name: "Python 3.8"
python: "3.8"

- name: "Python 3.7"
python: "3.7"

- name: "PyPy"
python: "pypy3.9"

steps:
- uses: actions/checkout@v3

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade tox setuptools

- name: Run tests
env:
SQLALCHEMY_SEARCHABLE_TEST_PASSWORD: postgres
TOXENV: py-sqla1.3, py-sqla1.4
run: tox
33 changes: 0 additions & 33 deletions .travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
SQLAlchemy-Searchable
=====================

|Build Status| |Version Status| |Downloads|
|Version Status| |Downloads|

Fulltext searchable models for SQLAlchemy. Only supports PostgreSQL

Expand All @@ -14,8 +14,6 @@ Resources
- `Code <http://github.com/kvesteri/sqlalchemy-searchable/>`_


.. |Build Status| image:: https://travis-ci.org/kvesteri/sqlalchemy-searchable.png?branch=master
:target: https://travis-ci.org/kvesteri/sqlalchemy-searchable
.. |Version Status| image:: https://img.shields.io/pypi/v/SQLAlchemy-Searchable.svg
:target: https://pypi.python.org/pypi/SQLAlchemy-Searchable/
.. |Downloads| image:: https://img.shields.io/pypi/dm/SQLAlchemy-Searchable.svg
Expand Down
10 changes: 8 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
import inspect
import itertools as it
import os

import sqlalchemy as sa
from sqlalchemy import create_engine
Expand All @@ -18,10 +19,15 @@
vectorizer
)

CONNECTION_STRING = (
'postgresql://postgres@localhost/sqlalchemy_searchable_test'
DB_USER = os.environ.get('SQLALCHEMY_SEARCHABLE_TEST_USER', 'postgres')
DB_PASSWORD = os.environ.get('SQLALCHEMY_SEARCHABLE_TEST_PASSWORD', '')
DB_NAME = os.environ.get(
'SQLALCHEMY_SEARCHABLE_TEST_DB',
'sqlalchemy_searchable_test'
)

CONNECTION_STRING = f'postgresql://{DB_USER}:{DB_PASSWORD}@localhost/{DB_NAME}'

try:
import __pypy__
except ImportError:
Expand Down
8 changes: 6 additions & 2 deletions tests/test_multiple_vectors_per_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ class TextItem(self.Base):

name_vector = sa.Column(TSVectorType('name', auto_index=True))

content_vector = sa.Column(TSVectorType('content', auto_index=True))
content_vector = sa.Column(
TSVectorType('content', auto_index=True)
)


class TestMultipleSearchVectorsSearchFunction(TestCase):
Expand All @@ -42,7 +44,9 @@ class TextMultiItem(self.Base):
name = sa.Column(sa.Unicode(255))
content = sa.Column(sa.UnicodeText)
name_vector = sa.Column(TSVectorType('name', auto_index=False))
content_vector = sa.Column(TSVectorType('content', auto_index=False))
content_vector = sa.Column(
TSVectorType('content', auto_index=False)
)

self.TextMultiItem = TextMultiItem

Expand Down
7 changes: 6 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ deps=
psycopg2cffi>=2.6.1; platform_python_implementation == 'PyPy'
psycopg2>=2.4.6; platform_python_implementation == 'CPython'
sqla1.3: SQLAlchemy>=1.3,<1.4
sqla1.4: SQLAlchemy>=1.4,<1.5
lint: flake8
lint: isort
lint: isort>=4.0,<5.0
passenv =
SQLALCHEMY_SEARCHABLE_TEST_USER
SQLALCHEMY_SEARCHABLE_TEST_PASSWORD
SQLALCHEMY_SEARCHABLE_TEST_DB
commands=py.test {posargs}

[testenv:lint]
Expand Down