Skip to content

Commit

Permalink
Merge pull request #319 from freyes/pip_constraints_url
Browse files Browse the repository at this point in the history
Handle constraints from a URL
  • Loading branch information
ajkavanagh authored Feb 14, 2024
2 parents 584e9e6 + fa681a9 commit eac4ec0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions playbooks/juju/run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
roles:
- setup-networking-env
- charm-build
- handle-constraints-url
- handle-func-test-pr
- revoke-sudo
- setup-test-fixtures
Expand Down
1 change: 1 addition & 0 deletions roles/handle-constraints-url/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pip_constraints_url: null
22 changes: 22 additions & 0 deletions roles/handle-constraints-url/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- name: Create temporary file to store the constraints
ansible.builtin.tempfile:
path: /home/ubuntu/
prefix: "constraints."
suffix: ".txt"
when: pip_constraints_url is defined
register: constraints_file

- name: GET the constraints file
get_url:
url: "{{ pip_constraints_url }}"
dest: "{{ constraints_file.path }}"
mode: 0444
when: constraints_file is defined and pip_constraints_url is defined

- name: Record file location
set_fact:
tox_constraints_env:
TOX_CONSTRAINTS_FILE: "{{ constraints_file.path }}"
# Backward compatibility, to be removed
UPPER_CONSTRAINTS_FILE: "{{ constraints_file.path }}"
when: constraints_file is defined and pip_constraints_url is defined

0 comments on commit eac4ec0

Please sign in to comment.