diff -Nru python-hacking-0.12.0/AUTHORS python-hacking-1.1.0/AUTHORS --- python-hacking-0.12.0/AUTHORS 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/AUTHORS 1970-01-01 00:00:00.000000000 +0000 @@ -1,161 +0,0 @@ -Aaron Rosen -Adrian Smith -Akihiro MOTOKI -Alessandro Pilotti -Alex Gaynor -Alex Meade -Andreas Jaeger -Andreas Jaeger -Andrew Bogott -Andrew Laski -Andy Smith -Andy Smith -Anthony Young -Arvind Somy -Arvind Somya asomya@cisco.com <> -Asbjørn Sannes -Attila Fazekas -Ben Nemec -Bhuvan Arumugam -Brant Knudson -Brian Elliott -Brian Lamar -Brian Waldon -Brian Waldon -Chang Bo Guo -ChangBo Guo(gcb) -Chet Burgess -Chris Behrens -Chris Yeoh -Christian Berendt -Chuck Short -Chuck Short -Clark Boylan -Clay Gerrard -Cyril Roelandt -Cyril Roelandt -Dan Prince -Dan Smith -Dan Wendlandt -Daniel P. Berrange -Darragh Bailey -Davanum Srinivas -David Pravec -David Ripton -Derek Higgins -Devin Carlen -Devin Carlen -Dirk Mueller -Dolph Mathews -Dominik Heidler -Doug Hellmann -Doug Hellmann -Dougal Matthews -Ed Leafe -Eldar Nugaev -Eoghan Glynn -Erno Kuvaja -Ewan Mellor -Ghe Rivero -Hengqing Hu -Ian Cordasco -Ian Cordasco -Ilya Alekseyev -Ilya Alekseyev -Ivan A. Melnikov -Ivan A. Melnikov -James Carey -James E. Blair -James E. Blair -James E. Blair -James E. Blair -James Polley -Jason Koelker -Jason Kölker -Jay Lau -Jeremy Stanley -Jesse Andrews -Joe Gordon -Joe Heck -Johannes Erdfelt -John L. Villalovos -John Tran -Josh Kearney -Julien Danjou -Justin Santa Barbara -Justin Santa Barbara -Justin Shepherd -Ken Pepple -Kui Shi -Kurt Taylor -Lei Zhang -Lorin Hochstein -Luis Fernandez Alvarez -Marc Abramowitz -Mark McLoughlin -Mate Lakat -Matt Joyce -Matt Riedemann -Matthew Treinish -Michael Gundlach -Michal Dulko -Mike Perez -Mike Pittaro -Monty Taylor -Nachi Ueno -Nattaphoom Chaipreecha -Naveed Massjouni -Nikola Dipanov -Ondřej Nový -Paul Voccio -Pádraig Brady -Radomir Dopieralski -Rick Clark -Rick Harris -Robert Collins -Robert Collins -Roger Luethi -Russell Bryant -Samuel Merritt -Sandy Walsh -Sascha Peilicke -Sean Dague -Sean Dague -Sergey Lukjanov -Soren Hansen -Soren Hansen -Spencer Krum -Stanislaw Pitucha -Steven Dake -Sulochan Acharya -Surojit Pathak -Thierry Carrez -Tim Burke -Todd Willey -Todd Willey -Trey Morris -Tushar Patil -Vishvananda Ishaya -Vishvananda Ishaya -William Wolf -YAMAMOTO Takashi -Yaguang Tang -Yong Sheng Gong -Yosef Berman -Yun Mao -Yuriy Taraday -ZhiQiang Fan -ZhiQiang Fan -Zhongyue Luo -Zhongyue Luo -andy -fujioka yuuichi -janonymous -jaypipes@gmail.com <> -jmeridth -lzyeval -matt.dietz@rackspace.com <> -root -sateesh -termie -vladimir.p diff -Nru python-hacking-0.12.0/ChangeLog python-hacking-1.1.0/ChangeLog --- python-hacking-0.12.0/ChangeLog 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/ChangeLog 1970-01-01 00:00:00.000000000 +0000 @@ -1,774 +0,0 @@ -CHANGES -======= - -0.12.0 ------- - -* Enable release notes translation -* Updated from global requirements -* Updated from global requirements -* Fix issues detected by pycodestyle -* Add documentation about off-by-default options -* Add optional H203 to check that assertIs(Not)None is used -* Updated from global requirements -* Add a check for delayed string interpolation -* Fix releasenote building -* Clean up check signatures -* Fix Google Python Style Guide link -* Updated from global requirements -* Updated from global requirements -* Updated from global requirements -* Fix H703 test -* Updated from global requirements -* Updated from global requirements -* Add reno and release notes tracking - -0.11.0 ------- - -* Updated from global requirements -* Update the assertRaises example to be more modern -* Updated from global requirements -* Run all flake8 checks -* Updated from global requirements -* Updated from global requirements -* Update flake8 requirement for 0.11.0 -* Updated from global requirements -* Avoid git clone in integration test -* Remove oslo-incubator section in HACKING.rst -* Do not call "rm -rf" on arbitrary user input -* Update setup.cfg -* Put py34 first in the env order of tox -* Minor text cleanup -* Deprecated tox -downloadcache option removed -* Updated from global requirements -* Add support for PEP257 -* Update docs for i18n exception -* Updated from global requirements -* Updated from global requirements -* Updated from global requirements -* Updated from global requirements -* Add editor files to .gitignore -* Take advantage of RST formatting for links -* Revise adding additional checks section of README -* Add example to versioning section of README -* Expand origin section of README -* Document the reasoning behind general hacking rules -* Expand depends documentation in readme -* Fix a typo -* Add support for flake8 off_by_default for optional checks -* Updated from global requirements -* whitelist bash in integration test -* Drop py33 as a target -* Don't shallow clone from file:// in integration test -* Updated from global requirements -* Updated from global requirements -* Change integration test to use git.o.o -* tests: allow to run the same test for different code -* Updated from global requirements -* Fix string formatting in example -* Updated from global requirements -* Updated from global requirements - -0.10.1 ------- - -* Updated from global requirements -* Fix H238 to allow parent classes to be returned by a function -* H105: also check for Authors and authors - -0.10.0 ------- - -* Add docstring to is_import_exception -* Remove complex import rules -* Remove Git commit message checks -* Add eventlet to test-requirements -* Workflow documentation is now in infra-manual -* Allow import redirections -* Fixing broken while loop in imports.py -* Updated from global requirements -* Updated from global requirements -* Updated from global requirements -* Add H237 to HACKING.rst -* Don't change log level as import side effect -* Include example of multiple imports using from syntax -* Updated from global requirements -* Updated from global requirements -* Pin mccabe to prevent it from breaking hacking -* Updated from global requirements -* Updated from global requirements -* Add hacking check H105: don't use author tags -* Add a check for old style class declarations -* Updated from global requirements -* Update H501 to check for self.__dict__ -* Updated from global requirements -* Stop using intersphinx -* Updated from global requirements -* Work toward Python 3.4 support and testing -* Updated from global requirements -* Updated from global requirements -* Updated from global requirements -* Updated from global requirements -* Relax H305 and H307 checks -* Fix import check interaction with namespace modules -* remove H904 -* Updated from global requirements -* remove H402 -* remove H803, it's mostly an old flamewar -* add hacking preamble -* Updated from global requirements -* Updated from global requirements -* Mark hacking as being a universal wheel - -0.9.2 ------ - -* Fixed warning H302 when used with six.moves - -0.9.1 ------ - -* Fix a typo in HACKING.rst -* Make import checks properly detect blank lines and comments -* Clarify where the "following template" is - -0.9.0 ------ - -* Update localization checks to understand separate catalogs -* Update examples for i18n -* Updated from global requirements -* update Commit Message guidelines -* Drop 'not in' and 'is not' tests from HACKING.rst -* Add Installation section to the readme -* Include rule numbers in HACKING.rst -* Add link to readme at bottom of docs.openstack.org/developer/hacking/ -* Update pointer to HACKING.rst in the readme -* Updated from global requirements -* Consider sys.real_prefix for _get_import_type -* Add TestCase assertion methods for testing checks -* Speed up hacking_import_alphabetical -* Speed up hacking_has_correct_license -* Fix py33, make sure skip_on_py3 is part of every check -* Add noqa everywhere that it is easy to do so -* Remove H901,H902 since it is a duplicate of H714,H713 -* Move other checks into their own file -* Cleanup hacking doc generation -* Move git checks into their own file -* Move localization checks into their own file -* Move docstring/list checks into their own file -* Keep setup.cfg flake8.extensions in numerical order -* Move docstring checks into their own file -* Move import checks into their own file -* Compile python 2-> regular expressions -* Move python 2->3 checks into their own module -* Speed up license checks -* Only compile regex for hacking_except_format once -* Move except checks into their own module -* Move comment checks into their own module -* Make test_doctest use entry points -* Fix typo: backsplash=>backslash -* Updated from global requirements -* Import Guideline Exception for gettextutils -* Use pep8's noqa argument -* Move hacking to pep8 1.5.6 -* Minor README.rst tweaks -* Updated from global requirements -* Add posargs to tox -epep8 -* Make hacking pass pep8 1.5.x -* Bump pep8, pyflakes and flake8 versions -* Disable logging correctly -* Make H202 check honor pep8 #noqa comment -* Make hacking Python 3 compatible -* Updated from global requirements -* Updated from global requirements -* Switch over to oslosphinx -* HACKING.rst: Fix odd indentation in an example code -* Remove tox locale overrides -* Updated from global requirements -* Clarify H403 message -* More portable way to detect modules for H302 -* Fix python 3 incompatibility in _get_import_type -* Trigger warnings for raw and unicode docstrings -* Enhance H233 rule -* Add check for removed modules in Python 3 -* Add Python3 deprecated assert* to HACKING.rst -* Turn Python3 section into a list -* Re-Add section on assertRaises(Exception -* Cleanup HACKING.rst -* Move hacking guide to root directory -* Fix typo in package summary -* Add H904: don't wrap lines using a backslash -* checking for metaclass to be Python 3.x compatible -* Remove unnecessary headers -* Add -U to pip install command in tox.ini -* Fix typos of comment in module core -* Updated from global requirements -* Add a check for file with only comments -* Enforce grouping like imports together -* Add noqa support for H201 (bare except) -* Enforce import grouping -* Clean up how test env variables are parsed -* Fix the escape character -* Remove vim modeline sample -* Add a check for newline after docstring summary - -0.8.0 ------ - -* Updated from global requirements -* Continue reserving H6xx namespace for calling methods -* Fix import grouping -* Add assertNotEquals check to H602 -* Sync requirements with OS requirements -* Allow APL text to start on the first text column -* Add noqa support for H231 and H233 -* Revert "Adds ability to ignore hacking validations with noqa" -* Move the hacking guidelines to sphinx docs -* Replace OpenStack LLC with OpenStack Foundation -* Update tox to use develop and custom pip command -* Add check for deprecated method assert_ -* hacking should conform with OS requirements -* Redirect stderr for git rev-parse -* Use the name for this attribute that exists on Python3 -* Add pypy on tox envlist -* Adds ability to ignore hacking validations with noqa -* Update requirements -* Improve H202 to cover more cases -* Add check for deprecated method assertEquals -* Reword H404 description to match check - -0.7.0 ------ - -* Synced with global requirements -* Fix typo in HACKING.rst -* python3: Fix tracebacks while running testsuites -* Import exceptions list is now configurable -* python3: Fix unicode and gettext -* python3: Fix python3 tox installation -* Extract configs-related code to the configs helper -* Update I18N code style -* Make H202 work again -* Don't crash on tests when git is not installed - -0.6.0 ------ - -* Make H103 Invalid Apache throw error on correct line -* Make H232 message mention its py3 related -* Add information about the Google style guide -* Avoid crash when git commit title cannot be found -* Add no locals() for string formatting test -* Fix typo in HACKING.rst compatility=>compatibility -* Add H233 check for usages of the print operator -* Add H232 check for octal number literals -* Determine git workdir properly -* Reserver a H23x range for Python 3.x compat checks -* Add documentation for Apache License check -* Strip leading/trailing whitespace from reference License -* Add note about checks have community support -* Ignore import lines with noqa -* Add check for end of title line of commit messages -* Include HACKING.rst in MANIFEST.in -* Split H102 into 2 checks and enable them -* Actually tie pbr versions in setup_requires - -0.5.5 ------ - -* update HACKING.rst to be OpenStack Style Commandments -* Add local-check test -* Enable all checks during integration test -* Add H203: Check for Python 3.x compatible except -* Add integration test option to tox -* python3: Introduce py33 to tox.ini -* Add H402 doctest and other doc cleanups -* Update H3xx doctests -* Add doctests to H201, H202 and fix False Positive in H202 -* Expand H101 docstring tests -* Fix tests to redirect stdout -* Style-fixes to hacking/core.py -* Disable H102 until ready to add new checks -* add check that python files have Apache 2.0 license stanza -* Remove trailing whitespace in setup.cfg -* Add proper README for how to develop on hacking -* Rename README to HACKING -* Pin the versions of pep8/pyflakes here -* Remove an extra word from the H901 error message -* Cleanup some docstrings -* Fix yield bug for GlobalCheck -* Improve unit test output -* Add .mailmap file -* Stop referencing nova HACKING guide - -0.5.4 ------ - -* Update indentation in setup.cfg -* Implement a proxy checker class -* Add back in git commit message checking -* Remove H307 no db in virt -* Add gettext install -* Fix homepage location - -0.5.2 ------ - -* Moved hacking to core -* Clean up flakes warnings - -0.5.1 ------ - -* Add tests -* Fix requirements distribution - -0.5.0 ------ - -* Make hacking a flake8 plugin -* Switch to flake8 for pep8 testing -* Switch to final 1.1.0 oslo.config release -* websockify 0.4 is busted -* Pin SQLAlchemy to 0.7.x -* Update to Quantum Client 2.2.0 -* Update tox.ini to support RHEL 6.x -* Switch to oslo.config -* docs should indicate proper git commit limit -* Fixes oslo-config update for deprecated_group -* Regenerate nova.conf.sample -* Prevent hacking.py from crashing on unexpected import exception -* Bump python-quantumclient version to 2.1.2 -* Update OpenStack LLC to Foundation -* Improve hackings docstring detection -* Unpin PasteDeploy dependency version -* Unpin routes dependency version -* Unpin suds dependency version -* Unpin Cheetah dependency version -* Fix hacking.py to handle 'cannot import x' -* Fix hacking.py to handle parenthesise in from import as -* Remove function redefinitions -* Sync latest install_venv_common.py -* Fix broken logging imports -* Fix hacking test to handle namespace packages -* Use oslo-config-2013.1b4 -* Fix hacking tests on osx -* Harmonize PEP8 checking between tox and run_tests.sh -* Fix script argument parsing -* Module import style checking changes -* Add "is not" test to hacking.py -* Update tools/regression_tester -* support reloctable venv roots in testing framework -* Add regression testing tool -* Sync latest install_venv_common from oslo -* replace ssh-keygen -m with a python equivalent -* Added Postgres CI opportunistic test case -* Fix import for install_venv.py -* Add 'not in' test to tools/hacking.py -* import tools/flakes from oslo -* Make sure there are no unused import -* Use install_venv_common.py from oslo -* Fix hacking N302 import only modules -* Make failures in the periodic tests more detailed -* Add version constraint for coverage -* xenapi: Add cleanup_sm_locks script -* Add version constraint for cinder -* Cleanup of extract_opts.py -* Unpin testtools -* Sync latest cfg from oslo-incubator -* Avoid testtools 0.9.25 -* Go back to the original branch after pylint check -* Fix multi line docstring tests in hacking.py -* don't allow crs in the code -* Pull NovaWebSocketProxy class out of nova-novncproxy binary -* Use testrepository setuptools support -* Revert "Use testr setuptools commands." -* enable hacking.py self tests -* Use testr setuptools commands -* Try out a new nova.conf.sample format -* Regenerate nova.conf.sample -* fix N402 on tools/ -* Fix lintstack check for multi-patch reviews -* fix N401 errors, stop ignoring all N4* errors -* Upgrade WebOb to 1.2.3 -* Make WebOb version specification more flexible -* Import cfg module in extract_opts.py -* Replace fixtures.DetailStream with fixtures.StringStream -* Use testr to run nova unittests -* Move zombie_instance_updated_at_window option -* Port to argparse based cfg -* Correctly init XenAPIDriver in vm_vdi_cleaner.py -* i18n raise Exception messages -* Unpin lxml requirements -* Update tools/flakes to work with pydoc -* Fix pep8 exclude logic for 1.3.3 -* Add pyflakes option to tox -* Allow newer boto library versions -* Add generic customization hooks via decorator -* Pin pep8 to 1.3.3 -* Use CONF.import_opt() for nova.config opts -* Remove nova.config.CONF -* Add keystoneclient to pip-requires -* Remove nova.flags -* Unpin amqplib and kombu requirements -* Isolate tests from the environment variable http_proxy -* Ban db import from nova/virt -* Switch from FLAGS to CONF in misc modules -* Remove flags.DECLARE -* Move parse_args to nova.config -* move python-cinderclient to pip-requires -* Force earlier version of sqlalchemy -* Remove extra print line in hacking.py -* Use testtools as the base testcase class -* Change hacking.py N306 to use logical_lines -* Fix hacking.py naivete regarding lines that look like imports -* Change install_venv to use setup.py develop -* Fixes syntax error in nova.tools.esx.guest_tools.py -* Proxy floating IP calls to quantum -* Remove dependency on python-ldap for tests -* Update tools hacking for pep8 1.2 and beyond -* Revert "Add full test environment." -* Loosen anyjson dependency to avoid clash with ceilometer -* Bump the version of SQLAlchemy in pip-requires -* Replaced default hostname function from gethostname to getfqdn -* Move fakeldap.py from auth dir to tests -* Added script to find unused config options -* Add flag cinder_endpoint_template to volume.cinder -* More specific lxml versions in tools/pip-requires -* Set install_requires in setup.py -* Nail the pip requirement at 1.1 -* Update requires to glanceclient >=0.5.0 -* Add lintstack error checker based on pylint -* Include CommonConfigOpts options in sample config -* Ensure log formats are quoted in sample conf -* Don't include hostname and IP in generated sample conf -* Allow generate_sample.sh to be run from toplevel dir -* Fix hacking.py git checks to propagate errors -* Add nosehtmloutput as a test dependency -* Cleanup pip dependencies -* Make missing imports flag in hacking settable -* update python-quantumclient dependency to >=2.0 -* Rewrite image code to use python-glanceclient -* Add a 50 char git title limit test to hacking -* Drop AES functions and pycrypto dependency -* Improve external lock implementation -* Require eventlet >= 0.9.17 -* Fix broken pep8 exclude processing -* XenAPI: Add script to destroy cached images -* Replace subprocess.check_output with Popen -* Xen: Add race-condition troubleshooting script -* Add git commit message validation to hacking.py -* Fixes XenAPI driver import in vm_vdi_cleaner -* Fix venv wrapper to clean *.pyc -* modify hacking.py to not choke on the def of _() -* Correct typo in tools/hacking.py l18n -> i18n -* Implement nova network API for quantum API 2.0 -* Switch to common logging -* Use setuptools-git plugin for MANIFEST -* Align run_tests.py pep8 with tox -* Switch to using new config parsing for vm_vdi_cleaner.py -* Fix several PEP-8 issues -* Add full test environment -* Remove unknown shutdown kwarg in call to vmops._destroy -* Refactor vm_vdi_cleaner.py connection use -* add nova-manage bash completion script -* Replaces functions in utils.py with openstack/common/timeutils.py -* Finalize tox config -* Removing double quotes from sample config file -* Backslash continuation removal (Nova folsom-2) -* Sample config file tool updates -* Use cfg's new global CONF object -* Grammar fixes -* Cleanup tools/hacking using flake8 -* Update pep8 dependency to v1.1 -* Nail pep8 dependencies to 1.0.1 -* Make validate_compacted_migration into general diff tool -* Remove unused tools/rfc.sh -* Remove wsgiref from requirements -* Add migration compaction validation tool -* Modify vm_vdi_cleaner to handle `-orig` -* Remove old flagfile support -* Trivial spelling fix -* Imports to human alphabetical order -* Enable InnoDB checking -* Use instance_get_by_uuid since we're looking up a UUID -* Use nova_uuid attribute instead of trying to parse out name_label -* Number of missing imports should always be shown -* Improved tools/hacking.py -* nova.virt.xenapi_conn -> nova.virt.xenapi.connection -* xenapi_conn -> xenapi.connection -* Remove python-novaclient dependency from nova -* Improved localization testing -* Remove nova Direct API -* bug 968452 -* HACKING fixes, sqlalchemy fix -* Remove nova.rpc.impl_carrot -* Updated docstrings in /tools as per HACKING -* Remove tools/nova-debug -* Add VDI chain cleanup script -* Hack to fixup absolute pybasedir in nova.conf.sample -* Require a more recent version of glance -* HACKING fixes, all but sqlalchemy -* Remove trailing whitespaces in regular file -* Cleans up the create_conf tool -* Add assertRaises check to tools/hacking.py as N202 -* Clean stale lockfiles on service startup : fixes bug 785955 -* Nova options tool enhancements -* Support tox-based unittests -* nova.conf sample tool -* Support non-UTC timestamps in changes-since filter -* Get rid of distutils.extra -* Require newer versions of SA and SA-Migrate -* Remove ajaxterm from Nova -* Excise M2Crypto! -* Boto 2.2.x failes. Capping pip-requires at 2.1.1 -* Add HACKING compliance testing to run_test.sh -* Cleanup Imports to match HACKING guidelines -* greenlet version inconsistency -* Tell users what is about to be installed via sudo -* PEP8 remove direct type comparisons -* Install a good version of pip in the venv -* Rename .nova-venv to .venv -* revert using git for novaclient -* Relax novaclient and remove redis dependency -* Relax dependency on boto 1.9b and nova-adminclient -* Add ability to see deleted and active records -* Use system M2Crypto package on Oneiric, bug 892271 -* Separate metadata api into its own service -* install_venv: apply eventlet patch correctly with python 2.7 (#890461) -* Workaround for eventlet bug with unit tests in RHEL6.1 -* Apply M2Crypto fix for all Fedora-based distributions -* Optional --no-site-packages in venv -* venv: update distribute as well as pip -* Remove nova dependency on vconfig on Linux -* Upgrade pip in the venv when we build it -* Utility script that makes enforcing PEP8 within git's pre-commit hook as easy as possible -* Further changes to the cleaner -* Reference orphaned_instance instead of instance -* Continue to the next iteration of the loop if an instance is not found -* Add support for header version parameter to specify API version -* Adds a script that can automatically delete orphaned VDIs. Also had to move some flags around to avoid circular imports -* Added ==1.0.4 version specifier to kombu in pip-requires to ensure tests pass in a clean venv -* install_venv: pip install M2Crypto doesn't work on Fedora -* install_venv: add support for distro specific code -* install_venv: remove versioned M2Crypto dependency -* install_venv: don't use --no-site-packages with virtualenv -* install_venv: pass the --upgrade argument to pip install -* install_venv: refactor out pip_install helper -* Use latest version of SQLAlchemy -* use git config's review.username for rfc.sh -* Don't use GitPython for authors check -* Fix rfc.sh's check for the project -* Add rfc.sh to help with gerrit workflow -* cleaned up -* Multi-NIC support for vmwareapi virt driver in nova. Does injection of Multi-NIC information to instances with Operating system flavors Ubuntu, Windows and RHEL. vmwareapi virt driver now relies on calls to network manager instead of nova db calls for network configuration information of instance. Re-oranized VMWareVlanBridgeDriver and added session parmeter to methods to use existing session. Also removed session creation code as session comes as argument. Added check for flat_inject flag before attempting an inject operation -* Multi-NIC support for vmwareapi virt driver in nova. Does injection of Multi-NIC information to instances with Operating system flavors Ubuntu, Windows and RHEL. vmwareapi virt driver now relies on calls to network manager instead of nova db calls for network configuration information of instance. Ensure if port group is properly associated with vlan_interface specified in case of VLAN networking for instances. Re-oranized VMWareVlanBridgeDriver and added session parmeter to methods to use existing session. Also removed session creation code as session comes as argument. Added check for flat_inject flag before attempting an inject operation. Removed stale code from vmwareapi stubs. Also updated some comments to be more meaningful. Did pep8 and pylint checks. Tried to improve pylint score for newly added lines of code -* Adding feedparser to pip-requires -* add kombu to pip-requires and contrib/nova.sh -* merged with volume_types. no code refactoring yet -* Merged with trunk -* Added Test Code, doc string, and fixed pip-requiresw -* Added monkey patching notification code function w -* Merged with trunk -* merged with nova-1411 -* Resolve conflicts and fixed broken unit testcases -* merged with 1382 -* Moves image creation from POST /images to POST /servers//action -* removing compute monitor -* bumping novaclient version -* Merged with trunk and fixed broken unit test cases -* merged with 1320 -* some file attrib changes -* - Fixed the conflift in vmops.py -* VSA: first cut. merged with 1279 -* Changed broken perms -* Updates some of the extra scripts in contrib and tools to current versions -* merged trunk -* This branch adds additional capability to the hosts API extension. The new options allow an admin to reboot or shutdown a host. I also added code to hide this extension if the --allow-admin-api is False, as regular users should have no access to host API calls -* uses 2.6.0 novaclient (OS API 1.1 support) -* Removed duplicate xattr from pip-requires -* Merged trunk -* Fixed several typos -* Fixing lxml version requirement -* Added xml schema validation for extensions resources. Added corresponding xml schemas. Added lxml dep, which is needed for doing xml schema validation -* merged trunk -* merged trunk -* merged trunk -* merged trunk -* python-novaclient 2.5.8 is required -* trunk merge with migration renumbering -* trunk merge -* merged trunk, fixed the floating_ip fixed_ip exception stupidity -* updated pip-requires for novaclient -* pip requires -* moved migration again & trunk merge -* Re-worked some of the WSGI and WSGIService code to make launching WSGI services easier, less error prone, and more testable. Added tests for WSGI server, new WSGI loader, and modified integration tests where needed -* Adds support for "extra specs", additional capability requirements associated with instance types -* Added floating IP support in OS API -* trunk merge, getting fierce. -* Merged trunk -* - Modified NOTE in vm_util.py - Changed gettext line to nova default in guest_tool.py -* missed the bin line -* make nova-debug work with new style instances -* remove extra stuff from clean vlans -* Upstream merge -* Renamed _inst_type_query_to_dict -> _dict_with_extra_specs -* trunk merged. conflicts resolved -* Fixed the default arguments to None instead of an empty list -* Fixing PEP8 compliance issues -* trunk merge -* trunk merge and migration bump -* pip-requires -* Stop trying to set a body for HTTP methods that do not allow it. It renders the unit tests useless (since they're testing a situation that can never arise) and webob 1.0.8 fails if you do this -* Bump WebOb requirement to 1.0.8 in pip-requires -* Cleanup and addition of tests for WSGI server -* Fix for lp:796834 -* merged trunk -* floating_ips extension is loading to api now -* pip novaclient bump -* fixed up some little project_id things with new novaclient -* tests working after merge-3 update -* merged koelkers tests branch -* tweaks -* Dropped requirement for IPy -* merge with trey -* Fixed pip-requires double requirement -* added nova_adminclient to tools/pip-requires -* merged trunk -* Added paramiko to tools/pip-requires -* fix pep8 issues -* pep8 fixes -* now pip-requires mox version 0.5.3 -* Fixed all pep8 errors in tools/install_venv.py. All tests pass -* fixed pep8 spacing issue -* merge from trunk and update .mailmap file -* Added GitPython to [install_dir]/tools/pip-requires -* Added Python packages needed for coverage reports to virtualenv packages -* got rid of extra whitespace -* Update tools/pip-requires and tools/install_venv.py for python2.7 support (works in ubuntu 11.04) -* Remove zope.interface from the requires file since it is not used anywhere -* remove zope.interface requires -* use 'is not None' instead of '!= None' -* Add a patch for python eventlet, when using install_venv.py (see FAQ # 1485) -* Removed adminclient.py and added reference to the new nova-adminclient project in tools/pip-requires -* Add euca2ools import -* Make euca-get-ajax-console work with Euca2ools 1.3 -* Removed adminclient and referred to pypi nova_adminclient module -* The VNC Proxy is an OpenStack component that allows users of Nova to access their instances through a websocket enabled browser (like Google Chrome) -* Removed iso8601 dep from pip-requires -* Added MUCH more flexiable iso8601 parser dep for added stability -* merge trunk -* incorporate feedback from termie -* Implementation of blueprint hypervisor-vmware-vsphere-support. (Link to blueprint: https://blueprints.launchpad.net/nova/+spec/hypervisor-vmware-vsphere-support) -* Enable flat manager support for ipv6 -* disable-msg -> disable -* * Updated document vmware_readme.rst to mention VLAN networking * Corrected docstrings as per pep0257 recommentations. * Stream-lined the comments. * Updated code with locals() where ever applicable. * VIM : It stands for VMware Virtual Infrastructure Methodology. We have used the terminology from VMware. we have added a question in FAQ inside vmware_readme.rst in doc/source * New fake db: vmwareapi fake module uses a different set of fields and hence the structures required are different. Ex: bridge : 'xenbr0' does not hold good for VMware environment and bridge : 'vmnic0' is used instead. Also return values varies, hence went for implementing separate fake db. * Now using eventlet library instead and removed io_utils.py from branch. * Now using glance.client.Client instead of homegrown code to talk to Glance server to handle images. * Corrected all mis-spelled function names and corresponding calls. Yeah, an auto-complete side-effect! -* Reverted unmodified files -* fixed conflicts after merging with trunk with 787 -* Introduces the ZoneManager to the Scheduler which polls the child zones and caches their availability and capabilities -* Moved guest_tool.py from etc/esx directory to tools/esx directory -* * Updated readme file with installation of suds-0.4 through easy_install. * Removed pass functions * Fixed pep8 errors * Few bug fixes and other commits -* trunk merge, pip-requires and novatools to novaclient changes -* initial commit of vnc support -* replaced ConnectionFailed with Exception in tools/euca-get-ajax-console was not working for me with euca2tools 1.2 (version 2007-10-10, release 31337) -* pip requires novatools -* fixes doc build and setup.py fail in virtualenv -* merge from upstream and fix small issues -* Implement support for streaming images from Glance when using the XenAPI virtualization backend, as per the bexar-xenapi-support-for-glance blueprint -* This removes the need for the custom udev rule for iscsi devices. It instead attaches the device based on /dev/disk/by-path/ which should make the setup of nova-volume a little easier -* merge from upstream -* Merged with trunk revno 565 -* Added netaddr for pip-requires -* add support for database migration -* Merged with trunk -* merge trunk, fix conflict -* use by-path instead of custom udev script -* Now tries to install virtualenv via easy_install if not present -* Add glance to pip-requires, as we're now using the Glance client code from Nova -* consolidate boto_extensions.py and euca-get-ajax-console, fix bugs from previous trunk merge -* merge trunk -* add timeout constant, set to 5 minutes -* merge trunk -* merged trunk, resolved trivial conflict -* merged trunk, resolved conflict -* better bin name, and pep8 -* add license -* move euca-get-ajax-console up one directory -* merge trunk -* rewrite proxy to not use twisted -* working connection security -* connecting ajax proxy to rabbit to allow token based security -* remove a debugging line -* merging in trunk -* prototype works with kvm. now moving call from api to compute -* Use paste.deploy for running the api server -* Make nova work even when user has LANG or LC_ALL configured -* Added Twisted version dependency into pip-requires -* add bzr to the dev dependencies -* merged Justin Santa Barbara's raw-disk-image back into the latest trunk -* Adds nova-debug to tools directory, for debugging of instances that lose networking -* basics to get proxied ajaxterm working with virsh -* renamed target_id to iscsi_target -* nova-debug, relaunch an instance with a serial console -* Duplicate the two trivial escaping functions remaining from tornado's code and remove the dependency -* ISCSI Volume support -* merge lp:nova -* fix typo in boto line of pip-requires -* reverted python-boto version in pip-requires to 1.9b1.\ -* Merged with trunk, fixed broken stuff -* Cleans up the unit tests that are meant to be run with nosetests -* improved commenting -* reorganize iptables clear and make sure use_nova_chains is a boolean -* disable output drop for the moment because it is too restrictive -* allow mgmt ip access to api -* flush the nova chains -* add a reset command -* improved the shell script for iptables -* put setup_iptables in the right dir -* renamed ipchains to iptables -* merged fix-iptables -* Support querying version list, per the RS API spec. Fixes bug 613117 -* A small fix to the install_venv program to allow us to run it on the tarmac box as part of the tarmac build -* add in a few comments -* s/\t/ /g, and add some comments -* add security and session timeout to ajaxterm -* initial commit of ajaxterm -* Added iptables host initial configuration -* Support querying version list -* New version of eventlet handles Twisted & eventlet running at the same time -* add sqlalchemy to pip requires -* Fix a pep8 violation -* A few small changes to install_venv to let venv builds work on the tarmac box -* Merged with trunk -* Fix to better reflect (my believed intent) as to the meaning of error_ok (ignore stderr vs accept failure) -* Merged with trunk -* pep8 typo -* Changed our minds: keep pylint equal to Ubuntu Lucid version, and use disable-msg throughout -* Fix pep8 violation -* See description of change... what's the difference between that message and this message again? -* Simpler installation, and, can run install_venv from anywhere instead of just from checkout root -* Make WSGI routing support routing to WSGI apps or to controller+action -* updated virtualenv to add eventlet, which is now a requirement -* Changes the run_tests.sh and /tools/install_venv.py scripts to be more user-friendly and not depend on PIP while not in the virtual environment -* work on a router that works with wsgi and non-wsgi routing -* Oops, we need eventlet as well -* Quick fix on location of printouts when trying to install virtualenv -* Changes the run_tests.sh and /tools/install_venv.py scripts to be more user-friendly and not depend on PIP while not in the virtual environment. Running run_tests.sh should not just work out of the box on all systems supporting easy_install.. -* 2 changes in doing PEP8 & Pylint cleaning: * adding pep8 and pylint to the PIP requirements files for Tools * light cleaning work (mostly formatting) on nova/endpoints/cloud.py -* Run correctly even if called while in tools/ directory, as 'python install_venv.py' -* Greater compliance with pep8/pylint style checks -* adding pep8 and pylint for regular cleanup tasks -* Added Cheetah to pip-requires -* Added exit code checking to process.py (twisted process utils). A bit of class refactoring to make it work & cleaner. Also added some more instructive messages to install_venv.py, because otherwise people that don't know what they're doing will install the wrong pip... i.e. I did :-) -* resolving conflict w/ merge, cleaning up virtenv setups -* Fixes to the virtualenv installer -* Move virtualenv installation out of the makefile -* Adds a Makefile to fill dependencies for testing -* update copyrights -* Removed trailing whitespace from header -* Updated licenses -* Removed trailing whitespace from header -* Updated licenses -* tools to clean vlans and run our old install script diff -Nru python-hacking-0.12.0/debian/changelog python-hacking-1.1.0/debian/changelog --- python-hacking-0.12.0/debian/changelog 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/changelog 2018-11-20 09:12:10.000000000 +0000 @@ -1,35 +1,98 @@ -python-hacking (0.12.0-0ubuntu1) zesty; urgency=medium +python-hacking (1.1.0-2~cloud0) bionic-stein; urgency=medium - [ Chuck Short ] - * d/gbp.conf: Update gbp configuration file. - * d/control: Update Vcs-* links and maintainers. + * New upstream release for the Ubuntu Cloud Archive. - [ David Della Vecchia ] - * New upstream release. - * d/p/flake8-legacy.patch: Rebased. + -- Openstack Ubuntu Testing Bot Tue, 20 Nov 2018 09:12:10 +0000 + +python-hacking (1.1.0-2) unstable; urgency=medium + + * Team upload. + * Use 'python3 -m sphinx' instead of sphinx-build for building docs + * Allow newer python-eventlet (Closes: #910027) + * Bump standards version to 4.2.1 (no changes) + * Bump debhelper compat level to 11 + + -- Ondřej Nový Mon, 01 Oct 2018 18:28:05 +0200 + +python-hacking (1.1.0-1) unstable; urgency=medium + + * Team upload. + + [ Ondřej Nový ] + * d/control: Set Vcs-* to salsa.debian.org + * d/copyright: Use https in Format + * d/control: Add trailing tilde to min version depend to allow + backports + * d/control: Use team+openstack@tracker.debian.org as maintainer + + [ David Rabel ] + * New upstream version: 1.1.0 + + -- David Rabel Mon, 03 Sep 2018 14:52:06 +0200 + +python-hacking (0.12.0-1) unstable; urgency=medium + + * Team upload. - -- David Della Vecchia Wed, 07 Dec 2016 14:44:33 -0500 + [ Ondřej Nový ] + * New upstream release + * Bumped debhelper compat version to 10 + * Fix B-D/D for new upstream release + * d/p: Rebase for new upstream release + * d/watch: Use https + * Enable autopkgtest-pkg-python testsuite -python-hacking (0.11.0-0ubuntu2) yakkety; urgency=medium + [ Thomas Goirand ] + * Ran wrap-and-sort -bast. + * Updating vcs fields. + * Updating maintainer field. + * Updating standards version to 4.1.1. - * Fix compatibility with flake8 >= 3.0.0, resolving FTBFS in numerous - OpenStack packages: - - d/p/flake8-legacy.patch: Compatibility patch for newer flake8 versions; - switch to using the legacy API for now. - - d/control: Drop direct depends on pep8, set minimum version ofi - python-flake8 at 3.0.0. - - d/p/flake8-legacy.patch: Update requirements.txt to align with - packaged version of flake8 in Ubuntu/Debian, switch to pycodestyle. + -- Ondřej Nový Sat, 09 Dec 2017 16:22:38 +0100 - -- James Page Tue, 30 Aug 2016 15:52:58 +0100 +python-hacking (0.11.0-2.1) unstable; urgency=medium -python-hacking (0.11.0-0ubuntu1) yakkety; urgency=medium + * Non-maintainer upload. + * Fix the python3-hacking dependencies. (Closes: #867431) + -- Adrian Bunk Tue, 17 Oct 2017 09:38:55 +0300 + +python-hacking (0.11.0-2) unstable; urgency=medium + + [ Ondřej Nový ] + * d/s/options: extend-diff-ignore of .gitreview + * d/control: Use correct branch in Vcs-* fields + + [ Thomas Goirand ] + * Uploading to unstable (Closes: #837100). + + -- Thomas Goirand Tue, 04 Oct 2016 13:21:49 +0200 + +python-hacking (0.11.0-1) experimental; urgency=medium + + [ Ondřej Nový ] + * Fixed homepage (https). + * Fixed VCS URLs (https). + * d/rules: Changed UPSTREAM_GIT protocol to https + * d/copyright: Changed source URL to https protocol + + [ Thomas Goirand ] * New upstream release. - * d/control: Align (Build-)Depends with upstream. - * d/p/fix-requirements.txt.patch: Rebased. + * Fixed (build-)depends for this release. + * Import flake8-legacy.patch from Ubuntu. + * Using OpenStack's Gerrit as VCS URLs. + * Using pkgos-dh_auto_{install,test} from openstack-pkg-tools >= 52~. + * Add build-depends for testing with Py3. + * Fixed debian/copyright ordering. + * Standards-Version: 3.9.8 (no change). + + -- Thomas Goirand Sat, 17 Sep 2016 23:56:00 +0200 + +python-hacking (0.10.2-4) unstable; urgency=medium + + * Uploading to unstable. - -- Corey Bryant Fri, 03 Jun 2016 08:13:04 -0400 + -- Thomas Goirand Fri, 16 Oct 2015 09:49:09 +0000 python-hacking (0.10.2-3) experimental; urgency=medium diff -Nru python-hacking-0.12.0/debian/compat python-hacking-1.1.0/debian/compat --- python-hacking-0.12.0/debian/compat 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/compat 2018-10-01 16:27:25.000000000 +0000 @@ -1 +1 @@ -9 +11 diff -Nru python-hacking-0.12.0/debian/control python-hacking-1.1.0/debian/control --- python-hacking-0.12.0/debian/control 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/control 2018-10-01 16:27:30.000000000 +0000 @@ -1,47 +1,65 @@ Source: python-hacking Section: python Priority: optional -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: PKG OpenStack -Uploaders: Thomas Goirand , - Clint Adams , - David Della Vecchia , -Build-Depends: debhelper (>= 9), - dh-python, - openstack-pkg-tools, - python-all, - python-pbr, - python-setuptools, - python-sphinx, - python3-all, - python3-pbr, - python3-setuptools, -Build-Depends-Indep: pyflakes, - python-coverage, - python-fixtures, - python-flake8 (>= 3.0.0), - python-mock, - python-oslosphinx, - python-six, - python-testrepository, - python-testscenarios, - python-testtools, - subunit, - testrepository, -Standards-Version: 3.9.6 -Vcs-Browser: https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/python-hacking -Vcs-Git: git://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/python-hacking -Homepage: http://github.com/openstack-dev/hacking +Maintainer: Debian OpenStack +Uploaders: + Thomas Goirand , + Clint Adams , +Build-Depends: + debhelper (>= 11~), + dh-python, + openstack-pkg-tools (>= 52~), + python-all, + python-flake8 (>= 3.0.0), + python-pbr (>> 2.1.0), + python-setuptools, + python-sphinx, + python3-all, + python3-flake8 (>= 3.0.0), + python3-pbr (>> 2.1.0), + python3-setuptools, + python3-sphinx, +Build-Depends-Indep: + pyflakes, + python-coverage (>= 4.5), + python-eventlet (>= 0.20.0-4~), + python-fixtures, + python-mock (>= 2.0.0), + python-openstackdocstheme (>= 1.18.1), + python-reno (>= 2.5.0), + python-six (>= 1.9.0), + python-subunit (>= 1.0.0), + python-testscenarios, + python-testtools (>= 2.2.0), + python3-coverage (>= 4.5), + python3-eventlet (>= 0.20.0-4~), + python3-fixtures, + python3-mock (>= 2.0.0), + python3-openstackdocstheme (>= 1.18.1), + python3-reno (>= 2.5.0), + python3-six (>= 1.9.0), + python3-subunit (>= 1.0.0), + python3-testscenarios, + python3-testtools (>= 2.2.0), + subunit, + testrepository, +Standards-Version: 4.2.1 +Vcs-Browser: https://salsa.debian.org/openstack-team/libs/python-hacking +Vcs-Git: https://salsa.debian.org/openstack-team/libs/python-hacking.git +Homepage: https://github.com/openstack-dev/hacking +Testsuite: autopkgtest-pkg-python Package: python-hacking Architecture: all -Depends: pyflakes, - python-flake8 (>= 3.0.0), - python-pbr, - python-six, - ${misc:Depends}, - ${python:Depends}, -Recommends: ${python:Recommends}, +Depends: + pyflakes, + python-flake8 (>= 3.0.0), + python-pbr (>= 1.8), + python-six (>= 1.9.0), + ${misc:Depends}, + ${python:Depends}, +Recommends: + ${python:Recommends}, Description: Flake8 OpenStack Hacking Guidelines Enforcement plugins - Python 2.x Hacking is a set of flake8 plugins that test and enforce the OpenStack Style Commandments. It checks that your code matches the coding style which is @@ -49,30 +67,34 @@ . This package provides the Python 2.x module. -Package: python3-hacking +Package: python-hacking-doc +Section: doc Architecture: all -Depends: pyflakes, - python3-flake8 (>= 3.0.0), - python3-pbr, - python3-six, - ${misc:Depends}, - ${python:Depends}, -Recommends: ${python3:Recommends}, -Description: Flake8 OpenStack Hacking Guidelines Enforcement plugins - Python 3.x +Depends: + ${misc:Depends}, + ${sphinxdoc:Depends}, +Description: Flake8 OpenStack Hacking Guidelines Enforcement plugins - doc Hacking is a set of flake8 plugins that test and enforce the OpenStack Style Commandments. It checks that your code matches the coding style which is mandatory for contributing to OpenStack. . - This package provides the Python 3.x module. + This package provides the documentation. -Package: python-hacking-doc -Section: doc +Package: python3-hacking Architecture: all -Depends: ${misc:Depends}, - ${sphinxdoc:Depends}, -Description: Flake8 OpenStack Hacking Guidelines Enforcement plugins - doc +Depends: + pyflakes3, + python3-flake8 (>= 3.0.0), + python3-pbr (>= 1.8), + python3-pep8 (>= 1.5.7), + python3-six (>= 1.9.0), + ${misc:Depends}, + ${python3:Depends}, +Recommends: + ${python3:Recommends}, +Description: Flake8 OpenStack Hacking Guidelines Enforcement plugins - Python 3.x Hacking is a set of flake8 plugins that test and enforce the OpenStack Style Commandments. It checks that your code matches the coding style which is mandatory for contributing to OpenStack. . - This package provides the documentation. + This package provides the Python 3.x module. diff -Nru python-hacking-0.12.0/debian/copyright python-hacking-1.1.0/debian/copyright --- python-hacking-0.12.0/debian/copyright 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/copyright 2018-10-01 16:25:24.000000000 +0000 @@ -1,13 +1,13 @@ -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: hacking -Source: http://github.com/openstack-dev/hacking +Source: https://github.com/openstack-dev/hacking -Files: debian/* -Copyright: (c) 2013, Thomas Goirand +Files: * +Copyright: (c) 2013, OpenStack Foundation License: Apache-2 -Files: * -Copyright: (c) 2013, OpenStack +Files: debian/* +Copyright: (c) 2013-2016, Thomas Goirand License: Apache-2 License: Apache-2 diff -Nru python-hacking-0.12.0/debian/gbp.conf python-hacking-1.1.0/debian/gbp.conf --- python-hacking-0.12.0/debian/gbp.conf 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ -[DEFAULT] -debian-branch = master -upstream-tag = %(version)s -pristine-tar = True - -[buildpackage] -export-dir = ../build-area diff -Nru python-hacking-0.12.0/debian/patches/fix-requirements.txt.patch python-hacking-1.1.0/debian/patches/fix-requirements.txt.patch --- python-hacking-0.12.0/debian/patches/fix-requirements.txt.patch 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/patches/fix-requirements.txt.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,21 +0,0 @@ -Description: Allow greater versions for both pep8, flake8, pyflakes and mccabe - Also support flake8 >= 2.2.2 -Author: Thomas Goirand -Forwarded: not-needed -Last-Update: 2014-03-22 - ---- a/requirements.txt -+++ b/requirements.txt -@@ -3,9 +3,9 @@ - # process, which may cause wedges in the gate later. - pbr>=1.6 # Apache-2.0 - --pep8==1.5.7 # MIT --pyflakes==0.8.1 # MIT -+pep8>=1.5.7 # MIT -+pyflakes>=0.8.1 # MIT - flake8<2.6.0,>=2.5.4 # MIT --mccabe==0.2.1 # MIT License -+mccabe>=0.2.1 # MIT License - - six>=1.9.0 # MIT diff -Nru python-hacking-0.12.0/debian/patches/flake8-legacy.patch python-hacking-1.1.0/debian/patches/flake8-legacy.patch --- python-hacking-0.12.0/debian/patches/flake8-legacy.patch 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/patches/flake8-legacy.patch 2018-10-01 16:25:24.000000000 +0000 @@ -1,64 +1,55 @@ -Description: Compatibility patch for distro mis-alignment with upstream. - flake8 >= 3 moved the engine API to legacy - Skip tets as flake8 and pycodestyle don't want to - work in the same way as flake8 and pep8 did in the - past, and there is no stable API to write something - new against. -Author: James Page -Fowarded: not-needed +From: James Page +Date: Mon, 3 Sep 2018 15:13:03 +0200 +Subject: Compatibility patch for distro mis-alignment with upstream. +flake8 >= 3 moved the engine API to legacy +Skip tests as flake8 and pycodestyle don't want to +work in the same way as flake8 and pep8 did in the +past, and there is no stable API to write something +new against. +Forwarded: not-needed +--- + hacking/tests/test_doctest.py | 4 ++-- + hacking/tests/test_local.py | 4 +++- + requirements.txt | 3 ++- + 3 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/hacking/tests/test_doctest.py b/hacking/tests/test_doctest.py +index 007e8bd..1a73c65 100644 --- a/hacking/tests/test_doctest.py +++ b/hacking/tests/test_doctest.py -@@ -16,8 +16,8 @@ +@@ -16,7 +16,7 @@ import re -from flake8 import engine --import pep8 +from flake8.api import legacy as engine -+import pycodestyle - import pkg_resources - import six - import testscenarios -@@ -36,17 +36,19 @@ class HackingTestCase(hacking.tests.Test + import pycodestyle + import pkg_resources +@@ -38,7 +38,7 @@ class HackingTestCase(hacking.tests.TestCase): scenarios = file_cases -- def test_pep8(self): + def test_pycodestyle(self): - -+ def test_pycodestyle(self): + self.skipTest('Disabled until hacking aligns with pycodestyle and flake8') # NOTE(jecarey): Add tests marked as off_by_default to enable testing - turn_on = set(['H106', 'H203', 'H904']) + turn_on = set(['H106', 'H203', 'H904', 'H204', 'H205', 'H210']) if self.options.select: - turn_on.update(self.options.select) - self.options.select = tuple(turn_on) -+ self.options.benchmark_keys = pycodestyle.BENCHMARK_KEYS[:] -+ self.options.ignore_code = None - -- report = pep8.BaseReport(self.options) -- checker = pep8.Checker(lines=self.lines, options=self.options, -- report=report) -+ report = pycodestyle.BaseReport(self.options) -+ checker = pycodestyle.Checker(lines=self.lines, options=self.options, -+ report=report) - checker.check_all() - self.addDetail('doctest', content.text_content(self.raw)) - if self.code == 'Okay': +diff --git a/hacking/tests/test_local.py b/hacking/tests/test_local.py +index cba6441..043c2dc 100644 --- a/hacking/tests/test_local.py +++ b/hacking/tests/test_local.py -@@ -13,8 +13,8 @@ +@@ -13,7 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from flake8 import engine --import pep8 +from flake8.api import legacy as engine -+import pycodestyle + import pycodestyle import hacking.tests - -@@ -26,11 +26,14 @@ def check(physical_line): +@@ -26,7 +26,9 @@ def check(physical_line): class HackingTestCase(hacking.tests.TestCase): @@ -66,69 +57,17 @@ def test_local_check(self): + self.skipTest('Disabled until hacking aligns with pycodestyle and flake8') flake8_style = engine.get_style_guide(parse_argv=False, ignore='F') -- report = pep8.BaseReport(flake8_style.options) -+ flake8_style.options.benchmark_keys = pycodestyle.BENCHMARK_KEYS[:] -+ report = pycodestyle.BaseReport(flake8_style.options) + report = pycodestyle.BaseReport(flake8_style.options) line = ["#this-is-the-test-phrase"] -- checker = pep8.Checker(lines=line, options=flake8_style.options, -- report=report) -+ checker = pycodestyle.Checker(lines=line, options=flake8_style.options, -+ report=report) - checker.check_all() - self.assertIn("L100", report.counters) +diff --git a/requirements.txt b/requirements.txt +index 93ee93b..98b9997 100644 --- a/requirements.txt +++ b/requirements.txt -@@ -3,9 +3,9 @@ +@@ -3,5 +3,6 @@ # process, which may cause wedges in the gate later. - pbr>=1.6 # Apache-2.0 + pbr!=2.1.0,>=2.0.0 # Apache-2.0 --pep8>=1.5.7 # MIT -+pycodestyle>=2.0.0 # MIT - pyflakes>=0.8.1 # MIT --flake8<2.6.0,>=2.5.4 # MIT +-flake8<2.7.0,>=2.6.0 # MIT +flake8>=3.0.0 # MIT - mccabe>=0.2.1 # MIT License - - six>=1.9.0 # MIT ---- a/hacking/core.py -+++ b/hacking/core.py -@@ -15,14 +15,14 @@ - - """OpenStack HACKING file compliance testing - --Built as a sets of pep8 checks using flake8. -+Built as a sets of pycodestyle checks using flake8. - """ - - import gettext - import sys - - import pbr.util --import pep8 -+import pycodestyle - - from hacking import config - -@@ -127,7 +127,7 @@ class GlobalCheck(object): - - Store in a global registry the list of checks we've run. If we have - run that one before, just skip doing anything the subsequent times. -- This way, since pep8 is file/line based, we don't wind up re-running -+ This way, since pycodestyle is file/line based, we don't wind up re-running - a check on a git commit message over and over again. - """ - if self.name and self.name not in self.__class__._has_run: -@@ -154,11 +154,11 @@ class ProxyChecks(GlobalCheck): - for check_path in set(local_check): - if check_path.strip(): - checker = pbr.util.resolve_name(check_path) -- pep8.register_check(checker) -+ pycodestyle.register_check(checker) - - local_check_fact = CONF.get('local-check-factory') - if local_check_fact: - factory = pbr.util.resolve_name(local_check_fact) -- factory(pep8.register_check) -+ factory(pycodestyle.register_check) - - sys.path.pop() ++pycodestyle>=2.0.0 # MIT + six>=1.10.0 # MIT diff -Nru python-hacking-0.12.0/debian/patches/series python-hacking-1.1.0/debian/patches/series --- python-hacking-0.12.0/debian/patches/series 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/patches/series 2018-10-01 16:25:24.000000000 +0000 @@ -1,2 +1 @@ -fix-requirements.txt.patch flake8-legacy.patch diff -Nru python-hacking-0.12.0/debian/rules python-hacking-1.1.0/debian/rules --- python-hacking-0.12.0/debian/rules 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/rules 2018-10-01 16:25:24.000000000 +0000 @@ -1,13 +1,8 @@ #!/usr/bin/make -f -PYTHONS:=$(shell pyversions -vr) -PYTHON3S:=$(shell py3versions -vr) - -UPSTREAM_GIT = git://github.com/openstack-dev/hacking.git +UPSTREAM_GIT := https://github.com/openstack-dev/hacking.git include /usr/share/openstack-pkg-tools/pkgos.make -export OSLO_PACKAGE_VERSION=$(VERSION) - export http_proxy=127.0.0.1:9 export https_proxy=127.0.0.1:9 @@ -15,33 +10,22 @@ dh $@ --buildsystem=python_distutils --with python2,python3,sphinxdoc override_dh_auto_install: - set -e && for pyvers in $(PYTHONS); do \ - python$$pyvers setup.py install --install-layout=deb \ - --root $(CURDIR)/debian/python-hacking; \ - done - set -e && for pyvers in $(PYTHON3S); do \ - python$$pyvers setup.py install --install-layout=deb \ - --root $(CURDIR)/debian/python3-hacking; \ - done + pkgos-dh_auto_install + +override_dh_python3: + dh_python3 --shebang=/usr/bin/python3 override_dh_sphinxdoc: ifeq (,$(findstring nodocs, $(DEB_BUILD_OPTIONS))) - sphinx-build -b html doc/source $(CURDIR)/debian/python-hacking-doc/usr/share/doc/python-hacking-doc/html + python3 -m sphinx -b html doc/source $(CURDIR)/debian/python-hacking-doc/usr/share/doc/python-hacking-doc/html dh_sphinxdoc -O--buildsystem=python_distutils endif override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) - rm -rf .testrepository - testr init - set -e && \ - TEMP_REZ=`mktemp -t` && \ - PYTHONPATH=$(CURDIR) testr run --subunit | tee $$TEMP_REZ | subunit2pyunit; \ - cat $$TEMP_REZ | subunit-filter -s --no-passthrough | subunit-stats; \ - rm -f $$TEMP_REZ ; - testr slowest + pkgos-dh_auto_test endif override_dh_clean: dh_clean -O--buildsystem=python_distutils - rm -rf .testrepository build *.egg-info + rm -rf .testrepository diff -Nru python-hacking-0.12.0/debian/source/options python-hacking-1.1.0/debian/source/options --- python-hacking-0.12.0/debian/source/options 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/debian/source/options 2018-10-01 16:25:24.000000000 +0000 @@ -0,0 +1 @@ +extend-diff-ignore = "^[.]gitreview$" diff -Nru python-hacking-0.12.0/debian/watch python-hacking-1.1.0/debian/watch --- python-hacking-0.12.0/debian/watch 2016-12-07 19:44:33.000000000 +0000 +++ python-hacking-1.1.0/debian/watch 2018-10-01 16:25:24.000000000 +0000 @@ -1,2 +1,2 @@ version=3 -http://pypi.debian.net/hacking/hacking-(.*).tar.gz +https://pypi.debian.net/hacking/hacking-(.*).tar.gz diff -Nru python-hacking-0.12.0/doc/source/conf.py python-hacking-1.1.0/doc/source/conf.py --- python-hacking-0.12.0/doc/source/conf.py 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/doc/source/conf.py 2018-05-07 13:06:05.000000000 +0000 @@ -8,7 +8,12 @@ # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'oslosphinx'] +extensions = ['sphinx.ext.autodoc', 'openstackdocstheme'] + +# openstackdocstheme options +repository_name = 'openstack-dev/hacking' +bug_project = 'hacking' +bug_tag = '' # autodoc generation is a bit aggressive and a nuisance when doing heavy # text edit cycles. @@ -39,6 +44,9 @@ # -- Options for HTML output -------------------------------------------------- +html_theme = 'openstackdocs' +html_last_updated_fmt = '%Y-%m-%d %H:%M' + # Output file base name for HTML help builder. htmlhelp_basename = '%sdoc' % project diff -Nru python-hacking-0.12.0/doc/source/index.rst python-hacking-1.1.0/doc/source/index.rst --- python-hacking-0.12.0/doc/source/index.rst 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/doc/source/index.rst 2018-05-07 13:06:05.000000000 +0000 @@ -1,9 +1,14 @@ -.. include:: ../../HACKING.rst +================================================ +hacking: OpenStack Hacking Guideline Enforcement +================================================ -Readme -====== +hacking is a set of flake8 plugins that test and enforce the :ref:`StyleGuide`. + +Hacking pins its dependencies, as a new release of some dependency can break +hacking based gating jobs. This is because new versions of dependencies can +introduce new rules, or make existing rules stricter. .. toctree:: - :maxdepth: 1 + :maxdepth: 3 - readme + user/index diff -Nru python-hacking-0.12.0/doc/source/readme.rst python-hacking-1.1.0/doc/source/readme.rst --- python-hacking-0.12.0/doc/source/readme.rst 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/doc/source/readme.rst 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -.. include:: ../../README.rst diff -Nru python-hacking-0.12.0/doc/source/user/hacking.rst python-hacking-1.1.0/doc/source/user/hacking.rst --- python-hacking-0.12.0/doc/source/user/hacking.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/doc/source/user/hacking.rst 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1 @@ +.. include:: ../../../HACKING.rst diff -Nru python-hacking-0.12.0/doc/source/user/index.rst python-hacking-1.1.0/doc/source/user/index.rst --- python-hacking-0.12.0/doc/source/user/index.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/doc/source/user/index.rst 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,9 @@ +================== +User Documentation +================== + +.. toctree:: + :maxdepth: 2 + + hacking + usage diff -Nru python-hacking-0.12.0/doc/source/user/usage.rst python-hacking-1.1.0/doc/source/user/usage.rst --- python-hacking-0.12.0/doc/source/user/usage.rst 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/doc/source/user/usage.rst 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,5 @@ +============= +Using hacking +============= + +.. include:: ../../../README.rst diff -Nru python-hacking-0.12.0/.gitignore python-hacking-1.1.0/.gitignore --- python-hacking-0.12.0/.gitignore 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/.gitignore 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,33 @@ +# Compiled files +*.py[co] +*.a +*.o +*.so + +# Sphinx +_build + +# Packages/installer info +*.egg +*.egg-info +dist +build +eggs +parts +bin +var +sdist +develop-eggs +.installed.cfg + +# Other +.testrepository +.tox +.*.swp +.coverage +cover +AUTHORS +ChangeLog + +# Editors +*~ diff -Nru python-hacking-0.12.0/.gitreview python-hacking-1.1.0/.gitreview --- python-hacking-0.12.0/.gitreview 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/.gitreview 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,4 @@ +[gerrit] +host=review.openstack.org +port=29418 +project=openstack-dev/hacking.git diff -Nru python-hacking-0.12.0/hacking/checks/except_checks.py python-hacking-1.1.0/hacking/checks/except_checks.py --- python-hacking-0.12.0/hacking/checks/except_checks.py 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/hacking/checks/except_checks.py 2018-05-07 13:06:05.000000000 +0000 @@ -71,6 +71,15 @@ return isinstance(node, ast.NameConstant) and node.value is None +def _get_local_func_name(node): + if isinstance(node.func, ast.Attribute): + return node.func.attr + elif isinstance(node.func, ast.Name): + return node.func.id + else: + return None + + class NoneArgChecker(ast.NodeVisitor): '''NodeVisitor to check function calls for None arguments. @@ -85,12 +94,7 @@ self.none_found = False def visit_Call(self, node): - if isinstance(node.func, ast.Attribute): - local_func_name = node.func.attr - elif isinstance(node.func, ast.Name): - local_func_name = node.func.id - else: # ast.Subscript, etc. -- ignore - local_func_name = None + local_func_name = _get_local_func_name(node) if local_func_name == self.func_name: args_to_check = node.args[:self.num_args] @@ -129,3 +133,92 @@ checker.visit(ast.parse(logical_line)) if checker.none_found: yield start, "H203: Use assertIs(Not)None to check for None" + + +class AssertTrueFalseChecker(ast.NodeVisitor): + '''NodeVisitor to find "assert[True|False](some comparison)" statements. + + :param method_names: methods to look for: assertTrue and/or assertFalse + :param ops: list of comparisons we want to look for (objects from the ast + module) + ''' + def __init__(self, method_names, ops): + self.method_names = method_names + self.ops = tuple(ops) + self.error = False + + def visit_Call(self, node): + # No need to keep visiting the AST if we already found something. + if self.error: + return + + self.generic_visit(node) + + local_func_name = _get_local_func_name(node) + + if (local_func_name in self.method_names and + len(node.args) == 1 and + isinstance(node.args[0], ast.Compare) and + len(node.args[0].ops) == 1 and + isinstance(node.args[0].ops[0], self.ops)): + self.error = True + + +@core.flake8ext +@core.off_by_default +def hacking_assert_equal(logical_line, noqa): + r"""Check that self.assertEqual and self.assertNotEqual are used. + + Okay: self.assertEqual(x, y) + Okay: self.assertNotEqual(x, y) + H204: self.assertTrue(x == y) + H204: self.assertTrue(x != y) + H204: self.assertFalse(x == y) + H204: self.assertFalse(x != y) + """ + if noqa: + return + + methods = ['assertTrue', 'assertFalse'] + for method in methods: + start = logical_line.find('.%s' % method) + 1 + if start != 0: + break + else: + return + comparisons = [ast.Eq, ast.NotEq] + checker = AssertTrueFalseChecker(methods, comparisons) + checker.visit(ast.parse(logical_line)) + if checker.error: + yield start, 'H204: Use assert(Not)Equal()' + + +@core.flake8ext +@core.off_by_default +def hacking_assert_greater_less(logical_line, noqa): + r"""Check that self.assert{Greater,Less}[Equal] are used. + + Okay: self.assertGreater(x, y) + Okay: self.assertGreaterEqual(x, y) + Okay: self.assertLess(x, y) + Okay: self.assertLessEqual(x, y) + H205: self.assertTrue(x > y) + H205: self.assertTrue(x >= y) + H205: self.assertTrue(x < y) + H205: self.assertTrue(x <= y) + """ + if noqa: + return + + methods = ['assertTrue', 'assertFalse'] + for method in methods: + start = logical_line.find('.%s' % method) + 1 + if start != 0: + break + else: + return + comparisons = [ast.Gt, ast.GtE, ast.Lt, ast.LtE] + checker = AssertTrueFalseChecker(methods, comparisons) + checker.visit(ast.parse(logical_line)) + if checker.error: + yield start, 'H205: Use assert{Greater,Less}[Equal]' diff -Nru python-hacking-0.12.0/hacking/checks/localization.py python-hacking-1.1.0/hacking/checks/localization.py --- python-hacking-0.12.0/hacking/checks/localization.py 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/hacking/checks/localization.py 2018-05-07 13:06:05.000000000 +0000 @@ -16,14 +16,14 @@ from hacking import core -FORMAT_RE = re.compile("%(?:" - "%|" # Ignore plain percents - "(\(\w+\))?" # mapping key - "([#0 +-]?" # flag - "(?:\d+|\*)?" # width - "(?:\.\d+)?" # precision - "[hlL]?" # length mod - "\w))") # type +FORMAT_RE = re.compile(r"%(?:" + r"%|" # Ignore plain percents + r"(\(\w+\))?" # mapping key + r"([#0 +-]?" # flag + r"(?:\d+|\*)?" # width + r"(?:\.\d+)?" # precision + r"[hlL]?" # length mod + r"\w))") # type class LocalizationError(Exception): diff -Nru python-hacking-0.12.0/hacking/checks/mock_checks.py python-hacking-1.1.0/hacking/checks/mock_checks.py --- python-hacking-0.12.0/hacking/checks/mock_checks.py 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/hacking/checks/mock_checks.py 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,141 @@ +# Licensed under the Apache License, Version 2.0 (the "License"); you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. + +import ast + +from hacking import core + + +@core.off_by_default +@core.flake8ext +class MockAutospecCheck(object): + """Check for 'autospec' in mock.patch/mock.patch.object calls + + Okay: mock.patch('target_module_1', autospec=True) + Okay: mock.patch('target_module_1', autospec=False) + Okay: mock.patch('target_module_1', autospec=None) + Okay: mock.patch('target_module_1', defined_mock) + Okay: mock.patch('target_module_1', new=defined_mock) + Okay: mock.patch('target_module_1', new_callable=SomeFunc) + Okay: mock.patch('target_module_1', defined_mock) + Okay: mock.patch('target_module_1', spec=1000) + Okay: mock.patch('target_module_1', spec_set=['data']) + Okay: mock.patch('target_module_1', wraps=some_obj) + + H210: mock.patch('target_module_1') + Okay: mock.patch('target_module_1') # noqa + H210: mock.patch('target_module_1', somearg=23) + Okay: mock.patch('target_module_1', somearg=23) # noqa + + Okay: mock.patch.object('target_module_2', 'attribute', autospec=True) + Okay: mock.patch.object('target_module_2', 'attribute', autospec=False) + Okay: mock.patch.object('target_module_2', 'attribute', autospec=None) + Okay: mock.patch.object('target_module_2', 'attribute', new=defined_mock) + Okay: mock.patch.object('target_module_2', 'attribute', defined_mock) + Okay: mock.patch.object('target_module_2', 'attribute', new_callable=AFunc) + Okay: mock.patch.object('target_module_2', 'attribute', spec=3) + Okay: mock.patch.object('target_module_2', 'attribute', spec_set=[3]) + Okay: mock.patch.object('target_module_2', 'attribute', wraps=some_obj) + + + H210: mock.patch.object('target_module_2', 'attribute', somearg=2) + H210: mock.patch.object('target_module_2', 'attribute') + + """ + + name = "mock_check" + version = "1.00" + + def __init__(self, tree, filename): + self.filename = filename + self.tree = tree + + def run(self): + mcv = MockCheckVisitor(self.filename) + mcv.visit(self.tree) + for message in mcv.messages: + yield message + + +class MockCheckVisitor(ast.NodeVisitor): + # Patchers we are looking for and minimum number of 'args' without + # 'autospec' to not be flagged + patchers = {'mock.patch': 2, 'mock.patch.object': 3} + spec_keywords = {"autospec", "new", "new_callable", "spec", "spec_set", + "wraps"} + + def __init__(self, filename): + super(MockCheckVisitor, self).__init__() + self.messages = [] + self.filename = filename + + def check_missing_autospec(self, call_node): + + def find_autospec_keyword(keyword_node): + for keyword_obj in keyword_node: + keyword = keyword_obj.arg + # If they have defined autospec or new then it is okay + if keyword in self.spec_keywords: + return True + return False + + if isinstance(call_node, ast.Call): + func_info = FunctionNameFinder(self.filename) + func_info.visit(call_node) + + # We are only looking at our patchers + if func_info.function_name not in self.patchers: + return + + min_args = self.patchers[func_info.function_name] + + if not find_autospec_keyword(call_node.keywords): + if len(call_node.args) < min_args: + self.messages.append( + (call_node.lineno, call_node.col_offset, + "H210 Missing 'autospec' or 'spec_set' keyword in " + "mock.patch/mock.patch.object", MockCheckVisitor) + ) + + def visit_Call(self, node): + self.check_missing_autospec(node) + self.generic_visit(node) + + +class FunctionNameFinder(ast.NodeVisitor): + """Finds the name of the function""" + def __init__(self, filename): + super(FunctionNameFinder, self).__init__() + self._func_name = [] + self.filename = filename + + @property + def function_name(self): + return '.'.join(reversed(self._func_name)) + + def visit_Name(self, node): + self._func_name.append(node.id) + self.generic_visit(node) + + def visit_Attribute(self, node): + try: + self._func_name.append(node.attr) + self._func_name.append(node.value.id) + except AttributeError: + self.generic_visit(node) + + def visit(self, node): + # If we get called with an ast.Call node, then work on the 'node.func', + # as we want the function name. + if isinstance(node, ast.Call): + return super(FunctionNameFinder, self).visit(node.func) + return super(FunctionNameFinder, self).visit(node) diff -Nru python-hacking-0.12.0/hacking/core.py python-hacking-1.1.0/hacking/core.py --- python-hacking-0.12.0/hacking/core.py 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/hacking/core.py 2018-05-07 13:06:05.000000000 +0000 @@ -15,14 +15,14 @@ """OpenStack HACKING file compliance testing -Built as a sets of pep8 checks using flake8. +Built as a sets of pycodestyle checks using flake8. """ import gettext import sys import pbr.util -import pep8 +import pycodestyle from hacking import config @@ -127,8 +127,8 @@ Store in a global registry the list of checks we've run. If we have run that one before, just skip doing anything the subsequent times. - This way, since pep8 is file/line based, we don't wind up re-running - a check on a git commit message over and over again. + This way, since pycodestyle is file/line based, we don't wind + up re-running a check on a git commit message over and over again. """ if self.name and self.name not in self.__class__._has_run: self.__class__._has_run.add(self.name) @@ -154,11 +154,11 @@ for check_path in set(local_check): if check_path.strip(): checker = pbr.util.resolve_name(check_path) - pep8.register_check(checker) + pycodestyle.register_check(checker) local_check_fact = CONF.get('local-check-factory') if local_check_fact: factory = pbr.util.resolve_name(local_check_fact) - factory(pep8.register_check) + factory(pycodestyle.register_check) sys.path.pop() diff -Nru python-hacking-0.12.0/hacking/tests/test_doctest.py python-hacking-1.1.0/hacking/tests/test_doctest.py --- python-hacking-0.12.0/hacking/tests/test_doctest.py 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/hacking/tests/test_doctest.py 2018-05-07 13:06:05.000000000 +0000 @@ -17,7 +17,8 @@ import re from flake8 import engine -import pep8 +import pycodestyle + import pkg_resources import six import testscenarios @@ -36,17 +37,17 @@ scenarios = file_cases - def test_pep8(self): + def test_pycodestyle(self): # NOTE(jecarey): Add tests marked as off_by_default to enable testing - turn_on = set(['H106', 'H203', 'H904']) + turn_on = set(['H106', 'H203', 'H904', 'H204', 'H205', 'H210']) if self.options.select: turn_on.update(self.options.select) self.options.select = tuple(turn_on) - report = pep8.BaseReport(self.options) - checker = pep8.Checker(lines=self.lines, options=self.options, - report=report) + report = pycodestyle.BaseReport(self.options) + checker = pycodestyle.Checker(lines=self.lines, options=self.options, + report=report) checker.check_all() self.addDetail('doctest', content.text_content(self.raw)) if self.code == 'Okay': diff -Nru python-hacking-0.12.0/hacking/tests/test_local.py python-hacking-1.1.0/hacking/tests/test_local.py --- python-hacking-0.12.0/hacking/tests/test_local.py 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/hacking/tests/test_local.py 2018-05-07 13:06:05.000000000 +0000 @@ -14,7 +14,7 @@ # limitations under the License. from flake8 import engine -import pep8 +import pycodestyle import hacking.tests @@ -28,9 +28,9 @@ class HackingTestCase(hacking.tests.TestCase): def test_local_check(self): flake8_style = engine.get_style_guide(parse_argv=False, ignore='F') - report = pep8.BaseReport(flake8_style.options) + report = pycodestyle.BaseReport(flake8_style.options) line = ["#this-is-the-test-phrase"] - checker = pep8.Checker(lines=line, options=flake8_style.options, - report=report) + checker = pycodestyle.Checker(lines=line, options=flake8_style.options, + report=report) checker.check_all() self.assertIn("L100", report.counters) diff -Nru python-hacking-0.12.0/hacking.egg-info/dependency_links.txt python-hacking-1.1.0/hacking.egg-info/dependency_links.txt --- python-hacking-0.12.0/hacking.egg-info/dependency_links.txt 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/hacking.egg-info/dependency_links.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ - diff -Nru python-hacking-0.12.0/hacking.egg-info/entry_points.txt python-hacking-1.1.0/hacking.egg-info/entry_points.txt --- python-hacking-0.12.0/hacking.egg-info/entry_points.txt 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/hacking.egg-info/entry_points.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -[flake8.extension] -H000 = hacking.core:ProxyChecks -H101 = hacking.checks.comments:hacking_todo_format -H102 = hacking.checks.comments:hacking_has_license -H103 = hacking.checks.comments:hacking_has_correct_license -H104 = hacking.checks.comments:hacking_has_only_comments -H105 = hacking.checks.comments:hacking_no_author_tags -H106 = hacking.checks.vim_check:no_vim_headers -H201 = hacking.checks.except_checks:hacking_except_format -H202 = hacking.checks.except_checks:hacking_except_format_assert -H203 = hacking.checks.except_checks:hacking_assert_is_none -H231 = hacking.checks.python23:hacking_python3x_except_compatible -H232 = hacking.checks.python23:hacking_python3x_octal_literals -H233 = hacking.checks.python23:hacking_python3x_print_function -H234 = hacking.checks.python23:hacking_no_assert_equals -H235 = hacking.checks.python23:hacking_no_assert_underscore -H236 = hacking.checks.python23:hacking_python3x_metaclass -H237 = hacking.checks.python23:hacking_no_removed_module -H238 = hacking.checks.python23:hacking_no_old_style_class -H301 = hacking.checks.imports:hacking_import_rules -H306 = hacking.checks.imports:hacking_import_alphabetical -H401 = hacking.checks.docstrings:hacking_docstring_start_space -H403 = hacking.checks.docstrings:hacking_docstring_multiline_end -H404 = hacking.checks.docstrings:hacking_docstring_multiline_start -H405 = hacking.checks.docstrings:hacking_docstring_summary -H501 = hacking.checks.dictlist:hacking_no_locals -H700 = hacking.checks.localization:hacking_localization_strings -H903 = hacking.checks.other:hacking_no_cr -H904 = hacking.checks.other:hacking_delayed_string_interpolation - diff -Nru python-hacking-0.12.0/hacking.egg-info/not-zip-safe python-hacking-1.1.0/hacking.egg-info/not-zip-safe --- python-hacking-0.12.0/hacking.egg-info/not-zip-safe 2016-11-07 20:34:19.000000000 +0000 +++ python-hacking-1.1.0/hacking.egg-info/not-zip-safe 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ - diff -Nru python-hacking-0.12.0/hacking.egg-info/pbr.json python-hacking-1.1.0/hacking.egg-info/pbr.json --- python-hacking-0.12.0/hacking.egg-info/pbr.json 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/hacking.egg-info/pbr.json 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -{"is_release": true, "git_version": "6be124c"} \ No newline at end of file diff -Nru python-hacking-0.12.0/hacking.egg-info/PKG-INFO python-hacking-1.1.0/hacking.egg-info/PKG-INFO --- python-hacking-0.12.0/hacking.egg-info/PKG-INFO 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/hacking.egg-info/PKG-INFO 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -Metadata-Version: 1.1 -Name: hacking -Version: 0.12.0 -Summary: OpenStack Hacking Guideline Enforcement -Home-page: http://docs.openstack.org/developer/hacking/ -Author: OpenStack -Author-email: openstack-dev@lists.openstack.org -License: UNKNOWN -Description: Introduction - ============ - - hacking is a set of flake8 plugins that test and enforce the :ref:`StyleGuide`. - - Hacking pins its dependencies, as a new release of some dependency can break - hacking based gating jobs. This is because new versions of dependencies can - introduce new rules, or make existing rules stricter. - - Installation - ============ - - hacking is available from pypi, so just run: - - ``pip install hacking`` - - This will install specific versions of ``flake8`` with the ``hacking``, - ``pep8``, ``mccabe`` and ``pyflakes`` plugins. - - Origin - ====== - - Hacking started its life out as a text file in Nova's first commit. It was - initially based on the `Google Python Style Guide`_, and over time more - OpenStack specific rules were added. Hacking serves several purposes: - - 1. Agree on a common style guide so reviews don't get bogged down on style - nit picks. (example: docstring guidelines) - 2. Make code written by many different authors easier to read by making the - style more uniform. (example: unix vs windows newlines) - 3. Call out dangerous patterns and avoid them. (example: shadowing built-in - or reserved words) - - Initially the hacking style guide was enforced manually by reviewers, but this - was a big waste of time so hacking, the tool, was born to automate - the process and remove the extra burden from human reviewers. - - .. _`Google Python Style Guide`: https://google.github.io/styleguide/pyguide.html - - Versioning - ========== - - hacking uses the ``major.minor.maintenance`` release notation, where maintenance - releases cannot contain new checks. This way projects can gate on hacking - by pinning on the ``major.minor`` number while accepting maintenance updates - without being concerned that a new version will break the gate with a new - check. - - For example a project can depend on ``hacking>=0.10.0,<0.11.0``, and can know - that ``0.10.1`` will not fail in places where ``0.10.0`` passed. - - - Adding additional checks - ======================== - - Each check is a pep8 plugin so read - - - https://github.com/jcrocholl/pep8/blob/master/docs/developer.rst#contribute - - The focus of new or changed rules should be to do one of the following - - - Substantially increase the reviewability of the code (eg: H301, H303) - as they make it easy to understand where symbols come from) - - Catch a common programming error that may arise in the future (H201) - - Prevent a situation that would 100% of the time be -1ed by - developers (H903) - - But, as always, remember that these are Guidelines. Treat them as - such. There are always times for exceptions. All new rules should - support noqa. - - If a check needs to be staged in, or it does not apply to every project or its - branch, it can be added as off by default. - - Requirements - ------------ - - The check must already have community support. We do not want to dictate - style, only enforce it. - - The canonical source of the OpenStack Style Guidelines is :ref:`StyleGuide`, - and hacking just enforces - them; so when adding a new check, it must be in ``HACKING.rst`` - - False negatives are ok, but false positives are not - - Cannot be project specific, project specific checks should be `Local Checks`_ - - Include extensive tests - - Registered as entry_points in `setup.cfg `_ - - Error code must be in the relevant ``Hxxx`` group - - The check should not attempt to import modules from the code being checked. - Importing random modules, has caused all kinds of trouble for us in the past. - - - Enabling off-by-default checks - ============================== - - Some of the available checks are disabled by default. These checks are: - - - [H106] Don't put vim configuration in source files. - - [H203] Use assertIs(Not)None to check for None. - - [H904] Delay string interpolations at logging calls. - - To enable these checks, edit the ``flake8`` section of the ``tox.ini`` file. - For example to enable H106 and H203: - - .. code-block:: ini - - [flake8] - enable-extensions = H106,H203 - - Local Checks - ============ - - hacking supports having local changes in a source tree. They can be configured - to run in two different ways. They can be registered individually, or with - a factory function. - - For individual registration, put a comma separated list of pep8 compatible - check functions into the hacking section of tox.ini. E.g.: - - .. code-block:: ini - - [hacking] - local-check = nova.tests.hacking.bad_code_is_terrible - - Alternately, you can specify the location of a callable that will be called - at registration time and will be passed the registration function. The callable - should expect to call the passed in function on everything if wants to - register. Such as: - - .. code-block:: ini - - [hacking] - local-check-factory = nova.tests.hacking.factory - - -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Environment :: Console -Classifier: Environment :: OpenStack -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: Information Technology -Classifier: License :: OSI Approved :: Apache Software License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 diff -Nru python-hacking-0.12.0/hacking.egg-info/requires.txt python-hacking-1.1.0/hacking.egg-info/requires.txt --- python-hacking-0.12.0/hacking.egg-info/requires.txt 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/hacking.egg-info/requires.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,9 +0,0 @@ -pbr>=1.6 -pep8==1.5.7 -pyflakes==0.8.1 -flake8<2.6.0,>=2.5.4 -mccabe==0.2.1 -six>=1.9.0 - -[pep257] -flake8-docstrings==0.2.1.post1 # MIT diff -Nru python-hacking-0.12.0/hacking.egg-info/SOURCES.txt python-hacking-1.1.0/hacking.egg-info/SOURCES.txt --- python-hacking-0.12.0/hacking.egg-info/SOURCES.txt 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/hacking.egg-info/SOURCES.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,51 +0,0 @@ -.mailmap -.testr.conf -AUTHORS -CONTRIBUTING.rst -ChangeLog -HACKING.rst -LICENSE -MANIFEST.in -README.rst -requirements.txt -setup.cfg -setup.py -test-requirements.txt -tox.ini -doc/source/conf.py -doc/source/index.rst -doc/source/readme.rst -hacking/__init__.py -hacking/config.py -hacking/core.py -hacking.egg-info/PKG-INFO -hacking.egg-info/SOURCES.txt -hacking.egg-info/dependency_links.txt -hacking.egg-info/entry_points.txt -hacking.egg-info/not-zip-safe -hacking.egg-info/pbr.json -hacking.egg-info/requires.txt -hacking.egg-info/top_level.txt -hacking/checks/__init__.py -hacking/checks/comments.py -hacking/checks/dictlist.py -hacking/checks/docstrings.py -hacking/checks/except_checks.py -hacking/checks/imports.py -hacking/checks/localization.py -hacking/checks/other.py -hacking/checks/python23.py -hacking/checks/vim_check.py -hacking/tests/__init__.py -hacking/tests/test_config.py -hacking/tests/test_doctest.py -hacking/tests/test_import_exceptions.py -hacking/tests/test_local.py -hacking/tests/checks/__init__.py -hacking/tests/checks/test_comments.py -integration-test/test.sh -releasenotes/notes/.placeholder -releasenotes/source/conf.py -releasenotes/source/index.rst -releasenotes/source/unreleased.rst -releasenotes/source/_static/.placeholder \ No newline at end of file diff -Nru python-hacking-0.12.0/hacking.egg-info/top_level.txt python-hacking-1.1.0/hacking.egg-info/top_level.txt --- python-hacking-0.12.0/hacking.egg-info/top_level.txt 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/hacking.egg-info/top_level.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -hacking diff -Nru python-hacking-0.12.0/HACKING.rst python-hacking-1.1.0/HACKING.rst --- python-hacking-0.12.0/HACKING.rst 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/HACKING.rst 2018-05-07 13:06:05.000000000 +0000 @@ -58,6 +58,9 @@ - [H306] Alphabetically order your imports by the full module path. Organize your imports according to the `Import order template`_ and `Real-world Import Order Examples`_ below. + For the purposes of import order, OpenStack projects other than the + one to which the file belongs are considered "third party". Only + imports from the same Git repo are considered "project imports" (*) exceptions are: @@ -222,7 +225,7 @@ .. seealso:: - * `oslo.i18n Guidelines `__ + * `oslo.i18n Guidelines `__ Python 3.x compatibility ------------------------ @@ -311,11 +314,43 @@ ``assertIsNotNone(...)`` is preferred over ``assertNotEqual(None, ...)`` and ``assertIsNot(None, ...)``. Off by default. +- [H204] Use assert(Not)Equal to check for equality. + Unit test assertions tend to give better messages for more specific + assertions. As a result, ``assertEqual(...)`` is preferred over + ``assertTrue(... == ...)``, and ``assertNotEqual(...)`` is preferred over + ``assertFalse(... == ...)``. Off by default. + +- [H205] Use assert(Greater|Less)(Equal) for comparison. + Unit test assertions tend to give better messages for more specific + assertions. As a result, ``assertGreater(Equal)(...)`` is preferred over + ``assertTrue(... >(=) ...)``, and ``assertLess(Equal)(...)`` is preferred over + ``assertTrue(... <(=) ...)``. Off by default. + +- [H210] Require ``autospec``, ``spec``, or ``spec_set`` in ``mock.patch()`` or + ``mock.patch.object()`` calls (off by default) + + Users of ``mock.patch()`` or ``mock.patch.object()`` may think they are doing + a correct assertion for example:: + + my_mock_obj.called_once_with() + + When the correct call is:: + + my_mock_obj.assert_called_once_with() + + By using ``autospec=True`` those kind of errors can be caught. This test does + not force them to use ``autospec=True``, but requires that they define some + value for ``autospec``, ``spec``, or ``spec_set``. It could be + ``autospec=False``. We just want them to make a conscious decision on using + or not using ``autospec``. If any of the following are used then ``autospec`` + will not be required: ``new``, ``new_callable``, ``spec``, ``spec_set``, + ``wraps`` + OpenStack Trademark ------------------- OpenStack is a registered trademark of the OpenStack Foundation, and uses the -following capitalization: +following capitalization:: OpenStack @@ -349,5 +384,4 @@ For further information on constructing high quality commit messages, and how to split up commits into a series of changes, consult the project wiki: - - https://wiki.openstack.org/GitCommitMessages +https://wiki.openstack.org/GitCommitMessages diff -Nru python-hacking-0.12.0/integration-test/test.sh python-hacking-1.1.0/integration-test/test.sh --- python-hacking-0.12.0/integration-test/test.sh 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/integration-test/test.sh 2018-05-07 13:06:05.000000000 +0000 @@ -10,6 +10,7 @@ set -e REPO_ROOT=${REPO_ROOT:-git://git.openstack.org} +HACKING="$(pwd)" if [[ $# -lt 2 ]] ; then echo "Script needs at least two arguments:" @@ -38,9 +39,20 @@ pushd $projectdir set +e + +# Install project with test-requirements so that hacking's +# local-check-factory works +pip install -r test-requirements.txt +pip install . +# Reinstall hacking, the above might have uninstalled it +pip install $HACKING + flake8 --select H --statistics +RET=$? popd if [ "$clone" = "1" ] ; then popd fi + +exit $RET diff -Nru python-hacking-0.12.0/lower-constraints.txt python-hacking-1.1.0/lower-constraints.txt --- python-hacking-0.12.0/lower-constraints.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/lower-constraints.txt 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,36 @@ +alabaster==0.7.10 +Babel==2.3.4 +coverage==4.0 +docutils==0.11 +dulwich==0.15.0 +eventlet==0.18.2 +extras==1.0.0 +fixtures==3.0.0 +flake8==2.6.2 +greenlet==0.4.10 +imagesize==0.7.1 +Jinja2==2.10 +linecache2==1.0.0 +MarkupSafe==1.0 +mccabe==0.5.3 +mock==2.0.0 +openstackdocstheme==1.18.1 +pbr==2.0.0 +pycodestyle==2.0.0 +pyflakes==1.2.3 +Pygments==2.2.0 +python-mimeparse==1.6.0 +python-subunit==1.0.0 +pytz==2013.6 +PyYAML==3.12 +reno==2.5.0 +requests==2.14.2 +six==1.10.0 +snowballstemmer==1.2.1 +Sphinx==1.6.5 +sphinxcontrib-websupport==1.0.1 +testrepository==0.0.18 +testscenarios==0.4 +testtools==2.2.0 +traceback2==1.4.0 +unittest2==1.1.0 diff -Nru python-hacking-0.12.0/PKG-INFO python-hacking-1.1.0/PKG-INFO --- python-hacking-0.12.0/PKG-INFO 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/PKG-INFO 1970-01-01 00:00:00.000000000 +0000 @@ -1,156 +0,0 @@ -Metadata-Version: 1.1 -Name: hacking -Version: 0.12.0 -Summary: OpenStack Hacking Guideline Enforcement -Home-page: http://docs.openstack.org/developer/hacking/ -Author: OpenStack -Author-email: openstack-dev@lists.openstack.org -License: UNKNOWN -Description: Introduction - ============ - - hacking is a set of flake8 plugins that test and enforce the :ref:`StyleGuide`. - - Hacking pins its dependencies, as a new release of some dependency can break - hacking based gating jobs. This is because new versions of dependencies can - introduce new rules, or make existing rules stricter. - - Installation - ============ - - hacking is available from pypi, so just run: - - ``pip install hacking`` - - This will install specific versions of ``flake8`` with the ``hacking``, - ``pep8``, ``mccabe`` and ``pyflakes`` plugins. - - Origin - ====== - - Hacking started its life out as a text file in Nova's first commit. It was - initially based on the `Google Python Style Guide`_, and over time more - OpenStack specific rules were added. Hacking serves several purposes: - - 1. Agree on a common style guide so reviews don't get bogged down on style - nit picks. (example: docstring guidelines) - 2. Make code written by many different authors easier to read by making the - style more uniform. (example: unix vs windows newlines) - 3. Call out dangerous patterns and avoid them. (example: shadowing built-in - or reserved words) - - Initially the hacking style guide was enforced manually by reviewers, but this - was a big waste of time so hacking, the tool, was born to automate - the process and remove the extra burden from human reviewers. - - .. _`Google Python Style Guide`: https://google.github.io/styleguide/pyguide.html - - Versioning - ========== - - hacking uses the ``major.minor.maintenance`` release notation, where maintenance - releases cannot contain new checks. This way projects can gate on hacking - by pinning on the ``major.minor`` number while accepting maintenance updates - without being concerned that a new version will break the gate with a new - check. - - For example a project can depend on ``hacking>=0.10.0,<0.11.0``, and can know - that ``0.10.1`` will not fail in places where ``0.10.0`` passed. - - - Adding additional checks - ======================== - - Each check is a pep8 plugin so read - - - https://github.com/jcrocholl/pep8/blob/master/docs/developer.rst#contribute - - The focus of new or changed rules should be to do one of the following - - - Substantially increase the reviewability of the code (eg: H301, H303) - as they make it easy to understand where symbols come from) - - Catch a common programming error that may arise in the future (H201) - - Prevent a situation that would 100% of the time be -1ed by - developers (H903) - - But, as always, remember that these are Guidelines. Treat them as - such. There are always times for exceptions. All new rules should - support noqa. - - If a check needs to be staged in, or it does not apply to every project or its - branch, it can be added as off by default. - - Requirements - ------------ - - The check must already have community support. We do not want to dictate - style, only enforce it. - - The canonical source of the OpenStack Style Guidelines is :ref:`StyleGuide`, - and hacking just enforces - them; so when adding a new check, it must be in ``HACKING.rst`` - - False negatives are ok, but false positives are not - - Cannot be project specific, project specific checks should be `Local Checks`_ - - Include extensive tests - - Registered as entry_points in `setup.cfg `_ - - Error code must be in the relevant ``Hxxx`` group - - The check should not attempt to import modules from the code being checked. - Importing random modules, has caused all kinds of trouble for us in the past. - - - Enabling off-by-default checks - ============================== - - Some of the available checks are disabled by default. These checks are: - - - [H106] Don't put vim configuration in source files. - - [H203] Use assertIs(Not)None to check for None. - - [H904] Delay string interpolations at logging calls. - - To enable these checks, edit the ``flake8`` section of the ``tox.ini`` file. - For example to enable H106 and H203: - - .. code-block:: ini - - [flake8] - enable-extensions = H106,H203 - - Local Checks - ============ - - hacking supports having local changes in a source tree. They can be configured - to run in two different ways. They can be registered individually, or with - a factory function. - - For individual registration, put a comma separated list of pep8 compatible - check functions into the hacking section of tox.ini. E.g.: - - .. code-block:: ini - - [hacking] - local-check = nova.tests.hacking.bad_code_is_terrible - - Alternately, you can specify the location of a callable that will be called - at registration time and will be passed the registration function. The callable - should expect to call the passed in function on everything if wants to - register. Such as: - - .. code-block:: ini - - [hacking] - local-check-factory = nova.tests.hacking.factory - - -Platform: UNKNOWN -Classifier: Development Status :: 4 - Beta -Classifier: Environment :: Console -Classifier: Environment :: OpenStack -Classifier: Intended Audience :: Developers -Classifier: Intended Audience :: Information Technology -Classifier: License :: OSI Approved :: Apache Software License -Classifier: Operating System :: OS Independent -Classifier: Programming Language :: Python -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 diff -Nru python-hacking-0.12.0/README.rst python-hacking-1.1.0/README.rst --- python-hacking-0.12.0/README.rst 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/README.rst 2018-05-07 13:06:05.000000000 +0000 @@ -10,9 +10,9 @@ Installation ============ -hacking is available from pypi, so just run: +hacking is available from pypi, so just run:: - ``pip install hacking`` + pip install hacking This will install specific versions of ``flake8`` with the ``hacking``, ``pep8``, ``mccabe`` and ``pyflakes`` plugins. @@ -82,7 +82,7 @@ - False negatives are ok, but false positives are not - Cannot be project specific, project specific checks should be `Local Checks`_ - Include extensive tests -- Registered as entry_points in `setup.cfg `_ +- Registered as entry_points in ``setup.cfg`` - Error code must be in the relevant ``Hxxx`` group - The check should not attempt to import modules from the code being checked. Importing random modules, has caused all kinds of trouble for us in the past. @@ -95,6 +95,10 @@ - [H106] Don't put vim configuration in source files. - [H203] Use assertIs(Not)None to check for None. +- [H204] Use assert(Not)Equal to check for equality. +- [H205] Use assert(Greater|Less)(Equal) for comparison. +- [H210] Require 'autospec', 'spec', or 'spec_set' in + mock.patch/mock.patch.object calls - [H904] Delay string interpolations at logging calls. To enable these checks, edit the ``flake8`` section of the ``tox.ini`` file. diff -Nru python-hacking-0.12.0/releasenotes/notes/rocky-intermediate-release-60db6e8f66539e4b.yaml python-hacking-1.1.0/releasenotes/notes/rocky-intermediate-release-60db6e8f66539e4b.yaml --- python-hacking-0.12.0/releasenotes/notes/rocky-intermediate-release-60db6e8f66539e4b.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/releasenotes/notes/rocky-intermediate-release-60db6e8f66539e4b.yaml 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,16 @@ +--- +prelude: | + This release includes below changes: + + - Transition to flake8 2.6.x: + + * flake8 2.6.x performed the conversion to pycodestyle (which is + the new name of pep8). Remove the explicit dependencies of + hacking as flake8 is going to pull in mccabe, pyflakes and + pycodestyle in the versions that are needed. + + - Allow 'wraps' to be an alternative to autospec: + + * Don't cause an H210 error if the mock.patch/mock.patch.object call uses + the 'wraps' keyword. As that serves the same purpose in catching wrong + attributes. diff -Nru python-hacking-0.12.0/releasenotes/notes/start-of-queens-c3024ebbb49aef6f.yaml python-hacking-1.1.0/releasenotes/notes/start-of-queens-c3024ebbb49aef6f.yaml --- python-hacking-0.12.0/releasenotes/notes/start-of-queens-c3024ebbb49aef6f.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/releasenotes/notes/start-of-queens-c3024ebbb49aef6f.yaml 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,10 @@ +--- +features: + - | + This release includes new checks, which are disabled by default: + + * [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls + + * [H204] Use assert(Not)Equal to check for equality. + + * [H205] Use assert(Greater|Less)(Equal) for comparison. diff -Nru python-hacking-0.12.0/releasenotes/source/conf.py python-hacking-1.1.0/releasenotes/source/conf.py --- python-hacking-0.12.0/releasenotes/source/conf.py 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/releasenotes/source/conf.py 2018-05-07 13:06:05.000000000 +0000 @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import pbr.version - # Hacking Release Notes documentation build configuration file, created by # sphinx-quickstart on Tue Nov 3 17:40:50 2015. # @@ -40,10 +38,15 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ - 'oslosphinx', + 'openstackdocstheme', 'reno.sphinxext', ] +# openstackdocstheme options +repository_name = 'openstack-dev/hacking' +bug_project = 'hacking' +bug_tag = '' + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -60,15 +63,11 @@ project = u'Hacking Release Notes' copyright = u'2015, Hacking Developers' -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. - -version_info = pbr.version.VersionInfo('hacking') +# Release notes are version independent # The short X.Y version. -release = version_info.version_string_with_vcs() +release = '' # The short X.Y version. -version = version_info.canonical_version_string() +version = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -113,7 +112,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. -html_theme = 'default' +html_theme = 'openstackdocs' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -142,7 +141,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +# html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied @@ -151,7 +150,7 @@ # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' +html_last_updated_fmt = '%Y-%m-%d %H:%M' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. diff -Nru python-hacking-0.12.0/requirements.txt python-hacking-1.1.0/requirements.txt --- python-hacking-0.12.0/requirements.txt 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/requirements.txt 2018-05-07 13:06:05.000000000 +0000 @@ -1,11 +1,7 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -pbr>=1.6 # Apache-2.0 +pbr!=2.1.0,>=2.0.0 # Apache-2.0 -pep8==1.5.7 # MIT -pyflakes==0.8.1 # MIT -flake8<2.6.0,>=2.5.4 # MIT -mccabe==0.2.1 # MIT License - -six>=1.9.0 # MIT +flake8<2.7.0,>=2.6.0 # MIT +six>=1.10.0 # MIT diff -Nru python-hacking-0.12.0/setup.cfg python-hacking-1.1.0/setup.cfg --- python-hacking-0.12.0/setup.cfg 2016-11-07 20:34:21.000000000 +0000 +++ python-hacking-1.1.0/setup.cfg 2018-05-07 13:06:05.000000000 +0000 @@ -3,77 +3,75 @@ author = OpenStack author-email = openstack-dev@lists.openstack.org summary = OpenStack Hacking Guideline Enforcement -description-file = - README.rst -home-page = http://docs.openstack.org/developer/hacking/ -classifier = - Development Status :: 4 - Beta - Environment :: Console - Environment :: OpenStack - Intended Audience :: Developers - Intended Audience :: Information Technology - License :: OSI Approved :: Apache Software License - Operating System :: OS Independent - Programming Language :: Python - Programming Language :: Python :: 2 - Programming Language :: Python :: 2.6 - Programming Language :: Python :: 2.7 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.3 - Programming Language :: Python :: 3.4 +description-file = + README.rst +home-page = https://docs.openstack.org/hacking/latest/ +classifier = + Development Status :: 4 - Beta + Environment :: Console + Environment :: OpenStack + Intended Audience :: Developers + Intended Audience :: Information Technology + License :: OSI Approved :: Apache Software License + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 2 + Programming Language :: Python :: 2.7 + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.5 [files] -packages = - hacking +packages = + hacking [entry_points] -flake8.extension = - H000 = hacking.core:ProxyChecks - H101 = hacking.checks.comments:hacking_todo_format - H102 = hacking.checks.comments:hacking_has_license - H103 = hacking.checks.comments:hacking_has_correct_license - H104 = hacking.checks.comments:hacking_has_only_comments - H105 = hacking.checks.comments:hacking_no_author_tags - H106 = hacking.checks.vim_check:no_vim_headers - H201 = hacking.checks.except_checks:hacking_except_format - H202 = hacking.checks.except_checks:hacking_except_format_assert - H203 = hacking.checks.except_checks:hacking_assert_is_none - H231 = hacking.checks.python23:hacking_python3x_except_compatible - H232 = hacking.checks.python23:hacking_python3x_octal_literals - H233 = hacking.checks.python23:hacking_python3x_print_function - H234 = hacking.checks.python23:hacking_no_assert_equals - H235 = hacking.checks.python23:hacking_no_assert_underscore - H236 = hacking.checks.python23:hacking_python3x_metaclass - H237 = hacking.checks.python23:hacking_no_removed_module - H238 = hacking.checks.python23:hacking_no_old_style_class - H301 = hacking.checks.imports:hacking_import_rules - H306 = hacking.checks.imports:hacking_import_alphabetical - H401 = hacking.checks.docstrings:hacking_docstring_start_space - H403 = hacking.checks.docstrings:hacking_docstring_multiline_end - H404 = hacking.checks.docstrings:hacking_docstring_multiline_start - H405 = hacking.checks.docstrings:hacking_docstring_summary - H501 = hacking.checks.dictlist:hacking_no_locals - H700 = hacking.checks.localization:hacking_localization_strings - H903 = hacking.checks.other:hacking_no_cr - H904 = hacking.checks.other:hacking_delayed_string_interpolation +flake8.extension = + H000 = hacking.core:ProxyChecks + H101 = hacking.checks.comments:hacking_todo_format + H102 = hacking.checks.comments:hacking_has_license + H103 = hacking.checks.comments:hacking_has_correct_license + H104 = hacking.checks.comments:hacking_has_only_comments + H105 = hacking.checks.comments:hacking_no_author_tags + H106 = hacking.checks.vim_check:no_vim_headers + H201 = hacking.checks.except_checks:hacking_except_format + H202 = hacking.checks.except_checks:hacking_except_format_assert + H203 = hacking.checks.except_checks:hacking_assert_is_none + H204 = hacking.checks.except_checks:hacking_assert_equal + H205 = hacking.checks.except_checks:hacking_assert_greater_less + H210 = hacking.checks.mock_checks:MockAutospecCheck + H231 = hacking.checks.python23:hacking_python3x_except_compatible + H232 = hacking.checks.python23:hacking_python3x_octal_literals + H233 = hacking.checks.python23:hacking_python3x_print_function + H234 = hacking.checks.python23:hacking_no_assert_equals + H235 = hacking.checks.python23:hacking_no_assert_underscore + H236 = hacking.checks.python23:hacking_python3x_metaclass + H237 = hacking.checks.python23:hacking_no_removed_module + H238 = hacking.checks.python23:hacking_no_old_style_class + H301 = hacking.checks.imports:hacking_import_rules + H306 = hacking.checks.imports:hacking_import_alphabetical + H401 = hacking.checks.docstrings:hacking_docstring_start_space + H403 = hacking.checks.docstrings:hacking_docstring_multiline_end + H404 = hacking.checks.docstrings:hacking_docstring_multiline_start + H405 = hacking.checks.docstrings:hacking_docstring_summary + H501 = hacking.checks.dictlist:hacking_no_locals + H700 = hacking.checks.localization:hacking_localization_strings + H903 = hacking.checks.other:hacking_no_cr + H904 = hacking.checks.other:hacking_delayed_string_interpolation [extras] -pep257 = - flake8-docstrings==0.2.1.post1 # MIT +pep257 = + flake8-docstrings==0.2.1.post1 # MIT [build_sphinx] all_files = 1 build-dir = doc/build source-dir = doc/source - -[pbr] -warnerrors = True +warning-is-error = 1 [egg_info] -tag_build = +tag_build = tag_date = 0 tag_svn_revision = 0 [wheel] universal = 1 - diff -Nru python-hacking-0.12.0/setup.py python-hacking-1.1.0/setup.py --- python-hacking-0.12.0/setup.py 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/setup.py 2018-05-07 13:06:05.000000000 +0000 @@ -25,5 +25,5 @@ pass setuptools.setup( - setup_requires=['pbr>=1.8'], + setup_requires=['pbr>=2.0.0'], pbr=True) diff -Nru python-hacking-0.12.0/test-requirements.txt python-hacking-1.1.0/test-requirements.txt --- python-hacking-0.12.0/test-requirements.txt 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/test-requirements.txt 2018-05-07 13:06:05.000000000 +0000 @@ -1,22 +1,21 @@ # The order of packages is significant, because pip processes them in the order # of appearance. Changing the order has an impact on the overall integration # process, which may cause wedges in the gate later. -coverage>=3.6 # Apache-2.0 -discover # BSD +coverage!=4.4,>=4.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD -mock>=2.0 # BSD -python-subunit>=0.0.18 # Apache-2.0/BSD -sphinx!=1.3b1,<1.4,>=1.2.1 # BSD -oslosphinx>=4.7.0 # Apache-2.0 +mock>=2.0.0 # BSD +python-subunit>=1.0.0 # Apache-2.0/BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +openstackdocstheme>=1.18.1 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD -testtools>=1.4.0 # MIT +testtools>=2.2.0 # MIT # hacking doesn't use this anywhere, but nova imports this in nova/__init__.py # since eventlet is such a common universal import, add it to the hacking test # virtualenv, so importing things like 'nova.hacking.checks.factory' will just # work. # See https://bugs.launchpad.net/hacking/+bug/1403270 -eventlet!=0.18.3,>=0.18.2 # MIT +eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT -reno>=1.8.0 # Apache2 +reno>=2.5.0 # Apache-2.0 diff -Nru python-hacking-0.12.0/tox.ini python-hacking-1.1.0/tox.ini --- python-hacking-0.12.0/tox.ini 2016-11-07 20:33:06.000000000 +0000 +++ python-hacking-1.1.0/tox.ini 2018-05-07 13:06:05.000000000 +0000 @@ -1,13 +1,14 @@ [tox] -minversion = 1.6 +minversion = 2.0 skipsdist = True -envlist = py34,py26,py27,pep8,pypy +envlist = py{35,27},pep8,pypy [testenv] usedevelop = True -install_command = pip install -U {opts} {packages} -setenv = VIRTUAL_ENV={envdir} -deps = -r{toxinidir}/requirements.txt +install_command = pip install {opts} {packages} +deps = + -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} + -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = python setup.py testr --slowest --testr-args='{posargs}' @@ -24,7 +25,6 @@ bash integration-test/test.sh {posargs} [testenv:cover] -setenv = VIRTUAL_ENV={envdir} commands = python setup.py testr --coverage @@ -44,3 +44,10 @@ [hacking] local-check = hacking.tests.test_local.check + +[testenv:lower-constraints] +basepython = python3 +deps = + -c{toxinidir}/lower-constraints.txt + -r{toxinidir}/test-requirements.txt + -r{toxinidir}/requirements.txt diff -Nru python-hacking-0.12.0/.zuul.yaml python-hacking-1.1.0/.zuul.yaml --- python-hacking-0.12.0/.zuul.yaml 1970-01-01 00:00:00.000000000 +0000 +++ python-hacking-1.1.0/.zuul.yaml 2018-05-07 13:06:05.000000000 +0000 @@ -0,0 +1,20 @@ +- project: + check: + jobs: + - openstack-tox-lower-constraints + - hacking-integration-nova: + voting: false + gate: + jobs: + - openstack-tox-lower-constraints + +- job: + name: hacking-integration-nova + parent: openstack-tox + description: | + Run the integration job against nova with proposed hacking change. + required-projects: + - openstack/nova + vars: + tox_envlist: integration + tox_extra_args: -vv openstack nova {{ ansible_user_dir }}/{{ zuul.projects['git.openstack.org/openstack/nova'].src_dir }}