Commit Graph

11 Commits

Author SHA1 Message Date
Brian Haley 542c2ff463 Update hacking version
Update hacking to a more recent version, along with
flake8-import-order.

Remove N347 (import mock library) check as that is the
default with later hacking versions.

Update the builtins override of '_' to be the neutron.i18n
version due to the code triggering a false positive. This
is done in a couple of other projects as well.

Fix a number of new warnings it found.

Added some ignore directives for new whitespace issues
found in the test tree, can fix later.

TrivialFix

Change-Id: I5923255af86cf1fa11ab8e3b03bb9efac7dd7b58
2024-02-08 10:34:10 -05:00
Brian Haley a2a2301675 Remove usage of six.PY2
Neutron is python 3 only so these can be removed.

Another step in removing all of six usage from neutron.

Change-Id: Ica0913e689bb5b472053661b30f951477d3ec960
2020-05-22 12:59:01 -04:00
Brian Haley 90cc4d087f Fix incorrect usage of '# flake8: noqa'
Correct usage is '# noqa' at end of line, otherwise syntax
checking is disabled for the entire file.  Had to fix an
incorrect pylint directive uncovered by the change.

Trivialfix

Change-Id: If210b7c9e9d2c5fc9773c0c6f2dc07cfd52a5a51
2018-10-29 15:27:50 -04:00
Doug Hellmann cf463cce43 tell pylint to ignore python2 version of gettext
pylint compares the function arguments for gettext to what it can see,
and under python3 the signature does not match. This code is already
correctly branching based on python version, so just tell the linter
to ignore the line.

Change-Id: I653fe8bc11804dc20206f6296d89c14568ee4bc1
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-03 08:39:35 +00:00
Akihiro Motoki 44be13a2a6 Hacking rule to check i18n usage
* Detect neutron.i18n import (neutron._i18n is recommended)
* Check builtins _ usage
* 'builtins = _' in tox.ini is no longer required.
* Introduce hacking rule doctest framework.
  Newly added check_builtins_gettext() hacking check takes
  token as argument. It is not a good idea to pass a tokenized
  line manually. Instead it is reasonable to use docstring based
  tests used in hacking repo.

Change-Id: Ib7464658fc4c8a6f1b03af6ab46f0bd3ee0bfb18
2016-03-30 21:28:37 -04:00
Ihar Hrachyshka 51d4d858ac Deprecate _ builtin translation function
This function is discouraged for usage as per oslo.i18n guidelines [1],
so we should deprecate and remove it.

[1] http://docs.openstack.org/developer/oslo.i18n/usage.html

Change-Id: I848ee1dbd16a23c4db42df4690bf139bd769f3e8
Partial-Bug: #1520094
2015-12-06 19:39:20 +09:00
Cyril Roelandt 8db41f04d5 Allow users to run 'tox -epy34'
With this commit, it is possible to successfully run 'tox -epy34', even though
only a small amount of tests will actually be run. This is a required step in
making Neutron compatible with Python 3, as described in the 'Porting to Python
3' specification.

This commit:
- fixes some broken imports, while making sure they still work with Python 3;
- updates a call to gettext.install;
- adds a py34 target in tox.ini.

Change-Id: I91cc7a992d05ea85f7004d1c5a45a1c02cbf1c85
Blueprint: neutron-python3
2015-05-11 16:09:51 +02:00
armando-migliaccio c229b58cf2 Revert "monkey patch stdlib before importing other modules"
The projects that depend on Neutron do not play nicely with this.

This reverts commit 24b11ded7f.

Change-Id: Ic7afd7de9db97cc3a085bc842a2d990519cf42f6
2015-02-11 17:26:33 -08:00
Terry Wilson 24b11ded7f monkey patch stdlib before importing other modules
Some oslo libraries assume that stdlib is already patched when
they are imported (e.g. oslo_concurrency.processutils tests the
'time' module for monkey_patching to detect which 'subprocess'
module to import.

This can cause issues when things like test frameworks import
modules that monkey_patch, as the order imports are made can break
this kind of check. It is always good to monkey patch as soon as
possible, hence trying to do the patching in neutron/__init__.py.

This is an alternative to https://review.openstack.org/#/c/153225/
which just patches neutron/tests/__init__.py. Unfortunately, just
monkey_patching in tests/__init__.py didn't fix all of the issues
I ran into. For example, tempest tests were failing with timeouts.

Closes-bug: #1418541
Change-Id: I7f2115a99acae5b6d61aab2f7334f498b8d99858
2015-02-09 19:49:27 -06:00
liu-sheng b30c47233d Remove the useless vim modelines
Change-Id: I41286e0b8f74c90b7078c3d3fb041b6586d95ab0
Closes-Bug: #1229324
2014-06-21 15:07:31 +08:00
Mark McClain ee3fe4e836 Rename Quantum to Neutron
This change renames everything to Neutron while providing backwards
compatible adjustments for Grizzly configuration files.

implements blueprint: remove-use-of-quantum

Change-Id: Ie7d07ba7c89857e13d4ddc8f0e9b68de020a3d19
2013-07-06 15:02:43 -04:00