Commit Graph

49 Commits

Author SHA1 Message Date
Benjamin A. Beasley 156e1eb0b9 Use importlib.metadata on Python 3.10+
Favor importlib.metadata.packages_distributions() over
importlib_metadata.packages_distributions() where it is available, i.e.,
on Python 3.10 and later.

Depend on PyPI importlib_metadata only on Python 3.9 and older:
conditionalize the requirements.txt entry on Python version.

Change-Id: I624fc0059057de05bb2bacd9c1238cba71ebad2a
2023-11-29 22:13:41 +09:00
Stephen Finucane 86061ad87d Remove final use of pkg_resources
'pkg_resources' is slow, while 'importlib.metadata' is the new shiny and
is *much* faster. Recent version of 'importlib.metadata' - namely those
found in Python 3.10 or provided by the 4.4 'importlib-metadata'
backport - now provide the last bit of functionality we were missing to
remove 'pkg_resources' entirely, namely the ability to map package names
to modules. This is used for generating epilogs.

The benefits of this are huge, yielding a near 40% decrease in runtime
for the cliffdemo app (100mS after compared to 160mS) before.

Change-Id: I934d8a196d76622671781643f36bdb8a07d2f319
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-07-15 16:08:26 +01:00
Stephen Finucane a8418879c0 requirements: Remove explicit pbr dependency
We don't use pbr at runtime; ergo, there is no reason to include this in
requirements.txt.

While we're here, we remove a note that is no longer true with the new
dependency resolver introduced in pip 20.3.

Change-Id: I39ee12f052fff6d69f8fe97949e6e5df7511647b
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-05-25 17:09:04 +01:00
Stephen Finucane 3d93a6464d requirements: Remove explicit pyparsing dependency
This was added nearly a decade ago to work around a packaging bug in
cmd2. We don't use this explicitly ourselves so we can and should remove
it. Do that.

Change-Id: Ia6061a22b9037d157c0b2afecb4e06bbc62c2d74
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
2022-05-25 17:09:04 +01:00
Zane Bitter 8fa916e916 Colourise and automatically page help output
Using the autopage library we can automatically send the help output to
a pager (less, by default), git-style. The pager is configured to not
reset the terminal on exit, avoiding the problem when piping to less
manually that the help text you want to refer to disappears off the
screen when you go to use it. The pager is only invoked when the output
is to the terminal.

