Files
impala/infra/python
Laszlo Gaal fae42323da IMPALA-14144: Make pip_download.py more tolerant with PEP 503 simple pages
Recent package updates on PyPI have introduced package description
pages that have extra newlines in addition to the newline character
separating the complete URLs for the difference package versions.
These extra newlines usually show up before the closing angle bracket
character ('>') of the opening half of the anchor tag.

This broke pip_download.py, because it uses a regex to crack out
various data items (file name, download path, hash algorithm and hash
value) from the download page. The regex attempts the whole anchor
element up to and including the closing '</a>' tag, which fails because
the '.' in a regex matches any character, except a newline. This failure
causes all lines in the package descriptor page to be rejected as not
matching the search pattern, so the package with a page in this format
can never be recognized.

This patch works around this formatting issue by adding the flag
re.DOTALL to the regex search call, making the regex '.' character match
the newline as well, so that the regex can match the complete anchor
element across a line break as well.

Change-Id: Ia56f87c54e0d9cad97b7e0ffbcce8f4c0f715c44
Reviewed-on: http://gerrit.cloudera.org:8080/23026
Reviewed-by: Joe McDonnell <joemcdonnell@cloudera.com>
Reviewed-by: Michael Smith <michael.smith@cloudera.com>
Tested-by: Joe McDonnell <joemcdonnell@cloudera.com>
2025-06-13 21:50:41 +00:00
..

To install new packages:

1) Add your package to deps/requirements.txt, or deps/compiled-requirements.txt if the
   the package needs a C/C++ compiler to build . You should specify the version number
   using the "foo == x.y.z" notation so future upgrades can be done automatically.
2) Run deps/download_requirements, it will download the package to the deps dir.
3) Run the "impala-python" command, this should detect that requirements.txt changed and
   automatically rebuild the virtualenv.
4) Now in the python prompt, you should be able to import the new module.

To upgrade a package:

1) Edit deps/requirement.txt to use the version you need.
2) Go to step 2 above.