Skip to content

Commit

Permalink
- add a new qualifier "native" vs. "dbapi" unicode to avoid
Browse files Browse the repository at this point in the history
profiling problems here
- add extras_require to setup.py for the most common DBAPIs
- rework tox.ini to use extras, specify a test matrix built in
  • Loading branch information
zzzeek committed Jan 24, 2016
1 parent 926784f commit 6b05150
Show file tree
Hide file tree
Showing 7 changed files with 450 additions and 494 deletions.
4 changes: 2 additions & 2 deletions doc/build/changelog/migration_11.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ SQLAlchemy's ``setup.py`` file has for many years supported operation
both with Setuptools installed and without; supporting a "fallback" mode
that uses straight Distutils. As a Setuptools-less Python environment is
now unheard of, and in order to support the featureset of Setuptools
more fully, in particular to support py.test's integration with it,
``setup.py`` now depends on Setuptools fully.
more fully, in particular to support py.test's integration with it as well
as things like "extras", ``setup.py`` now depends on Setuptools fully.

.. seealso::

Expand Down
5 changes: 5 additions & 0 deletions lib/sqlalchemy/testing/profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ def platform_key(self):
platform_tokens.append("pypy")
if win32:
platform_tokens.append("win")
platform_tokens.append(
"nativeunicode"
if config.db.dialect.convert_unicode
else "dbapiunicode"
)
_has_cext = config.requirements._has_cextensions()
platform_tokens.append(_has_cext and "cextensions" or "nocextensions")
return "_".join(platform_tokens)
Expand Down
12 changes: 5 additions & 7 deletions regen_callcounts.tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{27,33,34}-sqla_{cext,nocext}-db_{sqlite,postgresql,mysql}
envlist = py{27,34,35}-sqla_{cext,nocext}-db_{sqlite,postgresql,mysql}

[base]
basecommand=
Expand All @@ -8,15 +8,13 @@ basecommand=
[testenv]
deps=pytest
mock
py{27,33,34}-sqla_{cext,nocext}-db_{postgresql}: psycopg2
py{27}-sqla_{cext,nocext}-db_{mysql}: mysql-python
py{33,34}-sqla_{cext,nocext}-db_{mysql}: pymysql

db_postgresql: .[postgresql]
db_mysql: .[mysql]
db_mysql: .[pymysql]


commands=
py{27}-sqla_{cext,nocext}-db_{mysql}: {[base]basecommand} --db mysql
py{33,34}-sqla_{cext,nocext}-db_{mysql}: {[base]basecommand} --db pymysql
db_{mysql}: {[base]basecommand} --db mysql --db pymysql
db_{postgresql}: {[base]basecommand} --db postgresql
db_{sqlite}: {[base]basecommand} --db sqlite

Expand Down
15 changes: 9 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ python_files=test/*test_*.py
sign = 1
identity = C4DAFEE1


[sqla_testing]
requirement_cls=test.requirements:DefaultRequirements
profile_file=test/profiles.txt
Expand All @@ -38,16 +39,18 @@ oracle_db_link = test_link
default=sqlite:///:memory:
sqlite=sqlite:///:memory:
sqlite_file=sqlite:///querytest.db

postgresql=postgresql://scott:tiger@127.0.0.1:5432/test
pg8000=postgresql+pg8000://scott:tiger@127.0.0.1:5432/test
postgres=postgresql://scott:tiger@127.0.0.1:5432/test
postgresql_jython=postgresql+zxjdbc://scott:tiger@127.0.0.1:5432/test
postgresql_psycopg2cffi=postgresql+psycopg2cffi://scott:tiger@127.0.0.1:5432/test
mysql=mysql://scott:tiger@127.0.0.1:3306/test?charset=utf8&use_unicode=0
mysqlconnector=mysql+mysqlconnector://scott:tiger@127.0.0.1:3306/test
mssql=mssql+pyodbc://scott:tiger@ms_2008
oursql=mysql+oursql://scott:tiger@127.0.0.1:3306/test

mysql=mysql://scott:tiger@127.0.0.1:3306/test?charset=utf8
pymysql=mysql+pymysql://scott:tiger@127.0.0.1:3306/test?charset=utf8

mssql=mssql+pyodbc://scott:tiger@ms_2008
mssql_pymssql=mssql+pymssql://scott:tiger@ms_2008

oracle=oracle://scott:tiger@127.0.0.1:1521
oracle8=oracle://scott:tiger@127.0.0.1:1521/?use_ansi=0

firebird=firebird://sysdba:masterkey@localhost//Users/classic/foo.fdb
10 changes: 10 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,16 @@ def run_setup(with_cext):
"Operating System :: OS Independent",
],
distclass=Distribution,
extras_require={
'mysql': ['mysqlclient'],
'pymysql': ['pymysql'],
'postgresql': ['psycopg2'],
'postgresql_pg8000': ['pg8000'],
'postgresql_psycopg2cffi': ['psycopg2cffi'],
'oracle': ['cx_oracle'],
'mssql_pyodbc': ['pyodbc'],
'mssql_pymssql': ['pymssql']
},
**kwargs
)

Expand Down
Loading

0 comments on commit 6b05150

Please sign in to comment.