24 Commits

Author SHA1 Message Date
Tony Breeds
edfebf3dcc Update package metadata and tox4 setup
The current tox setup results in an 'editable-wheel' install which,
while it works, generates unhelpful warnings.  Switch to the 'editable'
type which is what you got under tox <= 4.

While we are reducing noise in the logs, correctly setup
openstack_elections.templates as a module.  We need it as a module as
we rely on Jinja2 to be able to use the module loader to locate the
templates.

Change-Id: Icbdca2f72c0777c587d6f95b3fab1911be179f97
2023-02-22 03:37:10 +00:00
Ghanshyam Mann
fac3d836bc Fix tox4 error
tox.ini started failing with Tox4 which had some
incompatible changes. One of the reason for failure
is due to the skipsdist = True with usedevelop and it
seems it was never supported.

Change-Id: If70b1a8b17bd925b04b35366ff80fd5dacf19c3c
2023-01-30 16:40:10 -06:00
maaoyu
761ddc7fe7 bump py35,py37 to py3 in tox.ini
In 'victoria' cycle, we should test py38 by default.
But we let local development tests run with whatever the default
local py3 is the default.

ref:
  https://governance.openstack.org/tc/reference/runtimes/victoria.html

Change-Id: Iaf309da4683fe69b2bb7d1691e0fe498920d7db2
2020-10-13 09:09:21 +08:00
wu.shiming
66c1f21db2 Remove install unnecessary packages
The docs  requirements migrated to doc/requirements.txt
we need not install things from requirements.txt.

Change-Id: I7990b24861546bcc54f3286e57e22b8acd270382
2020-09-15 09:45:09 +08:00
Andreas Jaeger
546b046800 Switch to newer openstackdocstheme version
Switch to openstackdocstheme 2.2.1 version. Using
this version 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_version to not auto-version the documents.

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

Remove python 2.7 stanza from setup.py, cleanup tox.ini for python3,
update hacking version and fix problem found.

Change-Id: Ic0721e60f6583abb52bb665fbf113c8017318e2c
2020-06-10 16:59:45 +02:00
Sean McGinnis
eb4fcd7bf0 Use doc-only requirements
Doc requirements are not needed for unit test runs. This moves doc
requirements into the recommended doc/requirements.txt location and
updates the tox target to pull from there.

Change-Id: I06761a6090d64ae1be5065727f7f56ede14c8d13
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2020-03-26 10:16:58 -05:00
Jeremy Stanley
c24fab9d73 Include a -v/--verbose option for check commands
So as to increase transparency of the candidate verification checks,
add a --verbose option to all of the various candidate checking
command scripts. Supplying it once returns check result URLs for
clarity, while adding it twice also displays the query URLs used.

Set double verbosity for the check review tox testenv, to aid
election officials in reviewing nominees for valid candidacy.

Also update the Gerrit and Git URLs for the OpenDev transition and
correct a couple of docstrings for utility functions.

Change-Id: I5f6fa4e2c2c6058ba5090078bbdf9dd9f31f692e
2019-10-11 13:38:07 +00:00
Tony Breeds
03332aa4b0 Update tox.ini for correct py3 support and remove py2
When running 'tox' on a system where 'python3' is any version of python
other that 3.5 tox will complain that the py35 testenv isn't py35 ...
for example:

 [tony@thor election]$ tox -r
 /usr/lib/python3.7/site-packages/tox/config.py:570: UserWarning: conflicting basepython version (set 37, should be 35) for env 'py35';resolve conflict or set ignore_basepython_conflict proposed_version, implied_version, testenv_config.envname
 /usr/lib/python3.7/site-packages/tox/config.py:570: UserWarning: conflicting basepython version (set 37, should be 27) for env 'py27';resolve conflict or set ignore_basepython_conflict proposed_version, implied_version, testenv_config.envname
 docs recreate: /home/tony/tmp/election/.tox/docs
 <snip>
 ________________________________________________ summary _________________________________________________
   docs: commands succeeded
   linters: commands succeeded
   py35: commands succeeded
   py27: commands succeeded
   congratulations :)
 [tony@thor election]$ for py in .tox/py*/bin/python ; do $py --version ; done
 Python 3.7.3
 Python 3.7.3

