Commit Graph

59 Commits

Author SHA1 Message Date
Zuul e1150ab84a Merge "Use py3 as the default runtime for tox" 2021-01-21 14:57:40 +00:00
Hervé Beraud 3c9dac5186 Use TOX_CONSTRAINTS_FILE
UPPER_CONSTRAINTS_FILE is old name and deprecated
This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://review.opendev.org/#/c/722814/
[2] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file

Change-Id: I9a48a44a1cc32c3ab9393b97ea9014dc95cfd4de
2020-11-04 10:54:10 +01:00
Hervé Beraud 31c0b1901c Use py3 as the default runtime for tox
Moving on py3 as the default runtime for tox to avoid to update this at
each new cycle.

Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: I07c86686aa5bdd8658616c901cba262e4394bb12
2020-11-04 10:07:49 +01:00
Hervé Beraud e33745b74c Use Python 3.8 as the default runtime for tox
Wallaby support officially the following runtimes [1]:
- Python 3.6
- Python 3.8

During Victoria Python 3.7 was used as the default runtime [2] however this
version isn't longer officially supported.

Moving on the most recent officially supported runtime as the default runtime
for tox.

[1] https://governance.openstack.org/tc/reference/runtimes/wallaby.html#python-runtimes-for-wallaby
[2] https://governance.openstack.org/tc/reference/runtimes/victoria.html#python-runtimes-for-victoria

Change-Id: I93b58f133efe115cc954932ebca887d52f9edfac
2020-11-03 14:33:07 +01:00
Hervé Beraud fbe3f2fe7c 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: I7ac1599e903577e28fb64bb07a6b984e1ff8a023
Signed-off-by: Moisés Guimarães de Medeiros <moguimar@redhat.com>
2020-09-15 15:05:13 +02:00
pengyuesheng dc37b3569b Drop python 2.7 support and testing
Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Co-Authored-By: Andreas Jaeger <aj@suse.com>
Change-Id: I32d5dc317b821dee4a625506f227a8f5bfaaecfc
2020-01-27 17:03:20 +01:00
gujin 70cef7f849 tox: Keeping going with docs
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name
suggests, keeps the build running when it encounters non-fatal errors.
This is exceptionally useful in avoiding a continuous edit-build loop
when undertaking large doc reworks where multiple errors may be
introduced.

