152 Commits

Author SHA1 Message Date
Zuul
2c276e9518 Merge "tests: Enable SQLAlchemy 2.0 deprecation warnings" 2023-01-05 22:36:30 +00:00
silvacarloss
be18072005 Fix tox4 errors
Change-Id: I75c4c2d892ba4d8b2d96a6dc845e3091c821a774
2023-01-03 17:43:16 +00:00
Stephen Finucane
ca6c94bd16 tests: Enable SQLAlchemy 2.0 deprecation warnings
Well, sort of. We enable them but immediately filter out the ones we're
actually seeing, the rationale being that we can address these in a
piecemeal fashion without the risk of introducing new issues.

There's a lot more to be done here. However, the work done in oslo.db
[1] should provide a guide for how to resolve the outstanding issues.

[1] https://review.opendev.org/q/topic:"sqlalchemy-20"+project:openstack/oslo.db

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: If3a9bed39872012f8c64333cf378c434c22a2d15
2022-12-21 11:05:58 +00:00
Zuul
9ba393af27 Merge "Drop lower-constraints.txt and its testing" 2022-05-03 13:18:15 +00:00
Ghanshyam Mann
392894afee Drop lower-constraints.txt and its testing
As discussed in TC PTG[1] and TC resolution[2], we are
dropping the lower-constraints.txt file and its testing.
We will keep lower bounds in the requirements.txt file but
with a note that these are not tested lower bounds and we
try our best to keep them updated.

[1] https://etherpad.opendev.org/p/tc-zed-ptg#L326
[2] https://governance.openstack.org/tc/resolutions/20220414-drop-lower-constraints.html#proposal

Change-Id: I8457c0793d303aa7e95e0402260a788513feba77
2022-04-30 20:23:50 -05:00
Elod Illes
9b4c8c9251 [CI] Install dependencies for docs target
When tox 'docs' target is called, first it installs the dependencies
(listed in 'deps') in 'installdeps' phase, then it installs manila
(with its requirements) in 'develop-inst' phase. In the latter case
'deps' is not used so that the constraints defined in 'deps' are not
used. This could lead to failures on stable branches when new packages
are released that break the build. To avoid this, the simplest solution
is to pre-install requirements, i.e. add requirements.txt to 'docs' tox
target.

Change-Id: I241ab2788b870060e1956a8fc029705378a2a8f4
2022-04-28 18:21:39 +02:00
ashrod98
5eadb484de Add release notes command to tox
Added command "tox -e newnote slug-goes-here" to create a new release note.
Fixes error that occurs when reno is not installed globally.
Also changed contributor documentation to include this new command.

Change-Id: I4568163d63e389891e701a424720567d065f70b3
2021-09-27 18:23:46 +00:00
Stephen Finucane
c409caae79 Use tox 3.1.1 fixes
By 3.1.1, tox had fixed:

- [1] which mishandled the basepython directive.
- ignoring PYTHONDONTWRITEBYTECODE [2]

Require this version and remove the workarounds.

See ML thread [3] for some details

[1] https://github.com/tox-dev/tox/issues/477
[2] 336f4f6bd8
[3] http://lists.openstack.org/pipermail/openstack-dev/2018-July/thread.html#132075

Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Change-Id: Idcb204a0dcda92f2bd8cbae37d510d5993c739fe
2021-07-29 10:16:59 +01:00
wu.shiming
9974f047b9 Changed minversion in tox to 3.18.0
The patch bumps min version of tox to 3.18.0 in order to
replace tox's whitelist_externals by allowlist_externals option:
https://github.com/tox-dev/tox/blob/master/docs/changelog.rst#v3180-2020-07-23

Change-Id: I21ea71b539a6ec35670152e427a7ef6d28863e2e
2021-05-31 02:00:58 +00:00
Dina Saparbaeva
0d8f415e86 tox miniversion update to 3.1.1
In 3.1.1, tox had fixed:

mishandling the basepython directive [1]
ignoring PYTHONDONTWRITEBYTECODE [2]
More details in [3]

[1] tox-dev/tox#477
[2] tox-dev/tox@336f4f6
[3] http://lists.openstack.org/pipermail/openstack-dev/2018-July/thread.html#132075

Change-Id: I42930da2333abdc0b081ab238e0e94999ce602b9
2021-02-11 17:18:20 +00:00
wu.shiming
5e8b2a475d Replace deprecated UPPER_CONSTRAINTS_FILE variable
Change-Id: I1237998bfaf258cf645d34ad8b8609aa5f03381c
2020-11-12 09:35:10 +08:00
haixin
cc33a4b23e disable M325
Since we don't support python2.x anymore, we don't
need to use six.text_type.

Change-Id: Id1647b55af476ab4559759a27498ede353dd10ba
2020-10-14 14:05:30 +08:00
wu.shiming
12e9c3586c Remove install unnecessary packages
The docs  requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.

