summaryrefslogtreecommitdiff
path: root/tox.ini
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Improve typing to accommodate sqlalchemy v2" into mainmike bayer2023-03-011-2/+1
|\
| * Improve typing to accommodate sqlalchemy v2CaselIT2023-02-261-2/+1
| | | | | | | | | | | | | | Index name can be null. Fixes: #1168 Change-Id: Id7c944e19a9facd7d3862d43f84fd70aedace999
* | ensure single import per lineMike Bayer2023-02-281-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the very small plugin flake8-import-single which will prevent us from having an import with more than one symbol on a line. Flake8 by itself prevents this pattern with E401: import collections, os, sys However does not do anything with this: from sqlalchemy import Column, text Both statements have the same issues generating merge artifacts as well as presenting a manual decision to be made. While zimports generally cleans up such imports at the top level, we don't enforce zimports / pre-commit use. the plugin finds the same issue for imports that are inside of test methods. We shouldn't usually have imports in test methods so most of them here are moved to be top level. The version is pinned at 0.1.5; the project seems to have no activity since 2019, however there are three 0.1.6dev releases on pypi which stopped in September 2019, they seem to be experiments with packaging. The source for 0.1.5 is extremely simple and only reveals one method to flake8 (the run() method). Change-Id: Icea894e43bad9c0b5d4feb5f49c6c666d6ea6aa1
* try to restore color to pytestMike Bayer2022-12-111-1/+1
| | | | | | | | the problem here is that the color codes will come out in jenkins runs. see if jenkins maybe does something with that (filters or maybe even gives us color) Change-Id: I9c8660fa85fb216cae16e18b776f34b005d3ac51
* adjust for tox changes to passenvMike Bayer2022-12-111-1/+8
| | | | | | | | | Fixed issue in tox.ini file where changes in the tox 4.0 series to the format of "passenv" caused tox to not function correctly, in particular raising an error as of tox 4.0.6. Change-Id: I659c8fc523a71deaa02a89103c9e7241cf81d831 References: https://github.com/tox-dev/tox/issues/2676
* bump black to 22.3.0Mike Bayer2022-03-281-2/+2
| | | | | | | | | both black and click were released in the past few hours, and black 21.5b1 seems to suddenly be failing on a missing symbol from click. just update to the latest Change-Id: Icb9d98d6473aa603aa29ad1c2d1e43ff3b371db5
* resolve for variant before testing for schema typeMike Bayer2022-02-011-0/+1
| | | | | | | | | | | | | | | | | Fixed regression where usage of a ``with_variant()`` datatype in conjunction with the ``existing_type`` option of ``op.alter_column()`` under batch mode would lead to an internal exception. note this exception would only occur under 1.x, under 2.0 the new variant architecture would have prevented this problem, however it is best here that the ultimate variant type is unwrapped in the case that we have a plain type with a schema type as a variant. also sqla 1.3 needs pytest < 7 to run correctly Change-Id: I0f5480f97f014e707b8bd4e70f8495d3bd27fd21 Fixes: #982
* add pep484 targetMike Bayer2022-01-201-1/+7
| | | | | | | this is now the mypy target that the jenkins gerrit job will access. Change-Id: Iaa2bdbe8c4da683d7704a50be8ff3d9e7f887e09
* workflow: also test against rel_1_4CaselIT2021-11-041-0/+1
| | | | Change-Id: I68c8a06c9d8baefdb6736e701be33b730eff7442
* rename to mainMike Bayer2021-10-111-1/+1
| | | | Change-Id: I6cff33e68cbb2735f3fda22433c36e565a3d5e7a
* Add mypy to the github workflowCaselIT2021-09-131-1/+1
| | | | | Fixes: #917 Change-Id: I77d8a3673eb6d990ca947c59f6960925561d122a
* generate .pyi files for proxied classesMike Bayer2021-08-221-0/+2
| | | | | | | | | | | | | | | | | | Stub .pyi files have been added for the "dynamically" generated Alembic modules ``alembic.op`` and ``alembic.context``, which include complete function signatures and docstrings, so that the functions in these namespaces will have both IDE support (vscode, pycharm, etc) as well as support for typing tools like Mypy. The files themselves are statically generated from their source functions within the source tree. Still not available is sphinx autodoc from the .pyi file. so we might want to further modify this to write into the .py directly. if we do *that*, we could almost get rid of ModuleClsProxy and just generate proxying methods fully in op.py. however, this won't work for the "extending ops" use case. Change-Id: I3f084040de25ed3f8e92a4e9d0bb83d69b78eac6
* Add pep-484 type annotationsCaselIT2021-08-111-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pep-484 type annotations have been added throughout the library. This should be helpful in providing Mypy and IDE support, however there is not full support for Alembic's dynamically modified "op" namespace as of yet; a future release will likely modify the approach used for importing this namespace to be better compatible with pep-484 capabilities. Type originally created using MonkeyType Add types extracted with the MonkeyType https://github.com/instagram/MonkeyType library by running the unit tests using ``monkeytype run -m pytest tests``, then ``monkeytype apply <module>`` (see below for further details). USed MonkeyType version 20.5 on Python 3.8, since newer version have issues After applying the types, the new imports are placed in a ``TYPE_CHECKING`` guard and all type definition of non base types are deferred by using the string notation. NOTE: since to apply the types MonkeType need to import the module, also the test ones, the patch below mocks the setup done by pytest so that the tests could be correctly imported diff --git a/alembic/testing/__init__.py b/alembic/testing/__init__.py index bdd1746..b1090c7 100644 Change-Id: Iff93628f4b43c740848871ce077a118db5e75d41 --- a/alembic/testing/__init__.py +++ b/alembic/testing/__init__.py @@ -9,6 +9,12 @@ from sqlalchemy.testing.config import combinations from sqlalchemy.testing.config import fixture from sqlalchemy.testing.config import requirements as requires +from sqlalchemy.testing.plugin.pytestplugin import PytestFixtureFunctions +from sqlalchemy.testing.plugin.plugin_base import _setup_requirements + +config._fixture_functions = PytestFixtureFunctions() +_setup_requirements("tests.requirements:DefaultRequirements") + from alembic import util from .assertions import assert_raises from .assertions import assert_raises_message Currently I'm using this branch of the sqlalchemy stubs: https://github.com/sqlalchemy/sqlalchemy2-stubs/tree/alembic_updates Change-Id: I8fd0700aab1913f395302626b8b84fea60334abd
* repair py3k mergeMike Bayer2021-06-261-1/+0
| | | | | | | | | | in 79f84f71e1045aafed389e7b221 I merged without rebasing so we missed updating the recent version_locations patch, fix that. also we don't need mock as a test dependency. Change-Id: Ic2fe1db8b105c60ec51eefec7a4dc8d8c495b119
* Drop compatibility with python 2.7.CaselIT2021-06-221-2/+1
| | | | | | Now alembic supports only python from version 3.6. Change-Id: Iccf124c2d74af801d90a16c9003cdad318768625
* Revendor editor and make dateutil optionalCaselIT2021-06-151-1/+0
| | | | | | | | | | | | | | | | | Re-implemented the ``python-editor`` dependency as a small internal function to avoid the need for external dependencies. The implementation is based on the original version in 7b91b325ff43a0e9235e0f15b57391fa92352626. Make the ``python-dateutil`` library an optional dependency. This library is only required if the ``timezone`` option is used in the Alembic configuration. An extra require named ``tz`` is available with ``pip install alembic[tz]`` to install it. Fixes: #674 Fixes: #856 Change-Id: I07f17b2fea01e3a3d677ce95333fe3e8d8d438fd
* Update black, zimports and flake8CaselIT2021-05-121-1/+1
| | | | Change-Id: Ia7d0ea7cc4389bc6adc4226efd5b18ecb68ffb2b
* Enable SQL Server testing and fix autogen issuesMike Bayer2021-01-281-14/+5
| | | | | | | | | | | | | Fixed assorted autogenerate issues with SQL Server: * ignore default reflected identity on primary_key columns * improve server default comparison Updated test_autogen_fks for modern levels of FK capabilities Change-Id: I94b815cedf90422ccd5ceceb765b07d772b505b7 Fixes: #787
* temporarily block mssqlMike Bayer2021-01-271-2/+11
| | | | | | | | | | | We've enabled mssql on jenkins which is failing right now. Disable it from tox directly so builds can run until we get it fixed. Also see if we can switch to using SQLAlchemy extras_require here. Change-Id: If644ecccb08e72da525ab40370141d2d20de093b
* Fix workflow test window failCaselIT2021-01-191-1/+1
| | | | | | | | | | Need to disable asyncio before calling into pytest session start or windows will fails randomly. Closes: #783 Pull-request: https://github.com/sqlalchemy/alembic/pull/783 Pull-request-sha: c92f7a2c0460899c942fcc668cbffe672b59df01 Change-Id: I9026334db651aa977fbc809494f449e38ca16a6f
* Merge "Accommodate SQLAlchemy 1.4/2.0"mike bayer2021-01-121-4/+11
|\
| * Accommodate SQLAlchemy 1.4/2.0CaselIT2021-01-111-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To accommodate SQLAlchemy 1.4 and 2.0, the migration model now no longer assumes that the SQLAlchemy Connection will autocommit an individual operation. This essentially means that for databases that use non-transactional DDL (pysqlite current driver behavior, MySQL), there is still a BEGIN/COMMIT block that will surround each individual migration. Databases that support transactional DDL should continue to have the same flow, either per migration or per-entire run, depending on the value of the :paramref:`.Environment.configure.transaction_per_migration` flag. Compatibility is established such that the entire library should not generate any SQLAlchemy 2.0 deprecation warnings and SQLALCHEMY_WARN_20 is part of conftest.py. (one warning remains for the moment that needs to be resolved on the SQLAlchemy side) The test suite requires SQLAlchemy 1.4.0b2 for testing 1.4; 1.4.0b1 won't work. Test suite / setup also being modernized, as we are at SQLAlchemy 1.3 we can now remove the majority of the testing suite plugin. Change-Id: If55b1ea3c12ead66405ab3fadc76d15d89dabb90
* | Pin PyMySQL < 1.0.0 for python 2Mike Bayer2021-01-071-1/+2
|/ | | | Change-Id: I4b5533463acb858c76739e56d94c0e642035cee4
* Update black to 20.8b1CaselIT2020-10-261-1/+1
| | | | Change-Id: Id9b8ce6a0ccd2a6fa17b779c95d4079a5fa629d7
* Remove support for Python 3.5 and SQLAlchemy older than the 1.3 series.CaselIT2020-10-261-2/+0
| | | | | Fixes: #748 Change-Id: I18df97bdce5de6adb222d3f16486272e95b1b1a6
* Support pytest 6.xMike Bayer2020-09-271-2/+2
| | | | | | | | | | | pytest has removed support for pytest.Class(..parent) and we need to use from_parent. Also works around new issue for 6.1.0 References: https://github.com/pytest-dev/pytest/issues/7807 Change-Id: Ia5fed9b22e76c99f71489283acee207f996f52a4
* revise bracket cx_Oracle for python 2 / 3Mike Bayer2020-07-161-2/+2
| | | | Change-Id: I9011dbc32a1ba677ecc659a8fdfc8606819fdf56
* Pin cx_oracle for python 2Mike Bayer2020-06-261-1/+2
| | | | | | | cx_Oracle 8 is out and it's python 3 only. get tox.ini to use cx_oracle 7 for python 2 tests. Change-Id: If57cb699f447653b1cb8ddd912a50c9180be08ac
* add posargs to pep8Mike Bayer2020-05-291-1/+1
| | | | | | we want to be able to specify --output-file Change-Id: I0a23431be6cbfd16514693183cda1a6c09ba98cc
* Update black to match sqlalchemy versionCaselIT2020-03-181-1/+4
| | | | | | | Also add a in the pep8 tox job a check to verify that all files are properly formatted Change-Id: I7bac8463b273f3bce9be098e6ee76f1761e28e72
* remove python setup.py testMike Bayer2019-08-261-3/+2
| | | | | | | | | | | | | | | | | Removed the "python setup.py test" feature in favor of a straight run of "tox". Per Pypa / pytest developers, "setup.py" commands are in general headed towards deprecation in favor of tox. The tox.ini script has been updated such that running "tox" with no arguments will perform a single run of the test suite against the default installed Python interpreter. .. seealso:: https://github.com/pypa/setuptools/issues/1684 https://github.com/pytest-dev/pytest/issues/5534 Change-Id: Ib92ef8d20ad0e6f1e1b9d25051b788788cc69b02 Fixes: #592
* Use SQLAlchemy's testing framework fullyMike Bayer2019-07-211-2/+2
| | | | | | | w/ 1.1 as the minimum version we should be able to remove the majority of the testing suite code Change-Id: I04c4ab45e2ce47f20613d6111895c6230b946f76
* Bump to Alembic 1.1, bump requirementsMike Bayer2019-07-211-7/+1
| | | | | | | | Alembic 1.1 bumps the minimum version of SQLAlchemy to 1.1. As was the case before, Python requirements remain at Python 2.7, or in the 3.x series Python 3.4. Change-Id: I68074fb4b59c96c4a596396a69aa143c65d048b5
* Fix imp warningMike Bayer2019-07-181-0/+2
| | | | | | | | | | | | | | | | Fixed use of the deprecated "imp" module, which is used to detect pep3147 availability as well as to locate .pyc files, which started emitting deprecation warnings during the test suite. The warnings were not being emitted earlier during the test suite, the change is possibly due to changes in py.test itself but this is not clear. The check for pep3147 is set to True for any Python version 3.5 or greater now and importlib is used when available. Note that some dependencies such as distutils may still be emitting this warning. Tests are adjusted to accommodate for dependencies that emit the warning as well. Pin pycodestyle - PyCQA/pydocstyle#375 Change-Id: Id7795d581f3ac2172960d31e33ee46b95117e5c4
* Add "usecase" changelog tagMike Bayer2019-06-031-1/+1
| | | | | | | | | | | | | | | | | "usecase" indicates the library now supports something a user was trying to do. It's not quite a "feature" since it's something that seems like it should have worked, it's not a "bug" because no mistake was made, it's just something that wasn't considered before. The advantage of "usecase" is that it inherently suggests a different style of prioritization vs. something that is preventing the library from working as designed. This change also adds docs/build/conf.py under the pep8 formatting test coverage, and additionally moves release / release_date to be present within; the release scripts will be altered to include this. Change-Id: Iea071a320e7a3672b35a41b13d5a74c0da5f9074
* - add sqla 1.3 part 2Mike Bayer2019-05-231-0/+1
| | | | Change-Id: Id970fe3b2fc64459737e5d0a77fdd8304cc6a7ae
* - add sqla 1.3Mike Bayer2019-05-231-1/+1
| | | | Change-Id: Id568effcce6a1706f37787baa8afcfadf221abc7
* Use basepython 3.7 for flake8 testsMike Bayer2019-03-041-0/+1
| | | | | | | this to prevent flake8 from running with python 2 as we have py3k-specific checks Change-Id: I82404ea91ecdfc29c70dbc2773f481a3c844215c
* pure black run + flake8Mike Bayer2019-01-061-12/+10
| | | | | | | run black -l 79 against source code, set up for full flake8 testing. Change-Id: I4108e1274d49894b9898ec5bd3a1147933a473d7
* Move to github, new domain, sqlalchemy linksMike Bayer2018-11-261-1/+1
| | | | | | | Alembic is now under the sqlalchemy.org domain for the website and all repos are moving under github.com/sqlalchemy. Change-Id: Id9ce08b61ed0ccdf50396f911838b21112e61652
* unblock for py.test as of 3.9.3Mike Bayer2018-11-021-1/+1
| | | | | Change-Id: Ib00d07058997e97a992084bd949ebb6ed2bcb2e2 References: I867e2b36122f578e69f2444ef9712cd73995cce3
* block all py.test 3.9.1 or greater untilMike Bayer2018-10-241-1/+1
| | | | | | https://github.com/pytest-dev/pytest/issues/4181 is fixed Change-Id: I867e2b36122f578e69f2444ef9712cd73995cce3
* block py.test 3.9.1Mike Bayer2018-10-171-1/+1
| | | | | | | | references: https://github.com/pytest-dev/pytest/issues/4181 Change-Id: Iad3b6845e94753c55771419ccd1f99852bc89159
* block cx_Oracle 6.4Mike Bayer2018-07-041-1/+1
| | | | | | Prevents https://github.com/oracle/python-cx_Oracle/issues/199 Change-Id: Ie964f4cf0d57b65f18761e5673f9ce67c948114a
* Add py37, sqla1.2 tags, drop py33 testingMike Bayer2018-06-191-1/+2
| | | | Change-Id: I791bf86fb11d1f570eb01c135ec28e02e624721a
* Use bitbucket for SQLA branchMike Bayer2017-09-211-1/+1
| | | | | | git.sqlalchemy.org is retired for now, consume from bitbucket Change-Id: I1501528d6856985965feede1f2a05e1488c50382
* Support pep3149, latest import mechanics, fullyMike Bayer2017-09-081-1/+3
| | | | | | | | | | | | | | | Reworked "sourceless" system to be fully capable of handling any combination of: Python2/3x, pep3149 or not, PYTHONOPTIMIZE or not, for locating and loading both env.py files as well as versioning files. This includes: locating files inside of ``__pycache__`` as well as listing out version files that might be only in ``versions/__pycache__``, deduplicating version files that may be in ``versions/__pycache__`` and ``versions/`` at the same time, correctly looking for .pyc or .pyo files based on if pep488 is present or not. The latest Python3x deprecation warnings involving importlib are also corrected. Change-Id: I2495e793c81846d3f05620dbececb18973dd8a8f Fixes: #449
* Enable multi-backend / driver in testsMike Bayer2017-08-211-1/+0
| | | | | | | Turn on __backend__ everywhere we can. Also try removing two worker limitaiton on oracle. Change-Id: Ib16ebbd9f9ae35893a74cbf823444d2cc4c731f0
* - dont use sitepackagesMike Bayer2017-08-211-2/+2
| | | | | | - only need usedevelop for coverage case Change-Id: Icba6d9f500e206c39a7d2d0ed77e82ad9ad3784d
* - support pymysql for testsMike Bayer2017-08-191-0/+1
| | | | Change-Id: Ibb13314a5a55733f7bd56a4fc9ac43bc04c97ac7