As you can see the py35 and py27 interpreters are both in fact py37.
Update tox.ini to that we can enforce python3 but still test on py35 and
py37.  While ther update the default envlist to remove py27 as that will
always fail since I20184300f0a6cb6d230428cafc49f1b917376380 merged.

As we're using ignore_basepython_conflict we need to set the tox
minvcersion to 3.1.0 as that's the earliest version with that support

Change-Id: Ia23682a285f6ee539dbeb9e1eb790cad8575da25
2019-05-28 13:52:15 +10:00
Tony Breeds
24c37f1010 Make all tools require python3 and remove python2 testing
Now that the last tool that needed python2 has been checked/fixed lets
remove all the python2 infrastructure and make all library users exit if
run under python2

Change-Id: I20184300f0a6cb6d230428cafc49f1b917376380
2018-12-12 14:09:05 +11:00
Tony Breeds
60fb423adf Add a tox environment for flexible candidate checking
By default ci_check_all_candidate_files.py, does as it implies and
checks all candidates for the current election.

Add new operation modes for:
 1. Checking all files for the current git commit '--HEAD'
 2. Checking all files specified on the command line

We also add a voting job on the check pipeline only for validating
the current review.  Local users are encouraged to use this as:

 tox -e ci-checks-review ; or
 tox -e ci-checks-review -- path/to/file

Change-Id: I0c82c59409bb58169840de42c02072aeae182b2b
Co-authored-by: Doug Hellmann <doug@doughellmann.com>
2018-12-12 14:09:05 +11:00
Doug Hellmann
dd4e893b33 run sphinx in verbose mode and treat warnings as errors
Change-Id: I7bc390b893a6db91ed7006f65073887542da0593
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-11-06 09:29:15 -05:00
Andreas Jaeger
79cc6c1db5 Switch to "tox -e docs"
Use the new PTI docs building commands, these use "tox -e docs" for
building, also update the publishing job.

Update tox.ini to use sphinx-build directly as documented in the PTI.

Note that we have to disable warnings, otherwise building fails with:
doc/source/results/ocata/ptl.rst:3:Duplicate explicit target name: "tony breeds (tonyb)".
Be aware that with current pbr and Sphinx, warnings are disabled due to
change of parameter names - so, this keeps the status quo.

Depends-On: https://review.openstack.org/615501
Needed-By: https://review.openstack.org/615637
Change-Id: I4713f3a25e08056b7bce9812fa2cf62119330fcc
2018-11-05 21:50:23 +01:00
Tony Breeds
e6ed0b1ef2 Python3 by default
Set all the tox environments to be python3 *except* venv2.
Set the trove data mostly because we can.

Change-Id: Ib65e84c7da16683f70657a3bc8e9b9ccdb8f1c8a
2018-09-05 10:08:05 +10:00
Tony Breeds
113a5eae30 Add non-voting job to check all candidates
I suggest we leave this as non-voting for this PTL election manually
verify the results.  Once we're confident we can upgrade it to voting.

Change-Id: I01ad9c76ab68e8282acb4bcc66a2eb7c57596171
2018-07-27 14:21:51 +10:00
Vu Cong Tuan
94fbee1ec8 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: I255684ebe0c2d59c4141eeec12ac346bfcf477b2
2018-07-05 13:31:26 +07:00
Jeremy Stanley
bc06522374 Use local owners module
Instead of pulling owners.py from the system-config repo, start
using the local copy provided by the openstack_election package.

