Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow plugins to configure python_version
Browse files Browse the repository at this point in the history
fixes pulp#457
David Davis committed Jul 26, 2021
1 parent 72ba7e7 commit f12d76b
Showing 9 changed files with 18 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGES/457.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added python_version option.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -189,6 +189,8 @@ The following settings are stored in `template_config.yml`.
is required unless deploy_client_to_pypi and deploy_daily_client_to_pypi
and deploy_to_pypi are specified.

python_version Python version to use in the CI. Currently only 3.6 and 3.8 are supported.

redmine_project A string that corresponds to the redmine identifier for the repo's project.
This is used during commit validation to make sure the commit is attached to
an issue in the correct project.
1 change: 1 addition & 0 deletions plugin-template
Original file line number Diff line number Diff line change
@@ -53,6 +53,7 @@ DEFAULT_SETTINGS = {
'pulpprojectdotorg_key_id': None,
'pydocstyle': True,
'pypi_username': None,
'python_version': "3.8",
'redmine_project': None,
'release_user': 'pulpbot',
'sync_ci': True,
3 changes: 2 additions & 1 deletion templates/github/.ci/ansible/Containerfile.j2.copy
Original file line number Diff line number Diff line change
@@ -23,7 +23,8 @@ RUN pip3 install \

RUN mkdir -p /etc/nginx/pulp/
{% for item in plugins %}
RUN ln /usr/local/lib/python3.8/site-packages/{{ item.name }}/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf || true
RUN export plugin_path="$(pip show {{ item.name }} | sed -n -e "s/Location: //p")/{{ item.name }}"
RUN ln "$plugin_path/app/webserver_snippets/nginx.conf /etc/nginx/pulp/{{ item.name }}.conf" || true
{% endfor %}

ENTRYPOINT ["/init"]
6 changes: 3 additions & 3 deletions templates/github/.github/workflows/ci.yml.j2
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "{{ python_version }}"

# dev_requirements contains tools needed for flake8, etc.
- name: Install requirements
@@ -92,7 +92,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "{{ python_version }}"

{%- if test_bindings %}
- uses: actions/setup-ruby@v1
@@ -185,7 +185,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "{{ python_version }}"

- name: Install httpie
run: |
6 changes: 3 additions & 3 deletions templates/github/.github/workflows/nightly.yml.j2
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "{{ python_version }}"

- name: Install httpie
run: |
@@ -139,7 +139,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "{{ python_version }}"

- uses: actions/setup-ruby@v1
with:
@@ -263,7 +263,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "{{ python_version }}"

- name: Install httpie
run: |
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/release.yml.j2
Original file line number Diff line number Diff line change
@@ -90,7 +90,7 @@ jobs:

- uses: actions/setup-python@v2
with:
python-version: "3.8"
python-version: "{{ python_version }}"

{%- if test_bindings or deploy_client_to_rubygems %}
- uses: actions/setup-ruby@v1
4 changes: 4 additions & 0 deletions templates/github/.github/workflows/scripts/install.sh.j2
Original file line number Diff line number Diff line change
@@ -114,7 +114,11 @@ VARSYAML
cat >> vars/main.yaml << VARSYAML
pulp_settings: {{ pulp_settings | tojson }}
pulp_scheme: {{ pulp_scheme }}
{%- if python_version == "3.6" -%}
pulp_container_tag: python36
{%- else -%}
pulp_container_tag: {{ 'https' if pulp_scheme == 'https' else 'latest' }}
{% endif %}
VARSYAML

{%- if docker_fixtures %}
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/scripts/script.sh.j2
Original file line number Diff line number Diff line change
@@ -104,7 +104,7 @@ echo "Checking for uncommitted migrations..."
cmd_prefix bash -c "django-admin makemigrations --check --dry-run"

# Run unit tests.
cmd_prefix bash -c "PULP_DATABASES__default__USER=postgres django-admin test --noinput /usr/local/lib/python3.8/site-packages/{{ plugin_snake }}/tests/unit/"
cmd_prefix bash -c "PULP_DATABASES__default__USER=postgres django-admin test --noinput /usr/local/lib/python{{ python_version }}/site-packages/{{ plugin_snake }}/tests/unit/"

# Run functional tests
{%- if plugin_name == 'pulpcore' %}

0 comments on commit f12d76b

Please sign in to comment.