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

WIP: Replace Travis with GitHub Actions #106

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
39 changes: 39 additions & 0 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI
on:
push:
branches:
- master
pull_request:

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.5"]
# python: [3.5, 3.6, 3.7, 3.8]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}

- name: Install extra packages for tests
run: |
pip install setuptools wheel nose lxml

- name: Install requirements
run: |
pip install -r requirements.txt

- name: Install package
run: |
python setup.py install

- name: Run tests
run: nosetests -vv --nocapture --exe
17 changes: 0 additions & 17 deletions .travis.yml

This file was deleted.

4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
six==1.10.0
requests
alembic==0.8.3
sqlalchemy==1.0.9
5 changes: 4 additions & 1 deletion scraperwiki/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def save(unique_keys, data, table_name='swdata'):
or an iterable of mappings. Unique keys is a list of keys that exist
for all rows and for which a unique index will be created.
"""

print("unique_keys in save:", unique_keys)
_set_table(table_name)

connection = _State.connection()
Expand Down Expand Up @@ -340,6 +340,7 @@ def fit_row(connection, row, unique_keys):
Takes a row and checks to make sure it fits in the columns of the
current table. If it does not fit, adds the required columns.
"""
print("unique keys in fit_row", unique_keys)
new_columns = []
for column_name, column_value in list(row.items()):
new_column = sqlalchemy.Column(column_name,
Expand All @@ -363,7 +364,9 @@ def create_table(unique_keys):
"""
_State.new_transaction()
_State.table.create(bind=_State.engine, checkfirst=True)
print("unique_keys in create_table: ", unique_keys)
if unique_keys != []:
print("creating with unique keys")
create_index(unique_keys, unique=True)
_State.table_pending = False
_State.reflect_metadata()
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def has_external_dependency(name):
try:
from setuptools import setup
config['install_requires'] = ['requests', 'six',
'sqlalchemy', 'alembic'],
'alembic', 'sqlalchemy'],
except ImportError:
pass

Expand Down
Loading