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

add Database, MySQLDatabase, and PostgresDatabase to __init__.py #20

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
71 changes: 11 additions & 60 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ commands:
pip:
type: string
steps:
- run:
name: Install dependencies
command: << parameters.pip >> install -r requirements.txt
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed, this should not be merged.

Both the packaging (https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives) and setuptools docs (https://setuptools.readthedocs.io/en/latest/setuptools.html) recommend updating setuptools and wheels first.

- run:
name: Package the repo into a wheel
command: << parameters.python >> setup.py bdist_wheel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may need an sdist command

Expand All @@ -48,7 +51,7 @@ jobs:

black:
docker:
- image: ubuntu:19.04
- image: ubuntu:20.04
steps:
- checkout
- run:
Expand All @@ -65,41 +68,15 @@ jobs:

postgres:
docker:
- image: ubuntu:19.04
- image: ubuntu:20.04
- image: circleci/postgres:9.6.8-alpine
steps:
- checkout
- run:
name: Install postgres dependencies.
command: |
apt-get update
apt-get -y install python2.7-dev python-pip libpq-dev wget postgresql-client
- wait_for_database:
port: 5432
- run:
name: Load ddldump postgres schema
command: psql -h 127.0.0.1 -U postgres < ddldump_postgres.sql
- run:
name: Install postgres driver for python
command: pip install psycopg2
- install_ddldump:
python: "python2.7"
pip: "pip2"
- run:
name: Run ddldump againt the postgres dumpfile
command: ddldump --diff=ddldump_postgres.sql postgresql://postgres:[email protected]:5432

postgrespython3:
docker:
- image: ubuntu:19.04
- image: circleci/postgres:9.6.8-alpine
steps:
- checkout
- run:
name: Install postgres dependencies.
command: |
apt-get update
apt-get -y install python2.7-dev python3-pip libpq-dev wget postgresql-client
apt-get -y install python3-pip libpq-dev wget postgresql-client
- wait_for_database:
port: 5432
- run:
Expand All @@ -109,59 +86,35 @@ jobs:
name: Install postgres driver for python
command: pip3 install psycopg2
- install_ddldump:
python: "python3.7"
python: "python3"
pip: "pip3"
- run:
name: Run ddldump againt the postgres dumpfile
command: ddldump --diff=ddldump_postgres.sql postgresql://postgres:[email protected]:5432

mysql:
docker:
- image: ubuntu:19.04
- image: circleci/mysql:5.7.28
steps:
- checkout
- run:
name: Install dependencies
command: |
apt-get update
apt-get -y install python2.7-dev python-pip libssl-dev default-libmysqlclient-dev wget mysql-client
- wait_for_database:
port: 3306
- load_mysql_ddl
- run:
name: Install mysql driver for python
command: pip install mysqlclient
- install_ddldump:
python: "python2.7"
pip: "pip2"
- run:
name: Run ddldump against the mysql dumpfile
command: ddldump --diff=ddldump_mysql.sql mysql://:@127.0.0.1:3306/ddldump

mysqlpython3:
docker:
- image: ubuntu:19.04
- image: ubuntu:20.04
- image: circleci/mysql:5.7.28
steps:
- checkout
- run:
name: Install dependencies
command: |
apt-get update
apt-get -y install python3.7-dev python3-pip libssl-dev default-libmysqlclient-dev wget mysql-client
apt-get -y install python3-pip libssl-dev default-libmysqlclient-dev wget mysql-client
- wait_for_database:
port: 3306
- load_mysql_ddl
- run:
name: Install mysql driver for python
command: pip3 install mysqlclient
- install_ddldump:
python: "python3.7"
python: "python3"
pip: "pip3"
- run:
name: Run ddldump against the mysql dumpfile
command: ddldump --diff=ddldump_mysql.sql mysql://:@127.0.0.1:3306/ddldump
command: ddldump --diff=ddldump_mysql.sql mysql://@127.0.0.1:3306/ddldump

workflows:
version: 2
Expand All @@ -170,6 +123,4 @@ workflows:
- black
- mdl
- postgres
- postgrespython3
- mysql
- mysqlpython3
1 change: 1 addition & 0 deletions ddldump/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .main import MySQLDatabase, PostgresDatabase
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sqlalchemy
docopt