Linting fails due to two different hacking rules: H214 and H216. We fix
H214 by using assertNotIn and assertIn over assertFalse(foo in bar) and
assertTrue(foo in bar). We ignore H216 as it says don't use the mock
library but storyboard actually does use mock and updating to use
unittest.mock appears to be a fair bit of work.
In the sqlaclhemy models we move some classes around to address this
error:
sqlalchemy.exc.InvalidRequestError: When initializing mapper mapped
class Story->stories, expression 'TimeLineEvent' failed to locate a
name ('TimeLineEvent'). If this is a class name, consider adding this
relationship() to the <class 'storyboard.db.models.Story'> class after
both dependent classes have been defined.
In the project loader we switch to using yaml.safe_load() to avoid the
missing Loader argument to yaml.load().
We pin jinja2 to < 3.0.0 as the old sphinx we've pinned to uses
contextfunction which appears to have been replaced in jinja2 3.0.0.
We should probably attempt to update the doc toolchain for storyboard
when we have time.
We pin MarkupSafe for similar reasons to the jinja2 pin. Version 2.1.0
of MarkupSafe removed the soft_unicode name which is used by sphinx.
Finally we run the python 3.6 and 3.7 jobs on ubuntu-bionic.
Change-Id: Ifcb6660ce2c89c21ba867aa88d942461bcff125d
The pinned versions of webob and hacking weren't functioning properly
with modern Python, so they are unpinned.
Unpinning hacking brought a number of extra rules into use, so this
commit also contains a number of code style fixes.
There was also an incompatibility in the test_setup.sh script, which
meant it doesn't work with MySQL 8.0 (which is in Ubuntu 20.04). This
is also fixed in this commit.
Change-Id: I0889bc35f8babfeec42f6f577d302bb5fbce1c95
Python 2.7 is deprecated now, and some dependencies have dropped their
support for it. We should also just drop support for it rather than
pinning the dependency versions.
This commit also switches to a generic Python 3 tox environment,
adds additional test jobs for more Python 3 versions, and cleans up
some Python 2 compatibility cruft.
Change-Id: I3e7cc1713dec1bada4a85f75362c4fa4f89ceae6
To simplify the launchpadlib dependency installation for the
storyboard-migrate utility, use a separate tox testenv specifically
for this purpose and put that as its only additional runtime
requirement. Name the testenv "lpimport" with the expectation that
in time we may also rename the storyboard-migrate utility similarly
(so as to disambiguate it from the Alembic migrations we rely on
for database schema upgrades).
Change-Id: I8bd36bf69c235c8957ae4a161fd22cbe80028cf4
OpenStack is switching from testrepository to stestr. Make the shift
here.
Also, while doing this, update the rest of the test-requirements.
testtools and python-subunit are removed because they are transitive
deps of oslotest and stestr already.
Change-Id: Idf1298e03a78653044532fd54a4f35dcf5c6c1c5
We want to default to running all tox environments under python 3, so
set the basepython value in each environment.
We do not want to specify a minor version number, because we do not
want to have to update the file every time we upgrade python.
We do not want to set the override once in testenv, because that
breaks the more specific versions used in default environments like
py35 and py36.
Change-Id: If74556d3489092ea33d82224d1c1695c182b6bea
Fix [H236] Use six.add_metaclass instead of __metaclass__.
Remove ignoring of: H233, H234, and H236 as they are passing.
Use hacking>=1.0.0
Change-Id: I310f1161467339c6784bae253e0e3713f23d5218
For most of the tests for storyboard sqlite is around 10 times faster
than MySQL (more for non-SSD systems). An sqlite database does not
support some operations, like modifying constraints or dropping
columns, so we cannot avoid testing with MySQL. We can however use
sqlite for local development to reduce the pain involved with running
tests as part of the development process.
This patch adds a tox environment for running the tests against
sqlite3. The new tox environment is intended to be used by developers
as well as the new check and gate job defined in .zuul.yaml.
The new job ensures that changes to alembic migration scripts continue
to work with sqlite.
This patch also modifies the existing alter scripts to skip steps not
supported under sqlite. Those steps aren't strictly needed, and they
are still tested when the CI system runs the tests with MySQL.
Change-Id: Icb979cb03e10c56519a90ea3976a4da2d9bddb05
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Do not set the variable in tox.ini, because that overrides any value
the user is trying to pass on the command line or from their
environment. A default is already set in .testr.conf using shell
syntax that supports using the value from the user if there is one.
Change-Id: I5ff1880655e927ea596217154958fb95857f5649
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Turn on the flag to cause documentation build warnings to be treated
as errors.
Change-Id: I0135d905cc77dfe30b06093d18e0883f8227bd85
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Move documentation dependencies to doc/requirements.txt
Change tox.ini to run sphinx-build directly, like the zuul job does.
Switch from oslosphinx to openstackdocstheme.
Change-Id: I079ff78edacaba673461824af770344cb3a896f2
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit bumps the os-testr version to use 1.0.0. 1.0.0 changes the
internals to use stestr instead of subprocessing testr. A bunch of
incorrect imports in the tests were updated as a well, relying on
relative import paths is finicky at the best of times so to make the
tests work this just points to the path based on the root of the package
instead.
Change-Id: I2aed3f6a9adeac2b7dbe58ee12c0a1485278d56f
The openid library seems to have problems with python3, so specify
python2 here so that when developers run the server using tox (as
recommended in the docs) they run with a python version compatible
with openid.
Change-Id: If4a886c1d6afa20e310c56b6299e36094855e823
Remove the sync config file, remaining unimported modules, and update a
couple of configuration files with references to the directory being removed.
Change-Id: I56ae9b23a6d1d06d80fbb44adaca16ca079a7663
Story: 2000776
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
By default tox does not pass environment variables to the processes it
runs. Add OS_TEST_TIMEOUT to the whitelist so that a developer running
the tests locally can update the timeout for the database tests that run
on a slow box.
Change-Id: I1300c0d8c0b8a0d5011fc5d2ac028f3ab2527593
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Replace the incubated copy of gettextutils with oslo.i18n, following the
best-practices guidelines in the library documentation for handling
imports, module names, and exceptions to the hacking rules.
Change-Id: Ie366afd8bda2a72c964d9ddf7dd53718002fb4d0
Story: 2000776
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
We can use newer setuptools and pbr to use environment markers in our
requirements files which allows us to select deps if the environment
matches. With this we restrict the email dep to python < 3.0 which is
the only dep we have that doesn't work across python 2 and 3.
Note that this also updates the pbr machinery to pull in this new
feature support. Part of this update requires updating hacking to avoid
conflicting pbr requirements. This in turn has created some churn in the
format of the code but should largely be a noop.
Change-Id: I0be5dd8a6b33a51329077b5a5f4c7f5576829956
Currently the tox.ini file has a section for py34 tests. In order
to get the python35-db job to build we need to create a py35
textenv section in the tox.ini file.
Change-Id: I5811cc11342b67358aa010c96affe7a6b3544b02
Add an other-requirements.txt file containing a cross-platform list
of dependencies needed for running included tox-based tests. Also
include a tox environment for convenience calling the bindep[*]
utility to list any missing system requirements.
This change is needed since the infra team will not install standard
packages in jobs anymore, projects should use other-requirements.txt
instead. The macros xvfb-install, firefox-install, chrome-install
which are used to run some jobs for this repository will be removed
soon.
This change is self-testing.
For other-requirements.txt see also
http://docs.openstack.org/infra/manual/drivers.html#package-requirements
[*] http://docs.openstack.org/infra/bindep/
Change-Id: I936ff0e7c58df8ddfe5fbc6f4e387868ac16a0b0
The email module is included with py3. Separating out py3 requirements
so we dont try to install it there.
Change-Id: I06d4fdf46677db6465374cc8da6b5cdd0c5defa3
We don't test pypy. Infra no longer has instances able to test
py33. Removing these from our tox.ini file seems sane.
Change-Id: Icf42af12b61749a115136f25a219f4083500f353
In an effort to move away from outdated and poorly ported
technologies, we are removing support for python 2.6.
Change-Id: I11ff08151ef8906aafbd61c55f08eb87ad19807d
Fixed doc build by aligning Sphinx version with global OS requirements.
Also added an entry for doc build to tox.ini.
Change-Id: Icf411219a73d4f50640e404d6db5019f5483e7f9
As a step towards continuous deployment and having a pecan/WSME REST
interface, split the database out into SQLalchemy-based model using
Alembic for migrations. To support that, also pull in oslo.db and use
oslo.config for config files.
Change-Id: I33a1e72700be14e28255aaa52faed70c4686a3ec
Added a pbr-based build system and a tox file and some requirements
files. Also moved the apps to all be under storyboard so that a
publication to PyPI won't do evil things from an install perspective.