Rename pipstrap constraints to requirements

This commit is contained in:
Brad Warren 2021-03-11 16:22:29 -08:00
parent 4a51935b63
commit 4e718804d0
7 changed files with 7 additions and 7 deletions

View file

@ -86,7 +86,7 @@ parts:
override-pull: |
snapcraftctl pull
python3 "${SNAPCRAFT_PART_SRC}/tools/strip_hashes.py" "${SNAPCRAFT_PART_SRC}/tools/certbot_requirements.txt" | grep -v python-augeas >> "${SNAPCRAFT_PART_SRC}/snap-constraints.txt"
python3 "${SNAPCRAFT_PART_SRC}/tools/strip_hashes.py" "${SNAPCRAFT_PART_SRC}/tools/pipstrap_constraints.txt" >> "${SNAPCRAFT_PART_SRC}/snap-constraints.txt"
python3 "${SNAPCRAFT_PART_SRC}/tools/strip_hashes.py" "${SNAPCRAFT_PART_SRC}/tools/pipstrap_requirements.txt" >> "${SNAPCRAFT_PART_SRC}/snap-constraints.txt"
echo "$(python3 "${SNAPCRAFT_PART_SRC}/tools/merge_requirements.py" "${SNAPCRAFT_PART_SRC}/snap-constraints.txt")" > "${SNAPCRAFT_PART_SRC}/snap-constraints.txt"
snapcraftctl set-version `grep -oP "__version__ = '\K.*(?=')" "${SNAPCRAFT_PART_SRC}/certbot/certbot/__init__.py"`
shared-metadata:

View file

@ -12,7 +12,7 @@ sudo $BOOTSTRAP_SCRIPT
# We strip the hashes because the venv creation script includes unhashed
# constraints in the commands given to pip and the mix of hashed and unhashed
# packages makes pip error out.
python3 tools/strip_hashes.py tools/pipstrap_constraints.txt > constraints.txt
python3 tools/strip_hashes.py tools/pipstrap_requirements.txt > constraints.txt
python3 tools/strip_hashes.py tools/certbot_requirements.txt > requirements.txt
# We pin cryptography to 3.1.1 and pyOpenSSL to 19.1.0 specifically for CentOS 7 / RHEL 7

View file

@ -60,7 +60,7 @@ def certbot_normal_processing(tools_path, test_constraints):
repo_path, 'tools/certbot_requirements.txt'))
with open(certbot_requirements, 'r') as fd:
certbot_reqs = fd.readlines()
with open(os.path.join(tools_path, 'pipstrap_constraints.txt'), 'r') as fd:
with open(os.path.join(tools_path, 'pipstrap_requirements.txt'), 'r') as fd:
pipstrap_reqs = fd.readlines()
with open(test_constraints, 'w') as fd:
data_certbot = "\n".join(strip_hashes.process_entries(certbot_reqs))

View file

@ -4,7 +4,7 @@ import os
import pip_install
_REQUIREMENTS_PATH = os.path.join(os.path.dirname(__file__), "pipstrap_constraints.txt")
_REQUIREMENTS_PATH = os.path.join(os.path.dirname(__file__), "pipstrap_requirements.txt")
def main():

View file

@ -1,4 +1,4 @@
# Constraints for pipstrap.py
# Requirements file for pipstrap.py
#
# We include the hashes of the packages here for extra verification of
# the packages downloaded from PyPI. This is especially valuable in our

View file

@ -11,6 +11,6 @@ for PLUGIN_PATH in "${CERTBOT_DIR}"/certbot-dns-*; do
# Create constraints file
"${CERTBOT_DIR}"/tools/merge_requirements.py tools/dev_requirements.txt \
<("${CERTBOT_DIR}"/tools/strip_hashes.py tools/certbot_requirements.txt) \
<("${CERTBOT_DIR}"/tools/strip_hashes.py tools/pipstrap_constraints.txt) \
<("${CERTBOT_DIR}"/tools/strip_hashes.py tools/pipstrap_requirements.txt) \
> "${PLUGIN_PATH}"/snap-constraints.txt
done

View file

@ -80,7 +80,7 @@ def _prepare_build_tools(venv_path, venv_python, repo_path):
@contextlib.contextmanager
def _prepare_constraints(repo_path):
reqs_certbot = os.path.join(repo_path, 'tools', 'certbot_requirements.txt')
reqs_pipstrap = os.path.join(repo_path, 'tools', 'pipstrap_constraints.txt')
reqs_pipstrap = os.path.join(repo_path, 'tools', 'pipstrap_requirements.txt')
constraints_certbot = subprocess.check_output(
[sys.executable, os.path.join(repo_path, 'tools', 'strip_hashes.py'), reqs_certbot],
universal_newlines=True)