[1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045

Change-Id: Ief136815d6a0e1dfa0b8d1ffb42500fef38e39fe
2019-11-01 14:54:19 +08:00
pengyuesheng 9fa71c6477 Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I760aa2e27a4272852e7498cc6e0475d58d08e2f6
2019-09-25 14:18:19 +08:00
Andreas Jaeger 06d7ac27b7 Update docs building
Use sphinx-build and cleanup unused config.
Switch to openstackdocstheme 1.20.0 and remove obsolete settings from
conf.py files.

Update some RST files, they had wrong indentation.

Change-Id: Iaad2841db809f8a343fb8b1031cf8d0587d70442
2019-08-11 09:48:06 +02:00
Corey Bryant 9d59e2087e Add Python 3 Train unit tests
This is a mechanically generated patch to ensure unit testing is in place
for all of the Tested Runtimes for Train.

See the Train python3-updates goal document for details:
https://governance.openstack.org/tc/goals/train/python3-updates.html

Change-Id: I8c3460f3f0b7759a6fa1f05424a8a499c0cd9957
Story: #2005924
Task: #34205
2019-06-24 09:13:29 -04:00
Andreas Jaeger 74429f77c3 Drop py35 testing
All the integration testing has been moved to Bionic now[1] and py3.5
is not tested runtime for Train or stable/stein[2].

As per below ML thread, we are good to drop the py35 testing now:
  http://lists.openstack.org/pipermail/openstack-discuss/2019-April/005097.html

[1] http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004647.html
[2] https://governance.openstack.org/tc/reference/runtimes/stein.html
    https://governance.openstack.org/tc/reference/runtimes/train.html

Change-Id: I0aa0fd95fd882ab0989eed81d535b963c821c162
2019-04-28 16:56:03 +02:00
jacky06 ffa50302f2 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I1fa55fdb52f2a74e01c28268dd3973e3151ef7e3
Closes-Bug: #1825923
2019-04-23 03:16:36 +00:00
Sean McGinnis 074a84df78 Remove setup.py check from pep8 job
Using "python setup.py check -r -s" method of checking the package has
been deprecated with the new recommendation to build the sdist and
wheel, then running "twine check" against the output.

Luckily, there is already a job that covers this that only runs when the
README, setup.py, or setup.cfg files change, making running this in the
pep8 job redundant. This covered by the test-release-openstack-python3
that is defined in the publish-to-pypi-python3 template.

More details can be found in this mailing list post:

http://lists.openstack.org/pipermail/openstack-dev/2018-October/136136.html

Change-Id: I359d557dbf3438d219bed0303b7a95ad93192f46
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2018-10-30 10:37:24 -05:00
Zuul dbc5eb6e6f Merge "Switch to stestr" 2018-07-24 11:38:10 +00:00
Vu Cong Tuan 500911422f Switch to stestr
According to Openstack summit session [1],
stestr is maintained project to which all Openstack projects should migrate.
Let's switch to stestr as other projects have already moved to it.

[1] https://etherpad.openstack.org/p/YVR-python-pti

Change-Id: Ibbad6f4e63efbef4e2e144f3ba4218ce6579371a
2018-07-11 13:10:05 +07:00
Nguyen Hung Phuong 1298e765d1 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: I483632acf5a68075bbf200ffb172f945e5294cf8
2018-07-09 13:41:19 +07:00
Andreas Jaeger 3fdd0539f5 Check RST as part of linting
Check our RST files so that uploading to PyPI works fine with a linter
check.

Change-Id: I41cb71409ea5cb7d1e6d8b546a37633ee481a38d
2018-06-06 16:14:05 +02:00
Doug Hellmann 3e766d6c0a add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

Create a lower-constraints.txt to be used to enforce the lower bounds
in those tests.

Add openstack-tox-lower-constraints job to the zuul configuration.

Add missing dev packages for libxml and libxslt to the bindep config
file.

See http://lists.openstack.org/pipermail/openstack-dev/2018-March/128352.html
for more details.

Change-Id: I4a51633916661bdfa926eb231b8e482628887e90
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-03-25 09:16:50 -04:00
Andreas Jaeger 3818d4341b Avoid tox_install.sh for constraints support
Follow https://review.openstack.org/#/c/508061 to remove
tools/tox_install.sh, we can build without it.

Change-Id: Ia27fb4f8a4da8d5ae2755b54c3274402362ae521
2017-12-02 17:08:01 +00:00
Stephen Finucane bfdac72804 Remove pylint
This is throwing errors when run which means no one is paying the
slightest bit of attention to it. Just remove the damn thing.

Change-Id: Ia262112f4366a64094a35abc041e542b4513727e
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2017-10-04 11:51:03 +01:00
Stephen Finucane ca9ff17d27 Remove "cleanup" tools
There were a couple of scripts here:

- prettify.py
- remove_trailing_whitespaces.sh
- remove_unnecessary_spaces.py
- retf

Most of them are self-explanatory with the exception of 'retf', which I
don't understand but which looks untouched in years and therefore
useless. For the other three, we have tooling in place to ensure these
"issues" don't get into source control and, even if they did, there's
questionable value in rewriting stuff just to remove excess whitespace.
Kill them all.

Change-Id: Ifbd2d50a669251484056552da21d23906f8d6178
2017-10-04 11:48:00 +01:00
Stephen Finucane d3c952064a Remove 'autogenerate_config_docs'
This tool has been superseded by the 'oslo_config.sphinxext' Sphinx
extension and can finally be put to rest.

[1] https://docs.openstack.org/oslo.config/latest/reference/sphinxext.html

Change-Id: Idae5ba656c3a0da8a26c6f1e63332365c8012c0b
2017-10-04 11:47:56 +01:00
Andreas Jaeger 14623e787b Add bindep.txt
Add bindep.txt file with packages needed to use the repository.

Change-Id: I409d33c60a2be1886918b7e1ed8e4c6f3ca346c2
2017-05-25 17:32:40 +02:00
Andreas Jaeger ea1ae95b63 Update docs theme configuration
Enable log-a-bug feature and add information on when document was built.

Disable pep8 check for doc/source/conf.py.

Change-Id: Ia86791ac69845572b2fbc536732afcf901bcf203
2017-04-30 09:30:39 +02:00
Brian Moss d3bc42483a Update sitemap tests
- add py3 to tox.ini (gate already tests py3)
- move all tests to $GITROOT/test so they can all run
  through testr
- add scrapy to test-requirements.txt to support sitemap tests
- move tests from test_items.py to test_sitemap_file.py
- fix broken sitemap tests
- add newton to list of old releases in sitemap_file.py
- ignore flake8 H101 as it returns false positives for Sphinx conf.py
- Use openstackdocstheme for docs
- Update sitemap README
- Restructure repo docs
- fix minor style issues

Change-Id: I22c018149b2eefde6ca5c38c22ac06886fe9a7a8
2017-04-29 10:36:27 +10:00
xhzhf 5e51e21fa9 H803 have been deprecated
H803 hacking have been removed.
https://github.com/openstack-dev/hacking/blob/master/setup.cfg
Closes-Bug: #1650734

Change-Id: I40277c75785660893f44ff327e25819da5169881
2016-12-17 19:21:48 +08:00
Dirk Mueller d4aad532a8 Add Constraints support
Adding constraints support to libraries is slightly more complex than
services as the libraries themselves are listed in upper-constraints.txt
which leads to errors that you can't install a specific version and a
constrained version.

This change adds constraints support by also adding a helper script to
edit the constraints to remove openstack-doc-tools.

Change-Id: I3b7f2f7a18325a9cb0e461e9bac2648c0c27bf4c
2016-12-13 23:05:47 +01:00
Luong Anh Tuan 67691c3cfc Don't include openstack/common in flake8 exclude list
There is no this directory openstack/common which was used to keep codes from
oslo-incubator, we have retired oslo-incubator. Removing openstack/commonfrom
all OpenStack code in favor of the Oslo libraries is a project wide goal
for the Ocata release. So don't use this directory any more. We should drop it
for improving searching efficiency.

Change-Id: If2ca9333319fd78a53c73ab313411ed2f17b07f2
2016-10-31 11:20:21 +07:00
KATO Tomoyuki 03a561883c Update flake8 ignore list
In hacking > 0.10.0, there is no E123 and E125, so this commit to
delete them.

Change-Id: I66f53f46337d4206a269f2e09822bf31d8433edf
2016-09-30 20:32:46 +09:00
Percila c050836a8f doc-tools unit tests
Renamed sitemap file to avoid module name conflict
when importing at the sitemap unittest

Added py.test tox environment

Change-Id: I94480e374b29802414b62591a51c04ecd804905e
Closes-Bug: #1387716
2016-08-03 07:05:51 +00:00
Christian Berendt 4396ade948 Add docs environment
Change-Id: I93deef31ab30b1ce46c35f9c39242adfc4a3ae83
2016-04-29 23:30:43 -05:00
Andreas Jaeger 92944e11b3 Remove markdown script
The image-api and identity-api repositories are retired, remove
support for building it. This also includes removing the now
obsolete markdown script and the obsolete pandoc-template.docbook.

Change-Id: I619244c755b9f85102743196c8ec5fcc09dc76a6
2016-02-25 08:14:50 +01:00
Andreas Jaeger 561228ae5d Use pep8 instead of linters
According to the PTI (=Python Test Interface,
http://governance.openstack.org/reference/cti/python_cti.html), pep8
is the interface for codestyle checks. Move all tests from linters to
pep8.

Change-Id: Iaed26949d4a63d82bb26696ab10a11fff0a91a18
2016-02-11 17:18:29 +01:00
venkatamahesh 30afce8fe5 Fix two word spellings
Change-Id: I7e641ec6419607b7b473b5fdc4a4e9a4a9203a0d
2016-01-24 21:16:36 +05:30
Andreas Jaeger 49e3299077 Rename pep8 to linters test
The pep8 tests does more than calling pep8, rename it to use the new
linters standard job for all lint like jobs.

Change-Id: I027795072ce6fef13026099c3834a0d33ca7f7f7
Depends-On: I7cf4766642dc3e7d7652e6d26ab2f14f9fcd7861
2016-01-20 21:37:01 +01:00
Jenkins 4925655305 Merge "tox: remove the pypy env" 2016-01-09 08:23:45 +00:00
Gauvain Pocentek 50c4f5e60c tox: remove the pypy env
Change-Id: Ibe1b496dc1d77deafe338e7f5501bc6795505172
2016-01-08 16:03:30 +01:00
Gauvain Pocentek c093aac208 autohelp: remove old files
The flow graph and the tests have not been updated in a long time and
don't match the current state of the autohelp* scripts. Remove them as
they are not used and not accurate.

Change-Id: I6225ac8cfc53564c75fa227d08d2ef6adc661390
2016-01-08 14:37:38 +01:00
janonymous 8af65b5266 py33 is no longer supported by Infra's CI
Python 3.3 support would be dropped by
Infra team from mitaka,CI would no longer be testing it,
so projects should drop it also.

Change-Id: Icddae8a0e1968766e8dcc9abf2de78fdd0791f4b
2015-12-26 14:19:27 +05:30
Janonymous d1381c57df Put py34 first in the env order of tox
To solve the problem of "db type could
not be determined" on py34 we have to run first the py34 env to, then, run
py27. This patch puts py34 first on the tox.ini list of envs to avoid this
problem to happen.

Change-Id: I966264e04fbe9441d90c48645df5e6216ca0f4d5
Closes-bug: #1489059
2015-12-22 18:37:18 +05:30
Andreas Jaeger 57c8e9aa3e Add -W to sphinx invocation for release-notes build
Let's not ignore warnings.

Change-Id: Ia3851cf1c9f8495614758e6d46c3041ac2d575bb
2015-11-25 19:47:23 +01:00
Andreas Jaeger 4c77a32ada Add reno for release-notes
Add renote to automatically generate release notes - the same way other
OpenStack projects do it.
For details see
http://lists.openstack.org/pipermail/openstack-dev/2015-November/078301.html

Change-Id: I9789c5e21d8594593fc5536562a01644c6d63eef
2015-11-07 17:10:06 +01:00
Christian Berendt b8161e3aff Removed a virtual build and test environment based on Vagrant.
The virtual build and test environment based on Vagrant is out of date.

Change-Id: I8c855f9a92894d1c160a2bc8461a2883eb4950a9
2015-10-30 04:11:57 +01:00
Jenkins c604a8c42a Merge "Stop specifying requirements.txt in tox.ini" 2015-07-20 16:51:04 +00:00
Andreas Jaeger bb3d68fba8 Drop python 2.6 workaround
Remove check_output that is in python 2.7 and newer but not in
python 2.6. Thus, we do not support python 2.6 anymore.

Change-Id: Ie953ce43d792b95e348a55fea4665b1ef59b468d
2015-07-19 09:30:55 +02:00
Andreas Jaeger ee644a5111 Stop specifying requirements.txt in tox.ini
As PBR already injects the contents of requirements.txt into
setup_requires, there is no need for tox to explicitly install them.

http://lists.openstack.org/pipermail/openstack-dev/2015-July/069663.html

Change-Id: I1d9dd87cb1eb08c8a2bcb9cf0d79d90317b079d6
2015-07-16 19:50:51 +02:00
Andreas Jaeger 3fd52a5a0b Cap maximal cyclomatic complexity
flake8 has support for cyclomatic complexity (Mccabe) currently our
worst offender has a complexity of 28. So
set our max-complexity to 29 so that don't make things any worse.

https://github.com/flintwork/mccabe

Change-Id: Ib6db9de92b3e6e196008580318a2139976610349
2014-10-20 14:53:21 +02:00
Jeremy Stanley 20d339ef52 Work toward Python 3.4 support and testing
Change-Id: I73c1ffec2fa446ab88cf68d3b8979d8d8dd917cc
2014-09-03 19:04:19 +00:00
Andreas Jaeger 94849df097 Fix issues found by bashate and include in gating
Cleanup shell scripts to pass bashate testing.
Add bashate check to pep8 check target.

Change-Id: I49b9ab1e352378a43f82a4e1f5db02a8dae99d27
2014-08-17 15:17:30 +02:00
Andreas Jaeger 175e79ebf7 Run doc8 as part of pep8 test
Fix all issues found and enable doc8 run.

Change-Id: I1b3fc9ac3db5e2d1dfa138b026e26835ead4d7fb
2014-08-17 06:51:54 +02:00