43 Commits

Author SHA1 Message Date
Takashi Kajinami
de05ceca5f Run pyupgrade to clean up Python 2 syntaxes
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
2024-10-22 16:44:43 +09:00
Takashi Kajinami
8ab92449ad Remove old excludes
These are detected as errors since the clean up was done[1] in
the requirements repository.

[1] 314734e938f107cbd5ebcc7af4d9167c11347406

Change-Id: I1c29b201dcd3702c09b9b8b6ea15a85d22227366
2024-04-30 18:19:25 +09:00
wangjiaqi07
c13ac8a0cc remove unicode from code
Change-Id: Ib4c9f766b2844d8a3cdc748fbd9ef98b81aec5a5
2022-08-25 09:14:44 +08:00
Zuul
9f4a7d1e26 Merge "Adding pre-commit" 2020-10-05 16:59:20 +00:00
Hervé Beraud
de9b2fc6a1 Adding pre-commit
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>
2020-09-15 13:40:37 +02:00
Evgeni Golov
274eaa6c54 fix supported python versions in documentation
Change-Id: Ia92d5b8f6194d9f7ba2f3221fe378dafe23be567
2020-09-08 09:22:31 +02:00
Doug Hellmann
d5297167e0 switch to importlib.metadata package
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>
2020-07-06 08:39:52 -04:00
Zuul
0c10f5cf21 Merge "Stop to use the __future__ module." 2020-06-03 11:06:55 +00:00
Hervé Beraud
db43e802fb Stop to use the __future__ module.
The __future__ module [1] was used in this context to ensure compatibility
between python 2 and python 3.

We previously dropped the support of python 2.7 [2] and now we only support
python 3 so we don't need to continue to use this module and the imports
listed below.

Imports commonly used and their related PEPs:
- `division` is related to PEP 238 [3]
- `print_function` is related to PEP 3105 [4]
- `unicode_literals` is related to PEP 3112 [5]
- `with_statement` is related to PEP 343 [6]
- `absolute_import` is related to PEP 328 [7]

