Commit Graph

9 Commits

Author SHA1 Message Date
Christoph Erhardt 876a2a928c Fix compatibility with setuptools >= 66
The Python world, including the `setuptools` package, has migrated to
the versioning scheme defined in PEP 440. Unfortunately, the versioning
of Jenkins plugins is less strict than that. As a consequence,
`pkg_resources.parse_version()` now rejects versions as invalid.

Fix `PluginVersion` by salvaging the implementation of the old
`LegacyVersion` class, which used to be part of the `packaging` library
prior to version 22.0. The code is licensed under a 2-clause BSD
licence.

For compatibility with older Python versions, remove type annotations
from the copied code.

Change-Id: Iaa057dcd81620fed861cb11bed534ff7f9ab3f32
Signed-off-by: Christoph Erhardt <ce+ubuntuone@sicherha.de>
2023-10-19 15:42:27 +00:00
Guillaume DeMengin 70dc3e4f71 Fix CI tests
Adjust some of the dependencies.

multi_key_dict is not shipped by OpenStack Zuul templates
`build-openstack-docs-pti` or `openstack-cover-jobs` we thus need to
depend on `requirements.txt`.

setuptools v66.0.0 removed support for PEP 440 non-conforming versions.
It provides pkg_resources which we use in PluginVersion.

Tox `whitelist_externals` has been renamed `allowlist_externals`.

Signed-off-by: Antoine Musso <hashar@free.fr>
Change-Id: Ie791c2bb0e7b3784913f45768d2f3db4c66ccae5
2023-03-16 21:06:36 +01:00
Darragh Bailey 34cca0c4d9 Migration to using requests
Convert to the requests library to allow for more sophisticated response
handling to be added.

Want to allow for applications to override the response handling in
certain cases where the default is incorrect. Handling of urlopen
responses results in version specific handling to ensure correct
behaviour across multiple versions of python.

Changing to use the requests package, provides a higher level interface
and removes some of the version specific handling for exceptions.

Change-Id: I5369a0d35be4bf8b3b197a51e60aba21b5742cc7
Depends-On: Iabd70aa457ceb4dbc147d7cbaeec913148cb3b56
2018-02-12 11:16:54 +00:00
Jerry Zhao 96b5c92a08 remove cap on pbr
pbr has updated to 2.0.0 so the cap here will break other packages
like jjb

Change-Id: Ic2d76863d587ecf041c1c8bba32a856e8c12eba0
2017-03-01 14:55:02 -08:00
Darragh Bailey 8b3023dc18 Provider helper classes for plugin data management
Add some common management and version comparison capabilities via
dedicated classes to simplify how calling libraries can perform version
checks on the installed plugins.

Update the comments on the existing methods to note that they return the
raw plugin data in JSON format instead of the parsed local objects.

Change-Id: If43bb945f55c6fb9f8a6595091eace12e4630ffa
2015-09-28 18:15:57 +01:00
Darragh Bailey 0a1b414f3a Add socket timeout tests and helpers
Add tests that use a simple socket server instance that opens the port
and ignores all data in order to support testing when the socket timeout
is set and catching the exception triggered. Also test that when not set
that the request will continue to remain connected for a period of time
longer than the other test using a wrapper time limit process.

Includes some helper classes to black hole all requests by simply
listening using a socketserver but never accepting connections, and a
time limit function to allow wrapping actions with a time limit when
checking for blocking behaviour where the call should not return and
will need to be focibly terminated.

Change-Id: Idab98b0121adb26aed6320ddcf2afbdf2c4428e0
2015-07-24 18:32:40 +01:00
Emilien Macchi ecd79af18b requirements: pin pbr>=0.8.2,<2.0
This patch aims to pin pbr>=0.8.2,<2.0 instead of pbr>=0.8.2,<1.0.
To do that, we also need to update test-requirements.txt to pin hacking
to <0.11 (like in current Global OpenStack requirements).
We also need to ignore some hacking rules.

Some distros ship 1.0.1 so it conflicts with the version in
requirements.

Change-Id: I3620c5fe72e49e226f2f5d1e6c36179eb053f424
2015-06-09 18:24:53 -04:00
Khai Do 21d604c4e6 Setup pbr versioning for docs
Change-Id: I77572a5f6185c19728028547c23bc76d73e48f22
2014-09-26 09:12:54 -07:00
Clark Boylan aa16b89bdf Six is a runtime requirement not a test req
Six needs to be installed when python-jenkins is installed. By default
test-requirements are only installed when running tests. Six was listed
as a test-requirement so it was not installed when pip installing
python-jenkins. Make six a regular requirement so that it is installed
properly every time.

Change-Id: I2b7cb7e967b20ee0e06fe4c665f08c5932e524f2
2014-07-09 14:09:52 -07:00