Change-Id: I180ef0e5ec880b46f0427c1c952b640a780b5732
2018-01-09 21:29:44 +00:00
Tony Breeds
10d369efaa Update default tox envs to be py35 rather than py34
Change-Id: Idee756424c909fe02395b2ee1b8a18247f0d8c1c
2017-01-05 12:57:03 +11:00
Tony Breeds
a3ac4a90f8 Support for running tools under python3
If we run the tools (create-directories or check-all-candidacies) under
python3 they'll fail with silly errors (like[1]).  This is because we
have a number of assumptions they we'll be running under python2 like:

 - pickle.protocol: we done specify one so if we write a pickle file
   from python3 we can't read it in python2.
 - urllib and urlparse: those modules change paths in python 2 or 3 so
   use the six helpers to get the bits we want.
 - Explicitly write files in binary format
 - Various str vs bytes issues
 - dict().keys() returns dict_keys under python3 explictly cast that to
   list()

After addressing these issues we can run the tools under either python2
or python3.  To make this easy to check create explicit ven2 and venv3
test environments, leaving all other testenvs to use the system default.

[1] http://paste.openstack.org/show/593823/
Change-Id: I20334a52500847c810b486c9c8b108e75a5d6303
2017-01-05 12:57:03 +11:00
Tony Breeds
7da752110a Switch to hacking and fix errors
./doc/source/_exts/candidates.py:20:1: H306  imports not in alphabetical order (jinja2.filesystemloader, jinja2.environment.environment)
./doc/source/_exts/events.py:17:1: H306  imports not in alphabetical order (os, calendar)
./doc/source/_exts/events.py:21:1: H306  imports not in alphabetical order (jinja2.filesystemloader, jinja2.environment.environment)
./openstack_election/check_candidacy.py:62:29: E126 continuation line over-indented for hanging indent
./openstack_election/utils.py:27:1: H306  imports not in alphabetical order (yaml, re)
./openstack_election/cmds/close_election.py:90:9: H232  Python 3.x incompatible octal 755 should be written as 0o755
./openstack_election/tests/test_utils.py:25:21: E126 continuation line over-indented for hanging indent
./tools/new-election.py:18:31: H301  one import per line
./tools/new-election.py:27:5: H233  Python 3.x incompatible use of print operator
./tools/new-election.py:31:5: H233  Python 3.x incompatible use of print operator
./tools/new-election.py:41:5: H233  Python 3.x incompatible use of print operator

Co-Authored-By: Nguyen Hung Phuong <phuongnh@vn.fujitsu.com>
Change-Id: Idd9bc1f1f92da1658e6da2af588c575ee0ba2cb0
2016-10-07 13:35:46 +11:00
Tristan Cacqueray
257d3e3e08 Add configuration.yaml
This change refactor events.yaml into something more generic and
usable by openstack_election module

Change-Id: I26e25cb31c60645742baba1e73f8da9043029381
2016-09-14 11:25:07 +00:00
Tony Breeds
b285d3dd9c Make openstack_election look more like a python module
Currently the code in this repo is half modular have series of scripts.
Migrate the code to be more modular.  The main benefit to this is
testing is easier.

Testing is added in a followup patch

Change-Id: Ic1262436147ecdb818ee259e2e85fca8df09d722
2016-09-12 15:35:40 +10:00
Tony Breeds
df4eb69e66 Add a linters tox environment
The linters tox environment will run yamllint and flake8.

Also fix a few trivial issues so the new target passes

Change-Id: Ifa1e9379f7d1d1996f2cfb84233bce8b502979bb
2016-09-12 15:12:55 +10:00
Tony Breeds
cdbc906dc9 Validate extra-atcs
Change-Id: I7c3324d73a4fc18329270f845aba6904d3f9a539
2016-03-11 13:45:10 +11:00
Tristan Cacqueray
fe3378c68f Cargo-culting doc building from openstack/ossa
* Directories tree for mitaka projects
* Tools to check candidacy
* Generate candidates lists

Change-Id: I784bc4a3a06d3d7506df6d2ef7e6b0362f7696b9
2015-09-10 13:32:36 -04:00