Skip to content

Commit

Permalink
upgrade to python 3.10 (#428)
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandroroiz authored Aug 12, 2024
1 parent de371c4 commit 4381e29
Show file tree
Hide file tree
Showing 27 changed files with 167 additions and 405 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ permissions: {}

jobs:
pre-commit:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python 3.8
- name: Setup python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.10.14
- name: Install pre-commit
run: pip install pre-commit
- name: Run pre-commit
run: pre-commit run --all-files
## Uncomment once license tests are in and passing
#license-check:
# runs-on: ubuntu-18.04
# runs-on: ubuntu-22.04
# steps:
# - name: Checkout
# uses: actions/checkout@v1
Expand All @@ -40,10 +40,10 @@ jobs:
# - name: Run license finder
# run: license_finder
test-unit:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python-version: ['3.7.x', '3.8.x']
python-version: ['3.10.x']
steps:
- name: Checkout
uses: actions/checkout@v1
Expand All @@ -54,28 +54,28 @@ jobs:
- name: Install apt dependencies
run: sudo apt-get update && sudo apt-get install -y python3-dev openssl libssl-dev gcc pkg-config libffi-dev libxml2-dev libxmlsec1-dev
- name: Install dependencies
run: pip install -r piptools_requirements.txt && pip install -r piptools_requirements3.txt && pip install -r requirements3.txt
run: pip install -r piptools_requirements.txt && pip install -r requirements.txt
- name: Run python unit tests
run: make test_unit
test-integration:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Run python integration tests
run: "make actions_test_integration"
test-frontend:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '8.x'
node-version: '20.x'
- name: Run frontend tests
run: "npm install grunt-cli && npm install && grunt test"
build-dist-docker-image:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ on:
jobs:
build-and-deploy-docs:
name: Build and publish docs
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python 3.8
- name: Setup python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.10.14
- name: Install virtualenv
run: pip install virtualenv
- name: Install xmlsec
Expand All @@ -33,14 +33,14 @@ jobs:
FOLDER: generated/docs # The folder the action should deploy.
build-and-publish-python-module:
name: Build and publish python module to pypi
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup python 3.8
- name: Setup python 3.10
uses: actions/setup-python@v1
with:
python-version: 3.8
python-version: 3.10.14
- name: Add wheel dependency
run: pip install wheel
- name: Generate dist
Expand All @@ -58,7 +58,7 @@ jobs:
# GitHub Container Registry).
packages: write
name: Build and publish Docker images to GitHub Container Registry
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
Expand Down
16 changes: 9 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ repos:
- id: mypy
additional_dependencies:
- --no-compile
- cffi==1.14.6
- cryptography==41.0.1
- pycparser==2.21
- types-pyopenssl==23.2.0.1
- types-pytz==2023.3.0.0
- types-pyyaml==6.0.12.10
- types-redis==4.6.0.0
- cffi==1.16.0
- cryptography==43.0.0
- pycparser==2.22
- types-cffi==1.16.0.20240331
- types-pyopenssl==24.1.0.20240722
- types-pytz==2024.1.0.20240417
- types-pyyaml==6.0.12.20240724
- types-redis==4.6.0.20240425
- types-setuptools==71.1.0.20240724
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 6.6.1

* Upgrade confidant to python 3.10.14

## 6.5.8

* Migrated to docker compose v2
Expand Down
15 changes: 7 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM ubuntu:bionic
FROM ubuntu:jammy
LABEL maintainer="[email protected]"

WORKDIR /srv/confidant

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
curl ca-certificates \
&& /usr/bin/curl -sL --fail https://deb.nodesource.com/setup_10.x | bash -
&& /usr/bin/curl -sL --fail https://deb.nodesource.com/setup_20.x | bash -
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
# For frontend
make nodejs git-core \
# For backend
gcc pkg-config \
python3.8-dev virtualenv \
python3.10-dev virtualenv \
libffi-dev libxml2-dev libxmlsec1-dev \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

Expand All @@ -22,18 +22,17 @@ COPY package.json /srv/confidant/
RUN npm install grunt-cli && \
npm install

COPY piptools_requirements.txt piptools_requirements3.txt requirements3.txt /srv/confidant/
COPY piptools_requirements.txt requirements.txt /srv/confidant/

ENV PATH=/venv/bin:$PATH
RUN virtualenv /venv --python=/usr/bin/python3.8 && \
RUN virtualenv /venv --python=/usr/bin/python3.10 && \
pip install --no-cache -r piptools_requirements.txt && \
pip install --no-cache -r piptools_requirements3.txt && \
pip install --no-cache -r requirements3.txt
pip install --no-cache -r requirements.txt

COPY .jshintrc Gruntfile.js /srv/confidant/
COPY confidant/public /srv/confidant/confidant/public

RUN node_modules/grunt-cli/bin/grunt build --force
RUN node_modules/grunt-cli/bin/grunt build

COPY . /srv/confidant

Expand Down
6 changes: 4 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module.exports = function (grunt) {

// Configurable paths for the application
var appConfig = {
baseDir: '',
nodeDir: 'node_modules',
app: 'confidant/public',
components: 'confidant/public/components',
Expand Down Expand Up @@ -45,7 +46,7 @@ module.exports = function (grunt) {
// Make sure code styles are up to par and there are no obvious mistakes
jshint: {
options: {
jshintrc: '<%= baseDir %>.jshintrc',
jshintrc: '.jshintrc',
reporter: require('jshint-stylish')
},
all: {
Expand All @@ -67,7 +68,8 @@ module.exports = function (grunt) {
options: {
ignorePath: '<%= project.app %>',
relative: false,
destFile:'<%= project.app %>/index.html'
destFile:'<%= project.app %>/index.html',
lineEnding: '\n',
},
scripts: {
src: [
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.8
6.6.1
2 changes: 1 addition & 1 deletion actions_run_integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

cd /srv/confidant
apt-get update && apt-get install -y python3-dev openssl libssl-dev gcc pkg-config libffi-dev libxml2-dev libxmlsec1-dev
pip install -r piptools_requirements.txt && pip install -r piptools_requirements3.txt && pip install -r requirements3.txt
pip install -r piptools_requirements.txt && pip install -r requirements.txt
make test_integration
2 changes: 2 additions & 0 deletions confidant/routes/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def get_credential_list():
for credential in
Credential.data_type_date_index.query('credential')
])

return credentials_response_schema.dumps(credentials_response)


Expand Down Expand Up @@ -257,6 +258,7 @@ def get_credential(id):
include_credential_pairs=include_credential_pairs,
)
credential_response.permissions = permissions

return credential_response_schema.dumps(credential_response)


Expand Down
3 changes: 0 additions & 3 deletions confidant/schema/blind_credentials.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import attr
import toastedmarshmallow
from marshmallow import fields

from confidant.schema.auto_build_schema import AutobuildSchema
Expand Down Expand Up @@ -51,8 +50,6 @@ def from_blind_credential(


class BlindCredentialResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = BlindCredentialResponse

Expand Down
9 changes: 0 additions & 9 deletions confidant/schema/certificates.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import attr
import toastedmarshmallow
from marshmallow import fields

from confidant.schema.auto_build_schema import AutobuildSchema
Expand Down Expand Up @@ -32,8 +31,6 @@ def from_cas(cls, cas):


class CertificateAuthorityResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = CertificateAuthorityResponse

Expand All @@ -44,8 +41,6 @@ class Meta:


class CertificateAuthoritiesResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = CertificateAuthoritiesResponse

Expand All @@ -60,8 +55,6 @@ class CertificateResponse(object):


class CertificateResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = CertificateResponse

Expand All @@ -70,8 +63,6 @@ class Meta:


class CertificateExpandedResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = CertificateResponse

Expand Down
7 changes: 0 additions & 7 deletions confidant/schema/credentials.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import attr
import toastedmarshmallow
from marshmallow import fields, pre_dump, Schema

from confidant.schema.auto_build_schema import AutobuildSchema
Expand Down Expand Up @@ -51,8 +50,6 @@ def from_credential(


class CredentialResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = CredentialResponse

Expand Down Expand Up @@ -99,8 +96,6 @@ def from_credentials(


class CredentialsResponseSchema(Schema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = CredentialsResponse

Expand Down Expand Up @@ -151,8 +146,6 @@ def from_credentials(


class RevisionsResponseSchema(Schema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = RevisionsResponse

Expand Down
7 changes: 0 additions & 7 deletions confidant/schema/jwks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import attr
import toastedmarshmallow
from marshmallow import fields

from confidant.schema.auto_build_schema import AutobuildSchema
Expand All @@ -11,8 +10,6 @@ class JWTResponse(object):


class JWTResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = JWTResponse
token = fields.Str(required=True)
Expand All @@ -32,8 +29,6 @@ class JWKSResponse(object):


class JWKSResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = JWKSResponse

Expand All @@ -45,8 +40,6 @@ class Meta:


class JWKSListResponseSchema(AutobuildSchema):
class Meta:
jit = toastedmarshmallow.Jit

_class_to_load = JWKSListResponse
keys = fields.List(fields.Nested(JWKSResponseSchema))
Expand Down
Loading

0 comments on commit 4381e29

Please sign in to comment.