diff --git a/.circleci/config.yml b/.circleci/config.yml index d66aeb3..9ba335a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,6 +11,11 @@ jobs: POSTGRES_HOST_AUTH_METHOD: trust POSTGRES_DB: keg_tests PGPORT: 54321 + - image: mcr.microsoft.com/mssql/server + environment: + ACCEPT_EULA: Y + MSSQL_SA_PASSWORD: "Password12!" + MSSQL_TCP_PORT: 14331 steps: - checkout diff --git a/docker-compose.yaml b/docker-compose.yaml index a54fab5..1f4d662 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -11,13 +11,21 @@ # - `docker stop $(docker ps -aq)`: stop all running containers # - `docker rm $(docker ps -a -q)`: remove all stopped containers -version: '2' +version: '2.1' services: + keg-mssql: + image: mcr.microsoft.com/mssql/server + container_name: keg-mssql + ports: + - '${KEG_LIB_MSSQL_IP:-127.0.0.1}:${KEG_LIB_MSSQL_PORT:-14331}:1433' + environment: + ACCEPT_EULA: Y + MSSQL_SA_PASSWORD: "Password12!" keg-pg: image: postgres:13-alpine container_name: keg-pg ports: - - '127.0.0.1:54321:5432' + - '${KEG_LIB_POSTGRES_IP:-127.0.0.1}:${KEG_LIB_POSTGRES_PORT:-54321}:5432' environment: # Ok for local dev, potentially UNSAFE in other applications. Don't blindly copy & paste # without considering implications. diff --git a/keg_apps/db/config.py b/keg_apps/db/config.py index 4c83f0f..a65162e 100644 --- a/keg_apps/db/config.py +++ b/keg_apps/db/config.py @@ -22,5 +22,7 @@ class TestProfile(object): # This string will connect to the postgresql DB setup in docker-compose.yaml and # work in CircleCI. 'postgres': 'postgresql://postgres@127.0.0.1:54321/postgres', + 'mssql': 'mssql+pyodbc_mssql://sa:Password12!@127.0.0.1:14331/tempdb' + '?driver=ODBC+Driver+17+for+SQL+Server', 'sqlite2': 'sqlite:///' } diff --git a/setup.py b/setup.py index 76ef5b6..fc82e7f 100644 --- a/setup.py +++ b/setup.py @@ -48,7 +48,8 @@ 'tests': [ 'flask-webtest', 'flask-wtf', - "sqlalchemy_pyodbc_mssql; sys_platform == 'win32'", + 'sqlalchemy_pyodbc_mssql', + 'pyodbc==4.0.34', 'pytest', 'pytest-cov', 'python-dotenv', diff --git a/stable-requirements.txt b/stable-requirements.txt new file mode 100644 index 0000000..02d15d6 --- /dev/null +++ b/stable-requirements.txt @@ -0,0 +1,40 @@ +appdirs==1.4.4 +attrs==22.1.0 +beautifulsoup4==4.11.1 +BlazeUtils==0.6.5 +blinker==1.5 +click==8.1.3 +coverage==6.5.0 +Flask==2.2.2 +Flask-SQLAlchemy==3.0.2 +Flask-WebTest==0.0.9 +Flask-WTF==1.0.1 +greenlet==1.1.3.post0 +importlib-metadata==5.0.0 +iniconfig==1.1.1 +itsdangerous==2.1.2 +Jinja2==3.1.2 +MarkupSafe==2.1.1 +mock==4.0.3 +packaging==21.3 +pluggy==1.0.0 +psycopg2-binary==2.9.4 +py==1.11.0 +pyodbc==4.0.34 +pyparsing==3.0.9 +pytest==7.1.3 +pytest-cov==4.0.0 +python-dotenv==0.21.0 +python-json-logger==2.0.4 +six==1.16.0 +soupsieve==2.3.2.post1 +SQLAlchemy==1.4.42 +sqlalchemy-pyodbc-mssql==0.1.1 +tomli==2.0.1 +waitress==2.1.2 +WebOb==1.8.7 +WebTest==3.0.0 +Werkzeug==2.2.2 +wrapt==1.14.1 +WTForms==3.0.1 +zipp==3.10.0 diff --git a/tox.ini b/tox.ini index 07a4134..cd4e226 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{37,38,39},py37-{lowest,i18n},py39-{lowest,i18n},project,docs,i18n +envlist = py{37,38,39}-{base,stable},py37-{lowest,i18n},py39-{lowest,i18n},project,docs,i18n [testenv] @@ -17,6 +17,7 @@ recreate=True commands = pip --version lowest: pip install flask<2 markupsafe~=2.0.0 + stable: pip install --progress-bar off -r ./stable-requirements.txt pip install --progress-bar off .[tests] i18n: pip install --progress-bar off .[i18n] # Output installed versions to compare with previous test runs in case a dependency's change