Skip to content

Commit

Permalink
Improve python version flexibility
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
dralley committed Feb 12, 2024
1 parent 8ecb63d commit 8c17c2a
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.8"
python-version: "3.11"
- name: "Bootstrap catdog plugin"
working-directory: "plugin_template"
run: |
Expand All @@ -44,7 +44,7 @@ jobs:
python3 setup.py sdist bdist_wheel --python-tag py3
twine check dist/*
- name: "Upload Package whl"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "plugin_package"
path: "pulp_catdog/dist/"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
fetch-depth: 0
- uses: "actions/setup-python@v4"
with:
python-version: "3.8"
python-version: "3.11"
- name: "Bootstrap catdog plugin"
working-directory: "plugin_template"
run: |
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
mkdir -p "pulp_catdog"
working-directory: "."
- name: "Download Deprecations"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "deprecations"
path: "pulp_catdog"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fetch-depth: 0
- uses: "actions/setup-python@v4"
with:
python-version: "3.8"
python-version: "3.11"
- name: "Lint plugin_template"
working-directory: "plugin_template"
run: |
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- uses: "actions/setup-python@v4"
with:
python-version: "3.8"
python-version: "3.9"

- name: "Bootstrap catdog plugin"
working-directory: "plugin_template"
Expand All @@ -52,7 +52,7 @@ jobs:
repository: "pulp/pulp-openapi-generator"
path: "pulp-openapi-generator"

- uses: "actions/download-artifact@v3"
- uses: "actions/download-artifact@v4"
with:
name: "plugin_package"
path: "pulp_catdog/dist/"
Expand Down Expand Up @@ -128,15 +128,15 @@ jobs:
docker logs pulp 2>&1 | grep -i pulpcore.deprecation | tee deprecations-${{ matrix.env.TEST }}.txt
- name: "Upload Deprecations"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "deprecations"
path: "pulp_catdog/deprecations-${{ matrix.env.TEST }}.txt"
if-no-files-found: "error"
retention-days: 5
- name: Upload python client packages
if: ${{ env.TEST == 'pulp' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "python-client.tar"
path: "pulp_catdog/catdog-python-client.tar"
Expand All @@ -145,23 +145,23 @@ jobs:

- name: Upload python client docs
if: ${{ env.TEST == 'pulp' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "python-client-docs.tar"
path: "pulp_catdog/catdog-python-client-docs.tar"
if-no-files-found: "error"
retention-days: 5
- name: Upload Ruby client
if: ${{ env.TEST == 'pulp' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "ruby-client.tar"
path: "pulp_catdog/catdog-ruby-client.tar"
if-no-files-found: "error"
retention-days: 5
- name: Upload built docs
if: ${{ env.TEST == 'docs' }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "docs.tar"
path: "pulp_catdog/docs/docs.tar"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ The following settings are stored in `template_config.yml`.
pydocstyle Boolean, whether to have flake8 use pydocstyle to check for compliance with
Python docstring conventions.

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

release_user The GitHub user that is associated with the RELEASE_TOKEN secret on GitHub.
The username and token are used to push the Changelog and version bump commits
Expand Down
4 changes: 2 additions & 2 deletions plugin-template
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ DEFAULT_SETTINGS = {
"check_stray_pulpcore_imports": True,
"cli_package": "pulp-cli",
"cli_repo": "https://github.com/pulp/pulp-cli.git",
"ci_base_image": "ghcr.io/pulp/pulp-ci-centos",
"ci_base_image": "ghcr.io/pulp/pulp-ci-centos9",
"ci_env": {},
"ci_trigger": "{pull_request: {branches: ['*']}}",
"ci_update_docs": False,
Expand Down Expand Up @@ -67,7 +67,7 @@ DEFAULT_SETTINGS = {
"pulp_settings": None,
"pulp_settings_s3": None,
"pydocstyle": True,
"python_version": "3.8",
"python_version": "3.9",
"release_email": "[email protected]",
"release_user": "pulpbot",
"stalebot_days_until_close": 30,
Expand Down
8 changes: 6 additions & 2 deletions templates/bootstrap/setup.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ setup(
name="{{ plugin_name | dash }}",
version="0.1.0a1.dev",
description="{{ plugin_name | dash }} plugin for the Pulp Project",
long_description="{{ plugin_name | dash }} plugin for the Pulp Project",
long_description_content_type="text/markdown",
license="GPLv2+",
author="AUTHOR",
author_email="[email protected]",
url="http://example.com/",
python_requires=">=3.8",
python_requires=">=3.9",
install_requires=requirements,
extra_require={"ci": []},
include_package_data=True,
Expand All @@ -24,8 +26,10 @@ setup(
"Framework :: Django",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
],
entry_points={"pulpcore.plugin": ["{{ plugin_name | snake }} = {{ plugin_name | snake }}:default_app_config"]},
)
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/build.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
python3 setup.py sdist bdist_wheel --python-tag py3
twine check dist/*
- name: "Upload Package whl"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "plugin_package"
path: "{{ plugin_name }}/dist/"
Expand Down
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/ci.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
mkdir -p "{{ plugin_name }}"
working-directory: "."
- name: "Download Deprecations"
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "deprecations"
path: "{{ plugin_name }}"
Expand Down
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/create-branch.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
steps:
{{ checkout(depth=0, path=plugin_name) | indent(6) }}

{{ setup_python(pyversion="3.8") | indent(6) }}
{{ setup_python() | indent(6) }}

{{ install_python_deps(["bump2version", "jinja2", "pyyaml", "packaging"]) | indent(6) }}

Expand Down
8 changes: 4 additions & 4 deletions templates/github/.github/workflows/nightly.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
steps:
{{ checkout(path=plugin_name) | indent(6) }}

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: "plugin_package"
path: "{{ plugin_name }}/dist/"
Expand All @@ -79,13 +79,13 @@ jobs:
{%- if publish_docs_to_pulpprojectdotorg and docs_test %}

- name: Download built docs
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "docs.tar"
path: "{{ plugin_name }}"

- name: Download Python client docs
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: "python-client-docs.tar"
path: "{{ plugin_name }}"
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:

{{ checkout(repository="pulp/pulp-openapi-generator", path="pulp-openapi-generator") | indent(6) }}

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: "plugin_package"
path: "{{ plugin_name }}/dist/"
Expand Down
26 changes: 13 additions & 13 deletions templates/github/.github/workflows/publish.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

{{ setup_python() | indent(6) }}

- uses: "actions/download-artifact@v3"
- uses: "actions/download-artifact@v4"
with:
name: "plugin_package"
path: "{{ plugin_name }}/dist/"
Expand All @@ -64,22 +64,22 @@ jobs:

{%- for plugin in plugins %}
- name: "Upload python client packages"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "python-client.tar"
path: "{{ plugin_name }}/{{ plugin.app_label }}-python-client.tar"
if-no-files-found: "error"

- name: "Upload python client docs"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "python-client-docs.tar"
path: "{{ plugin_name }}/{{ plugin.app_label }}-python-client-docs.tar"
if-no-files-found: "error"

{%- if deploy_client_to_rubygems %}
- name: "Upload ruby client packages"
uses: "actions/upload-artifact@v3"
uses: "actions/upload-artifact@v4"
with:
name: "ruby-client.tar"
path: "{{ plugin_name }}/{{ plugin.app_label }}-ruby-client.tar"
Expand All @@ -96,7 +96,7 @@ jobs:
tar -cvf docs/docs.tar docs/_build

- name: "Upload built docs"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: "docs.tar"
path: "{{ plugin_name }}/docs/docs.tar"
Expand All @@ -116,12 +116,12 @@ jobs:
steps:
{{ checkout(depth=1, path=plugin_name) | indent(6) }}

- uses: "actions/download-artifact@v3"
- uses: "actions/download-artifact@v4"
with:
name: "plugin_package"
path: "{{ plugin_name }}/dist/"

{{ setup_python(pyversion="3.8") | indent(6) }}
{{ setup_python() | indent(6) }}

{{ install_python_deps(["twine"]) | indent(6) }}

Expand All @@ -145,7 +145,7 @@ jobs:
{{ checkout(depth=1, path=plugin_name) | indent(6) }}

- name: "Download Python client"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "python-client.tar"
path: "{{ plugin_name }}/"
Expand All @@ -156,7 +156,7 @@ jobs:
tar -xvf {{ plugin.app_label }}-python-client.tar
{%- endfor %}

{{ setup_python(pyversion="3.8") | indent(6) }}
{{ setup_python() | indent(6) }}

{{ install_python_deps(["twine"]) | indent(6) }}

Expand All @@ -180,7 +180,7 @@ jobs:
{{ checkout(depth=1, path=plugin_name) | indent(6) }}

- name: "Download Ruby client"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "ruby-client.tar"
path: "{{ plugin_name }}/"
Expand Down Expand Up @@ -212,20 +212,20 @@ jobs:
steps:
{{ checkout(depth=1, path=plugin_name) | indent(6) }}

{{ setup_python(pyversion="3.8") | indent(6) }}
{{ setup_python() | indent(6) }}

{{ install_python_deps(["packaging~=21.3", "requests"]) | indent(6) }}

{{ set_secrets() | indent(6) }}

- name: "Download built docs"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "docs.tar"
path: "{{ plugin_name }}/"

- name: "Download Python client docs"
uses: "actions/download-artifact@v3"
uses: "actions/download-artifact@v4"
with:
name: "python-client-docs.tar"
path: "{{ plugin_name }}/"
Expand Down
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/release.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
steps:
{{ checkout(depth=0, path=plugin_name, use_release_token=true) | indent(6) }}

{{ setup_python(pyversion="3.8") | indent(6) }}
{{ setup_python() | indent(6) }}

{{ install_python_deps(["bump2version", "towncrier"]) | indent(6) }}

Expand Down
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/scripts/install.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ if [[ "$TEST" = "azure" ]]; then
{%- if pulp_scheme == "https" %}
AZCERTIFI=$(/opt/az/bin/python3 -c 'import certifi; print(certifi.where())')
cat /usr/local/share/ca-certificates/azcert.crt >> $AZCERTIFI
cat /usr/local/share/ca-certificates/azcert.crt | cmd_stdin_prefix tee -a /usr/local/lib/python3.8/site-packages/certifi/cacert.pem > /dev/null
cat /usr/local/share/ca-certificates/azcert.crt | cmd_stdin_prefix tee -a /usr/local/lib/3.9/site-packages/certifi/cacert.pem > /dev/null
cat /usr/local/share/ca-certificates/azcert.crt | cmd_stdin_prefix tee -a /etc/pki/tls/cert.pem > /dev/null
{%- endif %}
AZURE_STORAGE_CONNECTION_STRING='DefaultEndpointsProtocol={{ pulp_scheme }};AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint={{ pulp_scheme }}://ci-azurite:10000/devstoreaccount1;'
Expand Down
Loading

0 comments on commit 8c17c2a

Please sign in to comment.