From 5b9c97f368324fa49be9710b7b58bbf965866639 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Fri, 3 May 2024 14:58:22 -0500 Subject: [PATCH 1/5] update python version and deps --- Dockerfile | 2 +- setup.cfg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9145d13..64da498 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9 +FROM python:3.10 RUN useradd -m -U app diff --git a/setup.cfg b/setup.cfg index b824583..c4257fe 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [wipac:cicd_setup_builder] -python_min = 3.8 +python_min = 3.10 package_dirs = people_directory [metadata] # generated by wipac:cicd_setup_builder: version From 76af16c9472bd94c251419e435ee3b5ff3b9e76c Mon Sep 17 00:00:00 2001 From: David Schultz Date: Fri, 3 May 2024 15:04:28 -0500 Subject: [PATCH 2/5] update CI versions --- .github/workflows/docker.yaml | 8 ++++---- .github/workflows/wipac_cicd.yaml | 31 ++++++++++++++++++------------- 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 69da249..125abe9 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker meta id: docker_meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: | ghcr.io/WIPACRepo/people-directory @@ -27,14 +27,14 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}.{{patch}} - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 if: ${{ github.event_name != 'pull_request' }} with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push Docker Image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: ${{ github.event_name != 'pull_request' }} diff --git a/.github/workflows/wipac_cicd.yaml b/.github/workflows/wipac_cicd.yaml index 655ed50..79b69aa 100644 --- a/.github/workflows/wipac_cicd.yaml +++ b/.github/workflows/wipac_cicd.yaml @@ -7,24 +7,29 @@ on: tags-ignore: - '**' +env: + py_version: '3.10' + jobs: flake8: needs: [] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: ${{ env.py_version }} - uses: WIPACrepo/wipac-dev-flake8-action@v1.0 py-setup: runs-on: ubuntu-latest steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - uses: WIPACrepo/wipac-dev-py-setup-action@pip-fix + - uses: WIPACrepo/wipac-dev-py-setup-action@v2.8 py-versions: needs: [py-setup] @@ -32,9 +37,9 @@ jobs: outputs: matrix: ${{ steps.versions.outputs.matrix }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - id: versions - uses: WIPACrepo/wipac-dev-py-versions-action@v2.1 + uses: WIPACrepo/wipac-dev-py-versions-action@v2.2 pip-install: needs: [py-versions] @@ -44,8 +49,8 @@ jobs: fail-fast: false matrix: ${{ fromJSON(needs.py-versions.outputs.matrix) }} steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 with: python-version: ${{ matrix.py3_versions }} - run: | @@ -107,7 +112,7 @@ jobs: runs-on: ubuntu-latest concurrency: release steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} @@ -125,10 +130,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Project - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Docker meta id: docker_meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: | ghcr.io/WIPACRepo/people-directory @@ -138,14 +143,14 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}}.{{minor}}.{{patch}} - name: Login to GitHub Container Registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 if: ${{ github.event_name != 'pull_request' }} with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push Docker Image - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . push: ${{ github.event_name != 'pull_request' }} From e7d718be54f607a8f7ab95a08231eade0dbb7df2 Mon Sep 17 00:00:00 2001 From: David Schultz Date: Fri, 3 May 2024 15:09:57 -0500 Subject: [PATCH 3/5] remove requirements file --- .github/workflows/wipac_cicd.yaml | 2 +- Dockerfile | 8 ++-- requirements.txt | 79 ------------------------------- 3 files changed, 6 insertions(+), 83 deletions(-) delete mode 100644 requirements.txt diff --git a/.github/workflows/wipac_cicd.yaml b/.github/workflows/wipac_cicd.yaml index 79b69aa..7b3854c 100644 --- a/.github/workflows/wipac_cicd.yaml +++ b/.github/workflows/wipac_cicd.yaml @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@v4 with: token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - - uses: WIPACrepo/wipac-dev-py-setup-action@v2.8 + - uses: WIPACrepo/wipac-dev-py-setup-action@v3.1 py-versions: needs: [py-setup] diff --git a/Dockerfile b/Dockerfile index 64da498..9b81cde 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,14 +2,16 @@ FROM python:3.10 RUN useradd -m -U app -COPY requirements.txt ./ -RUN pip install --no-cache-dir -r requirements.txt - WORKDIR /home/app USER app COPY . . +USER root +RUN pip install --no-cache-dir -e . + +USER app + ENV PYTHONPATH=/home/app CMD ["python", "-m", "people_directory"] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7914a3b..0000000 --- a/requirements.txt +++ /dev/null @@ -1,79 +0,0 @@ -# -# This file is autogenerated by pip-compile with python 3.10 -# To update, run: -# -# pip-compile -# -aio-pika==9.0.7 - # via wipac-keycloak-rest-services -aiormq==6.7.6 - # via aio-pika -cachetools==5.3.1 - # via wipac-rest-tools -certifi==2023.5.7 - # via requests -cffi==1.15.1 - # via cryptography -charset-normalizer==3.1.0 - # via requests -cryptography==40.0.2 - # via pyjwt -dnspython==2.3.0 - # via pymongo -idna==3.4 - # via - # requests - # yarl -ldap3==2.9.1 - # via wipac-keycloak-rest-services -motor==3.1.2 - # via - # people-directory (setup.py) - # wipac-keycloak-rest-services -multidict==6.0.4 - # via yarl -pamqp==3.2.1 - # via aiormq -pyasn1==0.5.0 - # via ldap3 -pycparser==2.21 - # via cffi -pyjwt[crypto]==2.7.0 - # via wipac-rest-tools -pymongo==4.3.3 - # via motor -pypng==0.20220715.0 - # via qrcode -qrcode==7.4.2 - # via wipac-rest-tools -requests==2.31.0 - # via - # requests-futures - # wipac-dev-tools - # wipac-keycloak-rest-services - # wipac-rest-tools -requests-futures==1.0.0 - # via wipac-rest-tools -tornado==6.3.2 - # via wipac-rest-tools -typing-extensions==4.6.2 - # via - # qrcode - # wipac-dev-tools -urllib3==2.0.2 - # via requests -wipac-dev-tools==1.6.16 - # via - # people-directory (setup.py) - # wipac-keycloak-rest-services - # wipac-rest-tools -wipac-keycloak-rest-services==1.3.10 - # via people-directory (setup.py) -wipac-rest-tools==1.4.20 - # via - # people-directory (setup.py) - # wipac-keycloak-rest-services -yarl==1.9.2 - # via - # aio-pika - # aiormq From 599102548241809726e62ba31991a894c6fa1733 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 3 May 2024 20:10:15 +0000 Subject: [PATCH 4/5] update setup.cfg --- setup.cfg | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index c4257fe..b1385e9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,16 +2,18 @@ python_min = 3.10 package_dirs = people_directory -[metadata] # generated by wipac:cicd_setup_builder: version +[metadata] # generated by wipac:cicd_setup_builder: name, version version = attr: people_directory.__version__ +name = people-directory -[semantic_release] # generated by wipac:cicd_setup_builder +[semantic_release] # fully-generated by wipac:cicd_setup_builder version_variable = people_directory/__init__.py:__version__ upload_to_pypi = False patch_without_tag = True -commit_parser = semantic_release.history.tag_parser -minor_tag = [minor] -fix_tag = [fix] +commit_parser = semantic_release.history.emoji_parser +major_emoji = [major] +minor_emoji = [minor] +patch_emoji = [fix], [patch] branch = main [options] # generated by wipac:cicd_setup_builder: python_requires, packages @@ -20,7 +22,7 @@ install_requires = wipac-dev-tools wipac-keycloak-rest-services wipac-rest-tools -python_requires = >=3.8, <3.12 +python_requires = >=3.10, <3.13 packages = find: [options.extras_require] @@ -35,10 +37,19 @@ tests = [options.package_data] # generated by wipac:cicd_setup_builder: '*' * = py.typed -[options.packages.find] +[options.packages.find] # generated by wipac:cicd_setup_builder: include/exclude include = people_directory people_directory.* +exclude = + test + tests + doc + docs + resource + resources + example + examples [coverage:run] branch = True From 2b85694c2ee2208fb98cf6e70c589649c72e911e Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 3 May 2024 20:10:15 +0000 Subject: [PATCH 5/5] add py.typed file(s) --- people_directory/py.typed | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 people_directory/py.typed diff --git a/people_directory/py.typed b/people_directory/py.typed new file mode 100644 index 0000000..e69de29