Change-Id: Icba145059588222318ba866d6de8c4ce4df24def
2020-09-14 16:59:01 +08:00
Goutham Pacha Ravi
fba472e3a6 Move hacking checks to tests dir
The test code isn't part of the service.

Corresponding cinder change: I7b18453269cfc57bfbc9bd143d72948e88e60836

Change-Id: I71cc8b3154828f4aeea0afdf3fb59a79b8a8e707
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-07-29 15:17:24 -07:00
Goutham Pacha Ravi
0a499674d5 Drop install_command usage in tox
Use the default value provided by tox:

https://tox.readthedocs.io/en/latest/config.html#conf-install_command

See discussion on the openstack-discuss ML [1]
for the complete context.

To get this fix in, we'll need to raise
a few requirements:

- eventlet because of the ssl issues with python3.6 in
  older packages
  (https://github.com/eventlet/eventlet/issues/371)
- oslo.messaging to fix the error "ACCESS_REFUSED - Login
  was refused using authentication mechanism AMQPLAIN.".
- psycopg2-binary since 2.6.2 is blacklisted
- oslo.service was bumped to 2.1.0, to pick up its support
  for eventlet>=0.22
- oslo.utils was bumped to match the lower constraint from
  oslo.service at 2.1.0

[1] http://lists.openstack.org/pipermail/openstack-discuss/2020-April/014237.html

Change-Id: I6344f44fb955d631a4f0a13fa53ecc19826c7ea6
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-04-23 08:28:50 +00:00
Goutham Pacha Ravi
598223985a Use unittest.mock instead of third party lib
mock was adopted into standard python
in version 3.3 [1]. Since manila no longer
supports python2.7, we can use the inbuilt
mock package rather than the third party
lib.

Fix some issues with imports that weren't
following our import conventions of grouping
imports [3]

Add a hacking test to ensure we don't regress
on this.

[1] https://docs.python.org/3/library/unittest.mock.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2020-March/013281.html
[3] https://docs.openstack.org/hacking/latest/user/hacking.html#imports

Co-Authored-By: Sean McGinnis <sean.mcginnis@gmail.com>
Change-Id: If857a49fbf526983e712282a25d7e8bef5093533
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-04-17 16:24:27 -07:00
Andreas Jaeger
3fdd9983e0 Hacking: Fix W605
Fix:
W605 invalid escape sequence

This is the final change I plan for hacking, the remaining problems
need further investigation by manila team and decision whether and how
to solve them.

Change-Id: I73d73e044eaaf412bf7ace358a3f07c8d269d6cf
2020-04-01 14:38:14 +02:00
Andreas Jaeger
27808af118 Hacking: Fix E731
Fix:
E731 do not assign a lambda expression, use a def

I just marked the lambdas with noqa.

Fix also other problems found by hacking in files changed.

Change-Id: I4e47670f5a96e61fba617e4cb9478958f7089711
2020-04-01 14:11:10 +02:00
Andreas Jaeger
3be50ced7a Hacking: Fix E741
E741 ambiguous variable name 'l'

Also fix other problems found by hacking in files touched.

Change-Id: I8171994716092ae7f12018861e95ed52fee57b18
2020-04-01 13:27:33 +02:00
Andreas Jaeger
8098045f2a Hacking: Fix E305
Fix:
E305 expected 2 blank lines after class or function definition, found 1

Fix also other problems found by hacking in these files.

Change-Id: I880afc40adf974cbb0e60f8dc5931f77d51f451b
2020-04-01 11:43:29 +02:00
Andreas Jaeger
0c6b39d9a2 Hacking: Fix E117
Fix:
E117 over-indented

Fix also other hacking problems found in files touched.

Change-Id: I948bfa4aef8c35f9a94cebec9e93fce8fd5f9ae3
2020-04-01 11:31:13 +02:00
Andreas Jaeger
7022c8dfe8 Hacking: Fix E226
Fix:
E226 missing whitespace around arithmetic operator

Change-Id: I9d0a9a93c635695b4962a88c9bc68dfc4385abe7
2020-04-01 11:25:31 +02:00
Andreas Jaeger
28bb650128 Hacking: Fix E241
Fix:
E241 multiple spaces after ':' (or ',')

Fix also a few other problems found by hacking in files changed.

Change-Id: I4c00551f29ad65df2631c8ae55fe2f022e872544
2020-04-01 09:21:01 +02:00
Andreas Jaeger
8730b1638b Hacking: Fix F601
Fix:
F601 dictionary key 'qos' repeated with different values

Change-Id: Ie957c3ed84f13363ec53a5b26c52002e79d6f5b8
2020-04-01 09:21:01 +02:00
Andreas Jaeger
aac6655997 Hacking: Fix F841
Fix:
F841 local variable 'e' is assigned to but never used

Also, fix other problems found by hacking in these files.

Change-Id: Ib6eaf27c8e6f1414acc9dbde41a35bd412b7161e
2020-04-01 09:21:01 +02:00
Andreas Jaeger
8c1e23c275 Hacking: Fix F632
Fix F632 use ==/!= to compare str, bytes, and int literal

Fix also other problems in the files found by hacking checks.

Change-Id: I5122a9bbccd40d869b54fa3ddf754685aefb8d57
2020-04-01 09:21:01 +02:00
Andreas Jaeger
3ac1870e85 Update hacking for Python3
The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Update local hacking checks for new flake8.

Many tests are failing, so disable all that fail and fix most of them in a
followup.

Change-Id: I34a767406ed9110fc6e0cf5015b88cf1e7f43801
2020-04-01 09:20:58 +02:00
Goutham Pacha Ravi
6f79bb6c89 Fix URLs in code and documentation
TrivialFix

Change-Id: I21863f7fdad2bdd5dee226a3f6872d25b1c4f8ad
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
2020-03-18 18:59:27 -07:00
Andreas Jaeger
0aafb1c46f Cleanup docs building
* Remove doc/source/install/conf.py, it's not used
* Update openstackdocstheme version and remove settings that are now the
  default.
* Use docs dependencies for api-ref building.

Change-Id: If37ed5bdbf6a1ef3107e66073eca9917704edee2
2020-02-23 14:16:10 +01:00
Goutham Pacha Ravi
cb95b6f6f5 [ussuri][goal] Drop python2.7 support
As per the official python support timeline
set forth by the OpenStack TC [1][2], OpenStack
Train (in our case, manila 9.x) is the last
release that will support python2.7.

[1] https://governance.openstack.org/tc/resolutions/20180529-python2-deprecation-timeline.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Change-Id: I5b4dc1853d7e4f8f736dd2a22eb08bcfdeac3411
2019-12-08 19:32:52 -08:00
Thomas Bechtold
b1713e6255 Add PDF documentation build
This commit adds a new tox target to build PDF documentation.
It's a community goal[0] to have PDF docs available.

Also some minor fixes are needed for PDF:
- Only show genindex and search for HTML. Theses elements do not make
sense within PDF documents
- Do not include full config sample files. This will not work and
produces a "Dimension too large" error during the latex run.

[0]
https://governance.openstack.org/tc/goals/selected/train/pdf-doc-generation.html

Change-Id: I66b8c47d599c97e66c2ca76faa66204d5e7c9c3b
2019-08-27 14:40:04 +02:00
Goutham Pacha Ravi
ec55c1a80e Validate API sample JSON files
We are maintaining these files by hand,
so errors are bound to creep in.

Change-Id: I1f5bbf8d5fcd396dfe63b9bf3ef95306c03765a4
2019-08-13 22:16:46 -07:00
Andreas Jaeger
7916986e64 Update api-ref location
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.

Note that the location API location /shared-file-system and not
/shared-file-systems.

Note that redirects will be set up as well but let's point now to the
new location.

For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html

Change-Id: I86f50af83be699fa7e0fb064abb20324e2d87b86
2019-07-22 19:15:50 +02:00
Goutham Pacha Ravi
1709fd7fc2 [CI] Add bindep.txt
Bindep is a tool for checking the presence of binary
packages needed to use an application / library. It
started life as a way to make it easier to set up a
development environment for OpenStack projects.

Infra has been looking to drop the global
bindep_fallback.txt [1][2] file for all
OpenStack projects, they recommend that projects
maintain their own with packages as necessary.

[1] http://lists.openstack.org/pipermail/openstack-infra/2018-April/005926.html
[2] http://lists.openstack.org/pipermail/openstack-discuss/2019-June/006888.html
Change-Id: I1824f132b0ffadc6c9179582d37295f3abed355f
2019-06-24 15:03:51 -07:00
Zuul
a27034c1ac Merge "[Pylint] Bump pylint version to latest" 2019-03-13 04:12:29 +00:00
Goutham Pacha Ravi
4f559d8cc7 TrivialFix: Remove trailing whitespace in tox.ini
Was probably introduced by accident in [1]. Don't
need it anymore.

[1] I890ba4c54b0da10060767620ff5ff7e480d79a9c

Change-Id: Ib6fdb8c1488dde2308d8cc8bb3e79e1280d3e812
2019-03-08 12:19:11 -08:00
Goutham Pacha Ravi
cdf08b69ef [Pylint] Bump pylint version to latest
Older releases of pylint use  an internal API of
the astroid library that causes pylint
exceptions when parsing modules. The errors
are like:

 internal error with sending report for module ['manila/network/neutron/neutron_network_plugin.py']
 'Import' object has no attribute 'infer_name_module'

So let's use the latest version available
that doesn't have this issue.

[1] https://github.com/PyCQA/astroid/issues/649

Change-Id: I6031111e5c72470313642307b4596806cd5408df
2019-03-05 15:30:22 -08:00
Goutham Pacha Ravi
10bd807423 [pylint] Run pylint separately for code and tests
We use the mock library in our
unit tests which assigns mocked objects with
members at run time. This causes pylint to flag
"no-member" errors. We also test return values
on methods which return None explicitly, or
implicitly, this upsets pylint.

pylint is quite inflexible in the way it handles
ignores in code. We can add ignore statements all
over the test code, but that is quite infeasible.

So, this change lets us run pylint separately
for code and test modules. When running tests,
it adjusts the disabled pylint checks.

Change-Id: I85d3fe896ee95c52c3da55aedba8f4d72d0c299e
2019-03-05 21:23:55 +00:00
Zuul
ee91cc96ab Merge "Include .inc files in doc8 linting" 2019-02-21 17:07:24 +00:00
Goutham Pacha Ravi
6a6d813bb3 [pylint] Remove lint tox environment
We don't use the tools/lintstack.py
script anymore since its removal in [1],
so cleanup the unused tox environment and
the gitignore corresponding files.

TrivialFix

[1] https://review.openstack.org/#/c/609791/
Change-Id: Id2d40c1f9f1ce71a22ba9836b90c3e917171a556
2019-02-19 11:04:03 -08:00
whoami-rajat
1e07a3e694 Include .inc files in doc8 linting
This issue was recently seen in cinder when the gate failed
to detect trailing whitespaces in '.inc' files.
As seen, manila was also prone to such issues but thankfully
no error was found in '.inc' after running against doc8.
It still seems important to include it in the testing to avoid
future similar issues.

Change-Id: Ie1fd4ddb4448c05559a31098302f84367fe6ed52
2019-02-19 23:32:08 +05:30
Tom Barron
1838d51925 Fix spurious pylint import errors for ddt and mock
Set dependencies correctly for pylint job in tox.ini so
it does not report spurious E041 import errors on mock
and ddt modules.  Also fix a reference to Cinder instead
of Manila in the pylint script.

Closes-Bug: #1813156
Change-Id: Ib160caae57e41a4d45483ff4faa599143e694abc
2019-01-24 07:38:59 -05:00
Zuul
636d851437 Merge "change tox envlist from 3.5 to 3" 2018-10-17 02:05:40 +00:00
Chuck Short
4d0abb4a14 Simplify running pylint
This commit does several things:

- Setup and run pylint directly rather than running through a script.
  This allows the user to see what is happening while the user is running
  through pylint.
- Allow the user to either run pylint on a particular changeset,
  or the entire manila tree.
- Allow the user to run on a particular changeset. Using like HEAD~1,
  etc.
- I disabled the tests that were reported by pylint.
  The thought here would be go through the failures
  and correct them.
- Update pylint to 2.1.1.

Change-Id: I398d1ba01a3fd7f1c86ad4065a7984d276f33383
Signed-off-by: Chuck Short <chucks@redhat.com>
2018-10-11 15:13:49 -04:00
Nguyen Van Trung
b5db847b26 Don't quote {posargs} in tox.ini
Quotes around {posargs} cause the entire string to be combined into one
arg that gets passed to stestr. This prevents passing multiple args
(e.g. '--concurrency=16 some-regex')

Change-Id: I1088cfbab31befbd24e56add806d6e86fe46e5eb
2018-10-09 10:15:29 +07:00
Tom Barron
e62f1f4f9c change tox envlist from 3.5 to 3
base python version is 3, not 3.5 and
python 3.5 is not installed in some current
distros so running 'tox' locally fails.

Change-Id: Ie2449a433e07f4cafb55fe1db247ba9f854cef97
2018-10-04 14:27:39 +00:00
Tom Barron
772a64a871 Remove run_tests.sh
It is deprecated in favor of tox.

Closes-Bug: #1790470
Change-Id: If3b6a274dab0d035b9666b3b9876604cefbc2877
2018-10-04 09:55:45 -04:00
Zuul
fce517a516 Merge "fix tox python3 overrides" 2018-06-08 18:59:51 +00:00
Sean McGinnis
4c943fbcb2 Default pylint to run using python3
Updates the pylint and lint jobs to run under python3 by
changing the target python and updating the version of
pylint used.

Change-Id: Ie0ac158674fb22054b80864d33d9d7ecc82e3b36
Closes-bug: #1673824
2018-06-06 16:14:22 -05:00
Doug Hellmann
a245fd5f8f fix tox python3 overrides
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: I59ac21cb0d34f0b6767c736d0419eb6b874efca1
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 16:06:01 -04:00