Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update python version and deps #4

Merged
merged 5 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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' }}
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/wipac_cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,39 @@ 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/[email protected]

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@v3.1

py-versions:
needs: [py-setup]
runs-on: ubuntu-latest
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]
Expand All @@ -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: |
Expand Down Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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' }}
Expand Down
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM python:3.9
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"]
Empty file added people_directory/py.typed
Empty file.
79 changes: 0 additions & 79 deletions requirements.txt

This file was deleted.

27 changes: 19 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
[wipac:cicd_setup_builder]
python_min = 3.8
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
Expand All @@ -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]
Expand All @@ -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
Expand Down
Loading