This change adds a new oslo_db.sqlalchemy.asyncio_enginefacade
which provides for the identical patterns as enginefacade but using
awaitables as well as the AsyncConnection / AsyncSession from
sqlalchemy.ext.asyncio.
Depends-on: https://review.opendev.org/c/openstack/requirements/+/930947
Change-Id: I19436e57b2e9954e25bdbece48b563c4e708a8a6
These are detected as errors since the clean up was done[1] in
the requirements repository.
[1] 314734e938f107cbd5ebcc7af4d9167c11347406
Change-Id: I5a068436ec1321d7a1aa39cfdd69743ea6ef4064
Introduced changes:
- pre-commit config and rules
- Add pre-commit to pep8 gate, Flake8 is covered in the pre-commit
hooks.
- Applying fixes for pre-commit compliance in all code.
Also commit hash will be used instead of version tags in pre-commit to
prevend arbitrary code from running in developer's machines.
pre-commit will be used to:
- trailing whitespace;
- Replaces or checks mixed line ending (mixed-line-ending);
- Forbid files which have a UTF-8 byte-order marker
(check-byte-order-marker);
- Checks that non-binary executables have a proper
shebang (check-executables-have-shebangs);
- Check for files that contain merge conflict strings
(check-merge-conflict);
- Check for debugger imports and py37+ breakpoint()
calls in python source (debug-statements);
- Attempts to load all yaml files to verify syntax (check-yaml);
- Run flake8 checks (flake8) (local)
For further details about tests please refer to:
https://github.com/pre-commit/pre-commit-hooks
Change-Id: Id03c1ea4752db3236c36521ca9c67125d5ba2526
Co-authored-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
This patch bumps bandit allowed version to >=1.6.0,<1.7.0 in order to
avoid the errors detailed here https://github.com/PyCQA/bandit/pull/393
Change-Id: I44f0b485266d6a03d12953f3f45e476ba821a00c
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: I3e1e5ed4e72837d45b78e5ccb9ce8cca416e5c11
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.
blacklist:
W504 line break after binary operator
Fix:
E305 expected 2 blank lines after class or function definition, found 1
Change-Id: I56d62f67914f07e7aef74f857c4b42e3bfd3416e
Bandit 1.6.0 accidentally changed how the exclusion list option is
handled and breaks our use of it. Cap to the previous version until
Bandit has fixed the problem.
Sphinx 2.0 no longer works on python 2.7, so we need to start capping
it there as well.
Change-Id: If86c82e0f4a519baca664af79352846c4af9a01c
Reference: https://github.com/PyCQA/bandit/pull/489
Earlier versions don't work with postgresql 10, which is now showing
up in distros.
Change-Id: I56589eb4ac55bec426d16f355398720f2994edcb
Closes-Bug: 1821400
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.
[1] https://etherpad.openstack.org/p/YVR-python-pti
Change-Id: Ifd51e726de277d33ff61db47110bf8b5563fcda7
oslo.db is consumed by the test suites of downstream libraries
as a test dependency; they make use of the oslo_db.sqlalchemy.test_fixtures
module which imports testresources and testscenarios, therefore
these are normal requirements of oslo.db; they are not limited
to test requirements.
Change-Id: I240fbc28ddf238614ff37e742a1415a5566bcd2d
Closes-bug: #1756352
As part of removing reliance on the old and deprecated zuul-cloner,
we need to shift constraints declaration to the deps line. This
means we unfortunately have to duplicate the extras declarations
into test-requirements - because otherwise the contraints for
oslo.db conflicts with the installation of itself.
Change-Id: I2b79444a58a9144993131f9cba7494b236d9e950
Adds extras for e.g. nova to use for testing, so that oslo.db can
control the libraries used.
Removes test-requirements.txt - it becomes a single env-marker
controlled list, and shows how tox will access those dependencies.
Co-Authored-By: Roman Podoliaka <rpodolyaka@mirantis.com>
Change-Id: I97ef5bad215abe60d92c3fda4474c48ccb13eab0
Mention mock explicitly rather than relying on it to be installed
as a transitive dependency, so that we have control on the mock
versions allowed.
Partial-Bug: #1476665
Change-Id: Id734c3d7b7ef1ab8d97a13edb1de006c029c22a0
Neutron (and presumably other projects) expect to be able to have
overlapping transactions open from two eventlets at once, without
deadlock.
Note that the default mysql sqlalchemy engine (mysqldb) fails this test.
This change modifies py27 tox env to run the full test suite separately
with and without TEST_EVENTLET environment variable set. When set,
tests are run with eventlet imported and monkey_patched.
Change-Id: Ib35c95defea8ace5b456af28801659f2ba67eb96
Related-Bug: #1350149
As discussed in the Liberty Design Summit "Moving apps to Python 3"
cross-project workshop, the way forward in the near future is to
switch to the pure-python PyMySQL library as a default.
Added a special test environment to keep MySQL-python support.
Documentation modified.
https://etherpad.openstack.org/p/liberty-cross-project-python3
Change-Id: I12b32dc097a121bd43991bc38dd4d289b65e86c1
Get a tox environment for py34/py33 that doesn't stop the existing
py26 and py27 to continue working with the adjusted test-requirements since
MySQL-python and sqlalchemy-migrate do not yet exist in 3.x.
Note that this does not fully make py34 work yet but it starts to work
in this direction of getting it to work (which will apparently require
quite a big more tweaking).
Change-Id: I024957a76f2de0bd406d14da5af6e4caf3d493e7
We have a few opportunistic test cases which are skipped in the gate
now because psycopg2 is missing.
Change-Id: Ia5e96ed4a6af7a311d8dc89b00a1fb4cc02f56ac
In order to keep this patch to just a requirements bump, ignore new and
stricter hacking rules that are being triggered. Fixing up the code and
turning these on is out of scope of this patch and is for future patches.
Change-Id: I632655eb975a9f6c2b922c065c029e9870bc2b70