Since we invoke the pager, we can ensure that it is correctly set up to
interpret ANSI escape codes, so it is safe to use colour to make the
output easier to read. The autopage library provides light styling of
the default argparse help output, and some additional colour
highlighting is added here for the command list (which is generated by
cliff, not using argparse's formatting code).

Change-Id: If9e1aa5166da32c58cc0fa617f4f81eaa9b2c470
Depends-On: https://review.opendev.org/c/openstack/requirements/+/799343
2021-07-12 21:03:32 -04:00
Stephen Finucane 117a1005dc requirements: Uncap PrettyTable
PrettyTable was capped at a < 0.8, which meant we were getting the
veritably ancient 0.7.2 release first release in April 2013 (!) [1].
The project is now being maintained as a Jazzband project [2], meaning
we should switch to this new version.

The only significant change required here is that we no longer set the
'min_width' attribute since that actually does something - the wrong
thing - now. We want this attribute to set a lower bound on the wrap
width as opposed to an absolute minimum we can use, which is what
setting the 'min_width' attribute would do.

While we're here, we also remove a now useless bit of Python 2 code and
bump cmd2 to a slightly newer version.

[1] https://pypi.org/project/prettytable/#history
[2] https://github.com/jazzband/prettytable

Change-Id: Iceac729e7a9429e8ab25c60524a48d0aaeebeb37
Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
Depends-On: https://review.opendev.org/c/openstack/requirements/+/774917
2021-02-11 11:01:48 +00:00
xuanyandong bc76d324f5 Remove six
Replace the following items with Python 3 style code.

- six.moves
- six.PY2
- six.PY3
- six.string_types
- six.text_type

Change-Id: I1656b976864c8f2343e658a4abf432d30c151d0b
2020-10-29 11:27:41 +00:00
Doug Hellmann 6ac510d0cd switch to stevedore for loading entry points
Switch to using stevedore now so that when the cache implementation is
released all cliff applications can take advantage of the performance
benefits.

Change-Id: Ib7bf53091470b55ab87082d315ca283d3600a636
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2020-07-05 15:58:46 -04:00
Rodolfo Alonso Hernandez 8099c98249 Remove cap on cmd2
After [1] and [2], there is no need to cap the version of cmd2.

This will also fix the current "rally_openstack" import problems
experienced in the CI: http://paste.openstack.org/show/794701/

[1]https://review.opendev.org/#/c/712591/
[2]https://review.opendev.org/#/c/734629/

Change-Id: Ie15e3f5058c4bd104978d9f31f0590d6c795024b
2020-06-12 16:42:56 -05:00
Andreas Jaeger 9724108710 [ussuri][goal] Drop python 2.7 support and testing
OpenStack is dropping the py2.7 support in ussuri cycle.

Complete discussion & schedule can be found in
- http://lists.openstack.org/pipermail/openstack-discuss/2019-October/010142.html
- https://etherpad.openstack.org/p/drop-python2-support

Ussuri Communtiy-wide goal:
https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html

Cleanup setup.cfg, conf.py, and tox.ini from cruft.

Change-Id: Icb08c704cb5d0d8004d0a5408822c9d53ae9c728
2020-02-04 15:05:33 +01:00
Monty Taylor 01ce75f5b3 Pin cmd2 back to <0.9 on all versions
cmd2 is now also broken on python3.

Change-Id: Ib72830b26aabfd8244196be562f925fd76080dd9
Depends-On: https://review.openstack.org/629269
2019-09-03 08:58:29 +00:00
Matthew Thode 5e4b3bedc0
update cmd2 dependency to handle py3 only versions
cmd2 released a python3 only versions of itself.  We need to update
requirements to handle it.  This updates requirements to match
requirements.  See https://review.openstack.org/570811 for more details.

Change-Id: I3d527ba30205c9f3b3b2e89f795ee5611422c013
2018-05-29 18:47:11 -05:00
Doug Hellmann 369342c322 exclude cmd2 0.8.3 and update to 0.8.4
Release 0.8.3 of cmd2 failed to properly specify a new dependency so
installing it breaks interactive mode for OSC and other cliff-based
apps. 0.8.4 fixes the issue.

Change-Id: I8bbd749e3328596fd333bd7f58391b9d688c00cf
Depends-On: https://review.openstack.org/560120
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-17 17:24:45 -04:00
Doug Hellmann 73a5d6529f add lower-constraints job
Create a tox environment for running the unit tests against the lower
bounds of the dependencies.

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

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

Update the lower bound for PrettyTable so the unit tests pass.

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

Change-Id: Ia146248b505e66adf871d17ae1e4921d7888bb85
Depends-On: https://review.openstack.org/555034
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-04-09 10:24:28 -04:00
OpenStack Proposal Bot 065924ecfc Updated from global requirements
Change-Id: Ic10fe257544d9c0114a466be11588570377e2049
2018-03-15 06:49:26 +00:00
OpenStack Proposal Bot 0d835444b8 Updated from global requirements
Change-Id: Icd148aa05cc290d246cf27a7f99a3dbe7a84426f
2017-11-16 11:00:37 +00:00
OpenStack Proposal Bot 5ffc30f6bd Updated from global requirements
Change-Id: Ie282ea0ce4527b224d267dfb8cd56b4c947b61ce
2017-08-22 15:32:32 -07:00
OpenStack Proposal Bot 0666094367 Updated from global requirements
Change-Id: Ib7166bc3268ffb986d27b88777a303e356fa3e0a
2017-04-17 17:11:44 +00:00
OpenStack Proposal Bot b5bbce018d Updated from global requirements
Change-Id: I39942d5df86a6a1ced475ff4f972d59a63736668
2017-03-02 11:43:26 +00:00
OpenStack Proposal Bot c500a6e7ff Updated from global requirements
Change-Id: Iee782cc1c86308b028a7b99112bb02014152bccb
2017-01-26 04:13:38 +00:00
OpenStack Proposal Bot 2a3a8c081f Updated from global requirements
Change-Id: I3816eb47bec76567f3884724bcc8231eef801253
2016-11-09 04:14:37 +00:00
OpenStack Proposal Bot ebf658d220 Updated from global requirements
Change-Id: Ife70d010cd8dad1866196bf19e3752f1aeed296d
2016-11-02 03:32:51 +00:00
OpenStack Proposal Bot d693201610 Updated from global requirements
Change-Id: I792ccfe1dac29f39ae1f882f674b4eb3c5dedd27
2016-10-06 16:54:10 +00:00
OpenStack Proposal Bot 2a44ae061e Updated from global requirements
Change-Id: I9fd16cf1b32c020ec58a498bb853011f18c65f10
2016-09-30 19:57:44 +00:00
OpenStack Proposal Bot 0ffb036037 Updated from global requirements
Change-Id: I41cd6d284b3450127ec2c1b7606b056cfd56e281
2016-07-17 23:52:03 +00:00
OpenStack Proposal Bot 2b78acd326 Updated from global requirements
Change-Id: I5dad6a7ea389d54e44fd8dd46efd86f121b55933
2016-05-12 23:58:22 +00:00
OpenStack Proposal Bot 82c6ef7d54 Updated from global requirements
Change-Id: I26ddde092bb19cb242f77b1d2caf028b92deb044
2016-05-10 00:43:14 +00:00
OpenStack Proposal Bot 80f22a116a Updated from global requirements
Change-Id: Ic4bcb34c8c442630f7b3f45ff62fa6f38c845fc3
2016-04-19 12:22:44 +00:00
OpenStack Proposal Bot a61240a350 Updated from global requirements
Change-Id: Ia66b06515d600c833ddc085cc43716fd0c6fb8f8
2016-01-16 03:25:43 +00:00
Ricardo Kirkner ef03cf4ef3 remove unnecessary dependency on argparse
argparse is not required for Python 2.7 and 3.2+ (which are the only
Python versions explicitely supported in setup.py)

removing the unnecessary argparse dependency to allow package to be
properly packaged on Debian/Ubuntu systems.

Change-Id: I80f8607402ea3ec52f91e68a3b0393ccd684c11b
2016-01-06 11:00:02 -03:00
OpenStack Proposal Bot b5f98023e8 Updated from global requirements
Change-Id: Ic6465e5ead0a2699717cc748680939bd54739f2c
2015-11-19 15:44:19 +00:00
Doug Hellmann 25cce67529 only use unicodecsv for python 2.x
Only use unicodecsv for python 2, since the python 3 module works fine
with unicode data.

Change-Id: I8b82248e855a6986b7541ca997d8fd56628b17a5
Related-bug: #1491888
2015-09-23 21:33:56 +00:00
Steve Baker 0a8daff7bd Implement a yaml formatter in cliff
This change replaces the cliff-tablib yaml formatter with an internal
replacement. It differs from the tablib formatter in the following ways:
- always outputs with block formatting rather than the PyYAML default
  of deciding based on value content
- emit_one serialises a simple dict where the column name is the key
  and the data item is the value (rather than a list of dicts with
  'Field' and 'Value' keys)
- emit_one preserves column order by printing a single-item dict for
  each column_name

The cliff release which contains this change will need a corresponding
cliff-tablib release which removes the yaml formatter from its setup.py
entry_points.

Change-Id: I691dbab3dee7c5ec28b1083f87ab1f5c051d582b
Related-Bug: #1308744
2015-08-18 09:42:19 +12:00
OpenStack Proposal Bot faf935a648 Updated from global requirements
Change-Id: I5411706ad78b25f5ca3d9223ed37214bcbfe2de4
2015-08-10 01:05:17 +00:00
gcmalloc eb655cc84f Fix encoding issue with the default python csv output
Change-Id: I8a1fd7947002c20003d97d74377741107c8a00c2
2015-07-30 16:36:25 +00:00
OpenStack Proposal Bot ab7bf09baf Updated from global requirements
Change-Id: I91a9847d3568965e90724ce581a32f05c612ad68
2015-07-15 00:24:12 +00:00
OpenStack Proposal Bot d9a0e8c7c1 Updated from global requirements
Change-Id: Ie0971880eae2abf3388a88eae4086698e9024c8d
2015-06-22 19:52:40 +00:00
OpenStack Proposal Bot 1a08a24010 Updated from global requirements
Change-Id: I44110ad31071e2a54993a469775bf56c1d15eb3b
2015-06-11 00:41:12 +00:00
OpenStack Proposal Bot bacb4c6742 Updated from global requirements
Change-Id: I2487ec78da8bcede4c540674441a328b6c6c76e9
2015-05-11 15:47:54 +00:00
Doug Hellmann f558d9e707 Uncap library requirements for liberty
Change-Id: Idd3c11892b64829d8679e44654d8f23c684db822
Depends-On: Ib948b756b8e6ca47a4c9c44c48031e54b7386a06
2015-04-16 17:47:46 +00:00
OpenStack Proposal Bot 40da955642 Updated from global requirements
Change-Id: I8418aad9ce3c6f7e10394099316f20ce2663b0ca
2015-03-21 00:08:05 +00:00
OpenStack Proposal Bot 01c8d8f05c Updated from global requirements
Change-Id: I4af3abf237943d9cca004f353f627576a852f13f
2015-02-20 13:50:32 +00:00
OpenStack Proposal Bot a5fd24dc3c Updated from global requirements
Change-Id: I9d6c88650b1f29b81aabdf1a75ab6aba15248bc2
2014-10-28 03:33:13 +00:00
Doug Hellmann cd551d8cd3 Add pbr to installation requirements
Add pbr to the list of installation requirements so that it is installed
via pip before this library is installed, instead of with easy_install.
This avoids issues like Bug #1384919, and ensures that projects that use
this library as a dependency are properly installed.

Change-Id: I6c155370dbd01fe4748d5137bdf288e8d3e1a67e
2014-10-24 09:21:54 -04:00
OpenStack Proposal Bot 6c5148aa2b Updated from global requirements
Change-Id: Iaff1d1d9b836b8dede6dbf45ed7d9d72b9f715be
2014-09-11 17:13:51 +00:00
OpenStack Proposal Bot bf0c611e34 Updated from global requirements
Change-Id: I02dddff536946ea6eb7662e2af6ddb8b5cbf5641
2014-07-26 12:43:54 -06:00
OpenStack Proposal Bot 4bdf5fc90e Updated from global requirements
Change-Id: I934f67643ed407ef3f12a9a2d0d9f695cb88038e
2014-04-30 02:38:38 +00:00
Sascha Peilicke 7f41ee325c Sync with global requirements
Change-Id: Ibd2a7c044752416deb4bf9f0984e53f74fe7621c
2014-01-16 09:38:19 +01:00
Doug Hellmann 82f9a4ad61 move to pbr for packaging
Change-Id: I93e4f54d1b81f53615774aa5f79b3e6a9941a55d
2014-01-03 12:17:56 -05:00