Update all .py source files by
$ pyupgrade --py3-only $(git ls-files | grep ".py$")
to modernize the code according to Python 3 syntaxes.
pep8 errors are fixed by manual adjustments.
Also add the pyupgrade hook to pre-commit to avoid merging additional
Python 2 syntaxes.
Change-Id: I14cd7c88346bdfb5d4b2afe2b4a71f84833f3688
These are detected as errors since the clean up was done[1] in
the requirements repository.
[1] 314734e938f107cbd5ebcc7af4d9167c11347406
Change-Id: I1c29b201dcd3702c09b9b8b6ea15a85d22227366
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: I045fa1cd7932d960e1cf49b2c335c7acdeba0b46
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
Load entry points using 'importlib.metadata' instead of 'pkg_resources'.
Include a caching layer. The cache stores the parsed text data from all
of the ini input files in a single JSON file with a name based on the
hash of the path entries and the mtimes. This should produce a unique
filename for each import path, regardless of the use of a virtualenv.
The data is stored in a format that means no other files need to be
examined or parsed in order to return EntryPoint objects.
Change-Id: I8b08f289d446f4775eac1e1a91997fa96f25f641
Depends-On: Ic6db7af34c87a636bfe55bacae03c42154f4b9c7
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Switch to openstackdocstheme 2.2.1 and reno 3.1.0 versions. Using
these versions will allow especially:
* Linking from HTML to PDF document
* Allow parallel building of documents
* Fix some rendering problems
Update Sphinx version as well.
Disable openstackdocs_auto_name to use 'project' variable as name.
Change pygments_style to 'native' since old theme version always used
'native' and the theme now respects the setting and using 'sphinx' can
lead to some strange rendering.
openstackdocstheme renames some variables, so follow the renames
before the next release removes them. A couple of variables are also
not needed anymore, remove them.
See also
http://lists.openstack.org/pipermail/openstack-discuss/2020-May/014971.html
Change-Id: Ie53af423c56f3355e7e911e6f2efd6c73c6d57c5
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
marking it there as well.
Change-Id: Ieaf9c77d62551352833a644ab22dff261c08bb78
The autodoc_default_flags option is now deprecated.[1] This warning can
cause documentation build failed. use autodoc_default_options instead.
[1]https://github.com/matplotlib/matplotlib/pull/11928
Change-Id: I73041da072edb635661503b75a9c7460e1242220
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.
Decode subprocess output so it has the right type under python 3.
Change-Id: Id2df5439fa6e788199bec4ac7c98c56347053621
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
The documentation jobs now look for requirements in
doc/requirements.txt and do not use tox for release notes. Move the
dependency list from setup.cfg to the new file and update tox.ini so
the developer experience is consistent with what the CI system does.
Change-Id: I739c9eba21d1b9a680d6b0e9cc6a4cbaca56e543
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
stevedore is a library that is used outside of OpenStack, too. Having
a build requirement that needs something OpenStack specific makes
life in cases (eg. for downstream packagers) more difficult.
So let's make openstackdocstheme an optional requirement.
Change-Id: Ic8cc577e617e5da699f9dc43830183005bd2ee66
We register two entry points in sample code, but show three items
in entry_points.txt, just remove it to keep consistent with code.
Change-Id: I7a76c4f23086fe1abdbf7140ba92f97ec1387aed
otherwise, when building from unchanged source in 2018,
it would claim Copyright 2018, Dreamhost
which is not true
Change-Id: I5185828a965467ea04033e46a1af2435df4ad760
Clarify that the python import path is scanned to find packages and
their metadata is examined, so that it is clear that the packages must
be installed in a way that makes them both visible to the same python
interpreter.
Change-Id: I0fc58b3ccc024e209d7f49de7402de67d4437295
One of the most common misconceptions about plugins is that they must be
installed to the same python package as the application. Update the
documentation to provide an explicit example of providing plugins from a
separate package.
Also clean up the package metadata for the existing example to remove
references to URLs and email addresses that no longer work.
Change-Id: I801b6ec3ff287c5342ce63a865167f55d31c78d3
Closes-Bug: #1394393
Replace the hand curated list of changes with the one generated by pbr
automatically.
At the same time, change the toctree settings in index.rst to avoid
showing every release of stevedore at the top level and to clean up the
amount of nesting showing for other entries.
Change-Id: I3fb9306c0ca3ce6ed9681ffeaa8b9b8ed0f2bd7c
occuring -> occurring
for patterns_loading.rst
Plus some source comment spelling fix.
Change-Id: Ia6c79588e70a4150fdcb8e71d14a4bba47a70a23
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
All the .jpg files in doc/source/essays had this embedded:
"Copyright 2007 Apple Inc., all rights reserved."
This is an ICC color profile which is copyrighted by Apple
and which is non-free, and may trigger some warnings/errors
by the distribution linters.
This patch converts the .jpg into the sRGB color space. I
did this simply loading the images in GIMP, and exporting
again after accepting the auto-coversion to sRGB.
Change-Id: Ibfdf0828ff149d5c83eb864c4fb854e80868a613
Add a restructuredtext directive for documenting a set of plugins with
the needed hooks to make it available is sphinx.
Change-Id: I1a24f9326b4e54174d9dc0ae366315fe29c3ac1b
We have CI for 2.6, 2.7, 3.4. So make sure
all references to other versions are removed and
all 3 versions above are correctly mentioned where
required.
Make sure we specify 3.4 everywhere needed
Change-Id: I2c90bccfc7495bf8197319196a12b2a8bd0519f1
Move the requirements definitions and documentation files to the
standard places used by other OpenStack projects so our doc publishing
jobs will work.
Change-Id: Iea630d827976fe517afacf4e373b3a125efff9c9