summaryrefslogtreecommitdiff
path: root/setup.py
Commit message (Collapse)AuthorAgeFilesLines
* Replace c extension with cython versions.workflow_test_cythonFederico Caselli2021-12-171-91/+81
| | | | | | | | | | | | | | | Re-implement c version immutabledict / processors / resultproxy / utils with cython. Performance is in general in par or better than the c version Added a collection module that has cython version of OrderedSet and IdentitySet Added a new test/perf file to compare the implementations. Run ``python test/perf/compiled_extensions.py all`` to execute the comparison test. See results here: https://docs.google.com/document/d/1nOcDGojHRtXEkuy4vNXcW_XOJd9gqKhSeALGG3kYr6A/edit?usp=sharing Fixes: #7256 Change-Id: I2930ef1894b5048210384728118e586e813f6a76 Signed-off-by: Federico Caselli <cfederico87@gmail.com>
* favor setuptools imports over distutilsMike Bayer2021-11-171-4/+12
| | | | | | | | | | | | | | Python 3.10 has deprecated "distutils" in favor of explicit use of "setuptools" in :pep:`632`; SQLAlchemy's setup.py has replaced imports accordingly. However, since setuptools itself only recently added the replacement symbols mentioned in pep-632 as of November of 2022 in version 59.0.1, ``setup.py`` still has fallback imports to distutils, as SQLAlchemy 1.4 does not have a hard setuptools versioning requirement at this time. SQLAlchemy 2.0 is expected to use a full :pep:`517` installation layout which will indicate appropriate setuptools versioning up front. Fixes: #7311 Change-Id: I215ef3c3b226a38266f59d181214aea462c4664d
* Minor optimization to the codeFederico Caselli2021-02-181-5/+0
| | | | | | | | | * remove the c version of distill params since it's actually slower than the python one * add a function to langhelpers to check if the cextensions are active * minor cleanup to the OrderedSet implementation Change-Id: Iec3d0c3f0f42cdf51f802aaca342ba37b8783b85
* Repair incorrect symbol PyDict_GetItemWithError for Python 2Mike Bayer2021-01-271-2/+2
| | | | | | | | | | | | * ensure on python 2 correct cflags to fail on undefined symbols take effect * fail for implicit function declaration * python 2 does not publish PyDict_GetItemWithError but has it as _PyDict_GetItemWIthError but only as of Python 2.7.12 Change-Id: I007509afddf7f44ca64e52fa9140be39f815fa7a
* Use importlib_metadata; add namespace for mariadbMike Bayer2020-08-131-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The ``importlib_metadata`` library is used to scan for setuptools entrypoints rather than pkg_resources. as importlib_metadata is a small library that is included as of Python 3.8, the compatibility library is installed as a dependency for Python versions older than 3.8. Unfortunately setuptools "attr:" is broken because it tries to import the module; seems like this is fixed as part of https://github.com/pypa/setuptools/pull/1753 however this is too recent to rely upon for now. Added a new dialect token "mariadb" that may be used in place of "mysql" in the :func:`_sa.create_engine` URL. This will deliver a MariaDB dialect subclass of the MySQLDialect in use that forces the "is_mariadb" flag to True. The dialect will raise an error if a server version string that does not indicate MariaDB in use is received. This is useful for MariaDB-specific testing scenarios as well as to support applications that are hardcoding to MariaDB-only concepts. As MariaDB and MySQL featuresets and usage patterns continue to diverge, this pattern may become more prominent. Fixes: #5400 Fixes: #5496 Change-Id: I330815ebe572b6a9818377da56621397335fa702
* Move most setup options to setup.cfgMike Bayer2020-06-191-67/+1
| | | | | | | | Installation has been modernized to use setup.cfg for most package metadata. Fixes: #5404 Change-Id: Id59c0c4e7f81eca89999d1f1f8b03c89835a09d1
* Add immutabledict C codeMike Bayer2020-05-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Start trying to convert fundamental objects to C as we now rely on a fairly small core of things, and 1.4 is having problems with complexity added being slower than the performance gains we are trying to build in. immutabledict here does seem to bench as twice as fast as the Python one, see below. However, it does not appear to be used prominently enough to make any dent in the performance tests. at the very least it may provide us some more lift-and-copy code for more C extensions. import timeit from sqlalchemy.util._collections import not_immutabledict, immutabledict def run(dict_cls): for i in range(1000000): d1 = dict_cls({"x": 5, "y": 4}) d2 = d1.union({"x": 17, "new key": "some other value"}, None) assert list(d2) == ["x", "y", "new key"] print( timeit.timeit( "run(d)", "from __main__ import run, not_immutabledict as d", number=1 ) ) print( timeit.timeit( "run(d)", "from __main__ import run, immutabledict as d", number=1 ) ) output: python: 1.8799766399897635 C code: 0.8880784640205093 Change-Id: I29e7104dc21dcc7cdf895bf274003af2e219bf6d
* Remove support for python 3.4Federico Caselli2020-03-301-2/+1
| | | | | | Also remove no longer used compat code Change-Id: Ifda239fd84b425e43f4028cb55a5b3b8efa4dfc6
* Fix typo in resultproxy.c and test compatibility with python 3.5Federico Caselli2020-03-281-8/+16
| | | | | | | | | | | - Fix typo in resultproxy.c that would error on windows. - add -Wundef to C flags when linux is detected so that undefined symbols emit a warning - a few adjustments for tests to succeed on python 3.5 - note minimum version still documented here as 3.4 but this should move to at least 3.5 if not 3.6 for SQLAlchemy 1.4 Change-Id: Ia93ee1cb5c52e51e72eb0a24c100421c5157d04b
* Add py3.8, py3.9 token to setup.pyGord Thompson2020-01-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes: #5113 <!-- Provide a general summary of your proposed changes in the Title field above --> ### Description Add py3.8 and py3.9 tokens to setup.py ### Checklist <!-- go over following points. check them with an `x` if they do apply, (they turn into clickable checkboxes once the PR is submitted, so no need to do everything at once) --> This pull request is: - [ ] A documentation / typographical error fix - Good to go, no issue or tests are needed - [x] A short code fix - please include the issue number, and create an issue if none exists, which must include a complete example of the issue. one line code fixes without an issue and demonstration will not be accepted. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. one line code fixes without tests will not be accepted. - [ ] A new feature implementation - please include the issue number, and create an issue if none exists, which must include a complete example of how the feature would look. - Please include: `Fixes: #<issue number>` in the commit message - please include tests. **Have a nice day!** Closes: #5115 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/5115 Pull-request-sha: 5ae662f1ec0d89a16a03fe60d6f12712d0d21398 Change-Id: I1313df9bd117b1356c1d06d588e8e04a07ba4e39
* Fix cext for Python 2; ensure C extensions build successfullyMike Bayer2020-01-041-0/+15
| | | | | | | | | | | | | | | | | | | | The C extensions have been broken since cc718cccc0bf8a01abdf4068c however CI did not find this, because the build degraded to non-C extensions without failing. Ensure that if cext is set, there is no fallback to non-cext build if the C extension build fails. Repair C related issues introduced in cc718cccc0bf8a01abdf4068c. As C extensions have been silently failing on 2.7 for some commits, the callcounts also needed to be adjusted for recent performance-related changes. That in turn required a fix to the profiling decorator to use signature rewriting in order to support py.test's fixture mechanism under Python 2, usage introduced under profiling in 89bf6d80a9. Fixes: #5076 Change-Id: Id968f10c85d6bf489298b1c318a1f869ad3e7d80
* Work around setuptools issue #1902Mike Bayer2019-11-081-1/+2
| | | | | | | | | | | | | Added a workaround for a setuptools-related failure that has been observed as occurring on Windows installations, where setuptools is not correctly reporting a build error when the MSVC build dependencies are not installed and therefore not allowing graceful degradation into non C extensions builds. Setuptools issue https://github.com/pypa/setuptools/issues/1902 Fixes: #4967 Change-Id: I5e21e7e78cb6d927b18afce64cacf8643b98354e
* Remove python setup.py test; fix SQL Server URLMike Bayer2019-10-281-31/+11
| | | | | | | | general README.unittest.rst edits Fixes: #4789 Fixes: #4900 Change-Id: Ifddd3bfd1e6a4d24d3b0a3e1702e04e66a42a4dd
* Reformat license nameMike Bayer2019-05-281-1/+1
| | | | | | | | | | While we have the OSI classifier for "MIT License", it looks like for the "license" field, this is normally just the word "MIT" and not "MIT License". While the pypa docs suggest we only need it as the OSI classifier, keep it also in "license" in order to appease common tooling. Change-Id: Ife51bbc74d6c1b8ab9a736024818fbba35316e17
* Add documentation / tracker URLs for pypiMike Bayer2019-05-271-0/+4
| | | | Change-Id: I379b3d9e59ff8cda17c2d738fde794249f105510
* Post black reformattingMike Bayer2019-01-061-6/+9
| | | | | | | | | | | | | Applied on top of a pure run of black -l 79 in I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9, this set of changes resolves all remaining flake8 conditions for those codes we have enabled in setup.cfg. Included are resolutions for all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I4f72d3ba1380dd601610ff80b8fb06a2aff8b0fe
* Run black -l 79 against all source filesMike Bayer2019-01-061-52/+67
| | | | | | | | | | | | | | This is a straight reformat run using black as is, with no edits applied at all. The black run will format code consistently, however in some cases that are prevalent in SQLAlchemy code it produces too-long lines. The too-long lines will be resolved in the following commit that will resolve all remaining flake8 issues including shadowed builtins, long lines, import order, unused imports, duplicate imports, and docstring issues. Change-Id: I7eda77fed3d8e73df84b3651fd6cfcfe858d4dc9
* Assorted pre-Black fixesMike Bayer2019-01-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes to the test suite, a few errant imports, and setup.py: - mysql and postgresql have unused 'json' imports; remove - postgresql is exporting the 'json' symbol, remove - make sure setup.py can find __version__ using " or ' - retry logic in provision create database for postgresql fixed - refactor test_magazine to use cls.tables rather than globals - remove unused class in test_scoping - add a comment to test_deprecations that this test suite itself is deprecated - don't use mapper() and orm_mapper() in test_unitofwork, just use mapper() - remove dupe test_scalar_set_None test in test_attributes - Python 2.7 and above includes unittest.SkipTest, remove pre-2.7 fallback - use imported SkipTest in profiling - declarative test_reflection tests with "reflectable_autoincrement" already don't run on oracle or firebird; remove conditional logic for these, which also removes an "id" symbol - clean up test in test_functions, remove print statement - remove dupe test_literal_processor_coercion_native_int_out_of_range in test/sql/test_types.py - fix psycopg2_hstore ref Change-Id: I7b3444f8546aac82be81cd1e7b6d8b2ad6834fe6
* - block py.test 3.9.1 and 3.9.2, 3.9.3 is OKMike Bayer2018-11-021-1/+1
| | | | Change-Id: I35ecd78b92ea420ef7909de65f82e005b92bf986
* Pin pytest *before* 3.9.1 totallyMike Bayer2018-10-241-1/+1
| | | | | | | | | | Unfortunately they have released 3.9.2 before fixing issue 4181, which means we will have to re-pin a third time after they eventually release with a fix Change-Id: I9b6fab1b535f883a035f002264c41ad0166790ab Reference: https://github.com/pytest-dev/pytest/issues/4181
* block py.test 3.9.1Mike Bayer2018-10-171-2/+2
| | | | | | | | references: https://github.com/pytest-dev/pytest/issues/4181 Change-Id: I216fde19dd0f5c4910d76c08400f2329b09ad584
* Add python_requires and update classifiersHugo2018-08-261-0/+7
| | | | | | | | | | | | - bump minimum Python 3 version to 3.4 in docs - set up setup.py classifiers to cover 2.7, 3.4, 3.5, 3.6, 3.7 explicitly - add python_requires These are also the ones supported by the core Python team. https://en.wikipedia.org/wiki/CPython#Version_history Change-Id: I2ffa632c73c39bf38ba9d8b5dcc86d552b61aa68 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/468
* Add `postgresql_psycopg2binary` install extra that installs `psycopg2-binary`rel_1_@Alex Rothberg2018-07-181-0/+1
| | | | | | Fixes: #4306 Change-Id: I26edc1a4ac8a7f9f3f258bb03009ebfa4cc00e1a Pull-request: https://github.com/zzzeek/sqlalchemy/pull/465
* Add oracle, mssql to profilingMike Bayer2018-06-181-1/+2
| | | | | | | As we are changing Oracle typing *again*, we should start tracking if we trip over a big performance hit on the unicode stuff. Change-Id: I72719cca4b9424171b32e1f2e58d655426e3bbba
* Isolate memory tests in forksMike Bayer2017-08-141-1/+1
| | | | | | | | | | | | Swing the biggest hammer, run multiprocessing.Process() for each memusage test individually so that they are fully isolated from the parent process and any side effects of pytest-xdist Also add --nomemory as a shortcut to exclude_tags=memory-intensive and add this to the setup.py test runner as the memory tests should not be running for quick runs Change-Id: I3c16c781e21b33deb939a64e77a6e0e41fb86922
* - bump minimum python version to 2.7Mike Bayer2017-03-101-3/+2
| | | | | | - add placeholder 1.2 release documentation, update intro numbers Change-Id: I9f9969cbb9e95c2f750a5c16798e92c35a5ef6cf
* - further changes to avoid pytest warningsMike Bayer2017-01-171-2/+2
| | | | Change-Id: Ia83a996ff97a6ba54a0666a32241e570f3852ab4
* update pytest good practices link in PyTest classMark Sandan2016-06-161-2/+4
| | | | | Change-Id: Ie96edd05e962663e9ddeeda85b24858caabd3bfd Pull-request: https://github.com/zzzeek/sqlalchemy/pull/262
* - add a new qualifier "native" vs. "dbapi" unicode to avoidMike Bayer2016-01-241-0/+10
| | | | | | 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
* Tell Wheel to generate platform and interpreter specific wheelspr/194Donald Stufft2015-08-131-1/+16
| | | | | | | By telling wheel that we have extension modules, even though we have none, wheel will create a Wheel which is platform and interpreter specific. This will ensure that the pure Python wheels on PyPy do not trigger installs on CPython without the C speedups.
* - we can again use setuptools.find_packages since we require setuptoolsMike Bayer2015-08-131-25/+13
| | | | - clean up other things we aren't using anymore
* - remove "distutils-only" mode, use setuptools onlyMike Bayer2015-07-241-60/+62
| | | | | | - add first-class "pytest" runner to setup.py, fixes #3489 - remove references to setuptools Feature and mark that "--without-cextensions" is removed, fixes #3500
* - have python setup.py test use xdist with -qMike Bayer2014-08-081-1/+1
|
* fixed style to conform to PEP8Brian Jarrett2014-07-101-37/+42
|
* - Fixed bug where "python setup.py test" wasn't calling intoMike Bayer2014-07-091-1/+1
| | | | | distutils appropriately, and errors would be emitted at the end of the test suite.
* - we aren't supporting py2.5 so just simplify this import for platform, re: ↵Mike Bayer2014-03-221-9/+3
| | | | #2986
* - Adjusted ``setup.py`` file to support the possible futureMike Bayer2014-03-221-9/+31
| | | | | | | | | | | | | | | | | | removal of the ``setuptools.Feature`` extension from setuptools. If this keyword isn't present, the setup will still succeed with setuptools rather than falling back to distutils. C extension building can be disabled now also by setting the DISABLE_SQLALCHEMY_CEXT environment variable. This variable works whether or not setuptools is even available. fixes #2986 - using platform.python_implementation() in setup.py to detect CPython. I've tested this function on OSX and linux on Python 2.6 through 3.4, including 3.1, 3.2, 3.3. Unfortunately, on OSX + 3.2 only, it seems to segfault. I've tried installing 3.2.5 from the python.org .dmg, building it from source, and also blew away the whole 3.2 directory, something seems to be wrong with the "platform" module on that platform only, and there's also no issue on bugs.python.org; however, I'm going with it anyway. If someone is using 3.2 on OSX they really should be upgrading.
* - Support has been added for pytest to run tests. This runnerMike Bayer2014-03-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | is currently being supported in addition to nose, and will likely be preferred to nose going forward. The nose plugin system used by SQLAlchemy has been split out so that it works under pytest as well. There are no plans to drop support for nose at the moment and we hope that the test suite itself can continue to remain as agnostic of testing platform as possible. See the file README.unittests.rst for updated information on running tests with pytest. The test plugin system has also been enhanced to support running tests against mutiple database URLs at once, by specifying the ``--db`` and/or ``--dburi`` flags multiple times. This does not run the entire test suite for each database, but instead allows test cases that are specific to certain backends make use of that backend as the test is run. When using pytest as the test runner, the system will also run specific test suites multiple times, once for each database, particularly those tests within the "dialect suite". The plan is that the enhanced system will also be used by Alembic, and allow Alembic to run migration operation tests against multiple backends in one run, including third-party backends not included within Alembic itself. Third party dialects and extensions are also encouraged to standardize on SQLAlchemy's test suite as a basis; see the file README.dialects.rst for background on building out from SQLAlchemy's test platform.
* - The C extensions are ported to Python 3 and will build underMike Bayer2013-07-261-1/+1
| | | | any supported CPython 2 or 3 environment. [ticket:2161]
* - replace most explicitly-named test objects called "Mock..." withMike Bayer2013-06-301-2/+1
| | | | | | | | | | | | actual mock objects from the mock library. I'd like to use mock for new tests so we might as well use it in obvious places. - use unittest.mock in py3.3 - changelog - add a note to README.unittests - add tests_require in setup.py - have tests import from sqlalchemy.testing.mock - apply usage of mock to one of the event tests. we can be using this approach all over the place.
* don't need 2to3Mike Bayer2013-04-281-52/+20
|
* - revert mistaken checkinMike Bayer2013-02-061-1/+1
|
* - need autoincrement hereMike Bayer2013-02-061-1/+1
|
* - revert the "basedir" thing - running setup.py from the currdir is ↵Mike Bayer2012-09-291-10/+4
| | | | | | unfortunately part of the distutils docs (http://docs.python.org/install/index.html#platform-variations)
* - enhance setup.py to support being run from outside the current directory. ↵Mike Bayer2012-09-291-14/+20
| | | | | | hopefully there's no gotchas with this on other platforms.
* - add new C extension "utils", so far includes distill_paramsMike Bayer2012-08-071-1/+3
| | | | | - repair test_processors which wasn't hitting the python functions - add another suite to test_processors that does distill_params
* trailing whitespace bonanzaMike Bayer2012-07-281-3/+3
|
* unmonkeypatch the 2to3 preprocessor so we don't disturb subsequent runsPhilip Jenvey2012-03-021-7/+21
| | | | | patch from mcdonc fixes #2421
* modernize the READMEMike Bayer2012-01-261-126/+9
|
* add supported implementationsMike Bayer2011-12-031-0/+3
|