Skip to content
This repository has been archived by the owner on Aug 9, 2024. It is now read-only.

Commit

Permalink
Merge pull request #19 from MarketSquare/support_python_312
Browse files Browse the repository at this point in the history
Support python 312
  • Loading branch information
robinmackaij authored Feb 12, 2024
2 parents fb58576 + 5428d2d commit 5cc94fa
Show file tree
Hide file tree
Showing 15 changed files with 1,224 additions and 901 deletions.
15 changes: 15 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM python:3.12-slim-bookworm

RUN pip install --upgrade pip

# poetry install into the default Python interpreter since we're in a container
RUN pip install poetry
RUN poetry config virtualenvs.create false
RUN poetry config virtualenvs.in-project false

# Copy the pyproject.toml and poetry.lock file to be able to install dependencies using poetry
COPY pyproject.toml pyproject.toml
COPY poetry.lock poetry.lock

EXPOSE 8888
ENTRYPOINT /bin/sh
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Local Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "./Dockerfile",
"args": {
}
},
"postCreateCommand": "poetry install",
// Configure tool-specific properties.
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"robotcode.robot.variables": {
"ROOT": "/workspaces/robotframework-openapi-libcore"
}
},
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"d-biehl.robotcode",
"ms-azuretools.vscode-docker",
"Gruntfuggly.todo-tree",
"shardulm94.trailing-spaces"
]
}
}
}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ report.html
tests/logs

# IDE config
.vscode
.vscode/launch.json
.vscode/settings.json

# PowerShell utility scripts
_*.ps1
33 changes: 33 additions & 0 deletions .vscode/example.launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "RobotCode: Default",
"type": "robotcode",
"request": "launch",
"purpose": "default",
"presentation": {
"hidden": true
},
"attachPython": true,
"pythonConfiguration": "RobotCode: Python",
"args": [
"--variable=ROOT:${workspaceFolder}",
"--outputdir=${workspaceFolder}/tests/logs",
"--loglevel=TRACE:INFO"
]
},
{
"name": "RobotCode: Python",
"type": "python",
"request": "attach",
"presentation": {
"hidden": true
},
"justMyCode": false
}
]
}
5 changes: 5 additions & 0 deletions .vscode/example.settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"robotcode.robot.variables": {
"ROOT": "/workspaces/robotframework-openapi-libcore"
}
}
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"ms-vscode-remote.remote-containers",
"ms-python.python",
"ms-python.vscode-pylance",
"charliermarsh.ruff",
"d-biehl.robotcode"
]
}
51 changes: 36 additions & 15 deletions docs/openapi_libcore.html

Large diffs are not rendered by default.

1,651 changes: 847 additions & 804 deletions poetry.lock

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name="robotframework-openapi-libcore"
version = "1.10.1"
version = "1.11.0"
description = "A Robot Framework library to facilitate library development for OpenAPI / Swagger APIs."
license = "Apache-2.0"
authors = ["Robin Mackaij <[email protected]>"]
Expand All @@ -25,10 +25,10 @@ include = ["*.libspec"]
python = "^3.8"
robotframework = ">=4"
requests = "^2.27"
prance = {version = "^0.22", extras = ["CLI"]}
prance = {version = "^23.6", extras = ["CLI"]}
Faker = ">=11"
rstr = "^3"
openapi-core = "^0.17.0"
openapi-core = "^0.18.0"

[tool.poetry.group.dev.dependencies]
fastapi = ">=0.95.0"
Expand Down Expand Up @@ -100,9 +100,11 @@ py_version=38

[tool.ruff]
line-length = 120
select = ["E", "F", "PL"]
src = ["src/OpenApiDriver"]

[tool.ruff.lint]
select = ["E", "F", "PL"]

[tool.pylint.'MESSAGES CONTROL']
disable = ["logging-fstring-interpolation", "missing-class-docstring"]

Expand Down
1 change: 1 addition & 0 deletions src/OpenApiLibCore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Dto, Relation: Base classes that can be used for type annotations.
- IGNORE: A special constant that can be used as a value in the PropertyValueConstraint.
"""

from importlib.metadata import version

from OpenApiLibCore.dto_base import (
Expand Down
1 change: 1 addition & 0 deletions src/OpenApiLibCore/dto_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
to implement custom mappings for dependencies between resources in the API under
test and constraints / restrictions on properties of the resources.
"""

from abc import ABC
from copy import deepcopy
from dataclasses import dataclass, fields
Expand Down
7 changes: 4 additions & 3 deletions src/OpenApiLibCore/dto_utils.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module for helper methods and classes used by the openapi_executors module."""

from dataclasses import dataclass
from importlib import import_module
from logging import getLogger
Expand Down Expand Up @@ -29,9 +30,9 @@ class get_dto_class:
def __init__(self, mappings_module_name: str) -> None:
try:
mappings_module = import_module(mappings_module_name)
self.dto_mapping: Dict[
Tuple[str, str], Type[Dto]
] = mappings_module.DTO_MAPPING
self.dto_mapping: Dict[Tuple[str, str], Type[Dto]] = (
mappings_module.DTO_MAPPING
)
except (ImportError, AttributeError, ValueError) as exception:
if mappings_module_name != "no mapping":
logger.error(f"DTO_MAPPING was not imported: {exception}")
Expand Down
Loading

0 comments on commit 5cc94fa

Please sign in to comment.