[1] https://docs.python.org/3/library/__future__.html
[2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html
[3] https://www.python.org/dev/peps/pep-0238
[4] https://www.python.org/dev/peps/pep-3105
[5] https://www.python.org/dev/peps/pep-3112
[6] https://www.python.org/dev/peps/pep-0343
[7] https://www.python.org/dev/peps/pep-0328

Change-Id: I5f8107287877dc5dc4a12c1f85e8671c8d49f56f
2020-06-03 10:34:57 +02:00
Andreas Jaeger
02a28cce85 Switch to newer openstackdocstheme and reno versions
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
2020-06-02 13:52:02 +02:00
Stephen Finucane
1aca4bcbb7 Drop Python 2.7 support
Change-Id: I7ae34cb701111adb2968e9b0c153dfd60aeb2fbb
Signed-off-by: Stephen Finucane <stephenfin@redhat.com>
Sem-Ver: api-break
2020-04-21 15:14:10 +01:00
pengyuesheng
22d92824d2 Blacklist sphinx 2.1.0 (autodoc bug)
See https://github.com/sphinx-doc/sphinx/issues/6440 for upstream details

Change-Id: I0573019ba9e98d31ccb43179590a970c9b7647af
2019-10-10 15:05:44 +08:00
Hervé Beraud
74cc8cfe13 Cap Bandit below 1.6.0 and update Sphinx requirement
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
2019-05-16 16:30:18 +02:00
liuwei
b13d7fe599 update git.openstack.org to opendev
Change-Id: Ie3617d76b6131386c2fa241b41888436ed44909f
2019-04-25 01:07:11 +00:00
zhang.lei
ec53c7607a Update doc/conf.py to avoid warnings with sphinx 1.8
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
2018-09-18 10:46:09 +00:00
Doug Hellmann
236297973f 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.

Decode subprocess output so it has the right type under python 3.

Change-Id: Id2df5439fa6e788199bec4ac7c98c56347053621
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-06 16:17:02 -04:00
XiaojueGuan
f641e9aeaa Trivial: Update pypi url to new url
Change-Id: Ie738ac6938b035c414c0c8d964b771c5155ed115
2018-05-01 15:53:28 +00:00
malei
68a9a4f885 Trivial: Update pypi url to new url
Pypi url changed from [1] to [2]

[1] https://pypi.python.org/pypi/<package>
[2] https://pypi.org/project/<package>

Change-Id: Ifc9114fd4b4d95f2ae0acd7e0a19d217786b1168
2018-04-21 09:21:32 +08:00
OpenStack Proposal Bot
d42d448b53 Updated from global requirements
Change-Id: If0cae1d2b4c59ff6c1f2675db18fc658bbc739bf
2018-03-15 09:34:12 +00:00
OpenStack Proposal Bot
e65e1196c6 Updated from global requirements
Change-Id: I0feec969be2ffbcbfea70b0961891ef0100bebd1
2018-01-24 01:36:41 +00:00
OpenStack Proposal Bot
8a9bceec4b Updated from global requirements
Change-Id: Iedc3cb48a788dfed98c00e07d57b08c2e1556360
2018-01-18 03:35:02 +00:00
OpenStack Proposal Bot
2472e8c9c2 Updated from global requirements
Change-Id: I9d03283bd9056a213267682a35f148b44d6d9bce
2017-12-03 21:57:09 +00:00
Doug Hellmann
3ffdb1f0ba move doc requirements to doc/requirements.txt
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>
2017-11-30 17:46:59 -05:00
Thomas Bechtold
f9503f1a30 Make openstackdocstheme an optional doc dependency
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
2017-08-23 08:31:27 +02:00
Doug Hellmann
7357e8aef0 switch from oslosphinx to openstackdocstheme
Change-Id: I1416bd7e05901dc22f0915af32808ff41ffbb2d0
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-28 13:09:04 -04:00
Doug Hellmann
e758e51871 move documentation into the new standard layout
Change-Id: Id5ae008eab8e52d8943659b809ed1bcd996e0794
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2017-06-28 13:05:57 -04:00
Thomas Bechtold
f59040ce44 Remove unused doc/requirements.txt
The requirements for documentation are already captured in
requirements.txt .

Change-Id: I1039caa84a18b4cfcf3749a1bb891bf793ce7a8c
2017-05-29 15:09:41 +02:00
Marianne Linhares
555bc47931 Broken link at stevedore developer documentation
At http://docs.openstack.org/developer/stevedore/
the link about "setuptools entry points" is broken.

Change-Id: I7cfd5af64e83b75f83c6ac0d48bfff2eac3c7435
Closes-bug: #1647151
2016-12-04 12:00:16 -03:00
Andreas Jaeger
0888d13a33 Remove reference to non-existing page
There is no modindex page generated, remove reference to it.

Change-Id: I2707c653ab4c7ab6b13478c5c0da35b82f0b5f65
2016-10-29 13:41:06 +02:00
ChangBo Guo(gcb)
da83cd831d Remove irrelated output item
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
2016-07-04 03:04:49 +00:00
Bernhard M. Wiedemann
52dfe21ade dont claim copyright for future years
otherwise, when building from unchanged source in 2018,
it would claim Copyright 2018, Dreamhost
which is not true

Change-Id: I5185828a965467ea04033e46a1af2435df4ad760
2016-03-09 11:42:25 +01:00
Marc Koderer
8a19d5fb7b Add a reference to entry_point_inspector
This add a short reference in the install guide
to the entry_point_inspector.

Change-Id: I86f3437949670e75f631319e088321384fe28e42
2016-02-23 14:32:39 +01:00
ChangBo Guo(gcb)
bb73a14d24 Clean up Python 2.6 related stuff
Change-Id: I303465277b30dff66129b6c65112b3e427ee6292
2015-11-26 18:09:38 +08:00
Jenkins
5c28a12b30 Merge "replace the hard-coded history list with an auto-generated one" 2015-09-25 10:48:20 +00:00
Doug Hellmann
d1d63f75b0 Add clarifying language to description of scanning for plugins
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
2015-09-24 21:12:38 +00:00
Doug Hellmann
e327c8226f Show how to add a plugin in a separate package
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
2015-09-24 19:30:48 +00:00
Doug Hellmann
9d9b4d4210 replace the hard-coded history list with an auto-generated one
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
2015-09-24 18:34:11 +00:00
Zhao Lei
02c9e7e144 Fix spelling typo for maunal
occuring -> occurring
for patterns_loading.rst

Plus some source comment spelling fix.

Change-Id: Ia6c79588e70a4150fdcb8e71d14a4bba47a70a23
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
2015-09-24 13:47:30 +00:00
Thomas Goirand
6ddec6e4c8 Removed non-free color profile from .jpg
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
2015-05-31 18:49:36 +02:00
Jenkins
c43bf3b010 Merge "Add sphinx integration" 2015-05-28 01:54:56 +00:00
Doug Hellmann
7295f785f0 Add sphinx integration
Add a restructuredtext directive for documenting a set of plugins with
the needed hooks to make it available is sphinx.

Change-Id: I1a24f9326b4e54174d9dc0ae366315fe29c3ac1b
2015-05-27 23:36:04 +00:00
Davanum Srinivas
2ef21b3210 Fix Python versions supported
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
2015-05-13 11:39:43 -04:00
Doug Hellmann
a322d615db Bring doc build up to standard
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
2014-10-27 08:37:49 -04:00