Skip to content
Open
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
44 changes: 25 additions & 19 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,32 @@
},
"workspaceMount": "source=${localWorkspaceFolder},target=/cli,type=bind,consistency=cached",
"workspaceFolder": "/cli",
// Set *default* container specific settings.json values on container create.
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.linting.enabled": true,
"python.linting.pylintEnabled": false,
"python.formatting.blackPath": "/usr/local/bin/black",
"python.linting.flake8Path": "/usr/local/bin/flake8",
"python.sortImports.path": "/usr/local/bin/isort",
"python.testing.pytestPath": "/usr/local/bin/pytest"
"customizations": {
"vscode": {
// Set *default* container specific settings.json values on container create.
"settings": {
"python.defaultInterpreterPath": "/opt/venv/bin/python",
"black-formatter.path": ["/opt/venv/bin/black"],
"flake8.path": ["/opt/venv/bin/flake8"],
"isort.path": ["/opt/venv/bin/isort"],
"mypy.dmypyExecutable": "/opt/venv/bin/dmypy",
"python.testing.pytestPath": "/opt/venv/bin/pytest"
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.black-formatter",
"ms-python.flake8",
"ms-python.isort",
"streetsidesoftware.code-spell-checker",
"ms-azuretools.vscode-docker",
"asciidoctor.asciidoctor-vscode",
"42crunch.vscode-openapi",
"matangover.mypy",
"njpwerner.autodocstring"
]
}
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"streetsidesoftware.code-spell-checker",
"ms-azuretools.vscode-docker",
"asciidoctor.asciidoctor-vscode",
"42crunch.vscode-openapi",
"matangover.mypy",
"njpwerner.autodocstring"
]
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Uncomment the next line if you want start specific services in your Docker Compose config.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/python-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.10"
python-version: "3.12"

- name: Install Poetry
uses: snok/install-poetry@v1
Expand Down
19 changes: 11 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,31 +14,34 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM ubuntu:22.04
FROM ubuntu:24.04

# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1

# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1

RUN apt-get update && apt-get install -y python3-pip python3-venv libpq-dev curl
RUN apt-get update && apt-get install -y python3-pip python3-venv libpq-dev curl

RUN ln -s /usr/bin/python3.10 /usr/local/bin/python
RUN ln -s /usr/bin/python3.12 /usr/local/bin/python

# Create a virtual environment for the project dependencies
ENV VIRTUAL_ENV=/opt/venv
RUN python -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

# Use /cli to host cli source
WORKDIR /cli/
ENV PYTHONPATH=/cli

# Install Poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | POETRY_HOME=/opt/poetry python && \
cd /usr/local/bin && \
ln -s /opt/poetry/bin/poetry && \
poetry config virtualenvs.create false
RUN curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 - && \
ln -s /opt/poetry/bin/poetry /usr/local/bin/poetry

# Allow installing dev dependencies to run tests
# Copy poetry dependecy files and install dependencies
# We copy install dependencies before copying all cli source to reuse the dependency install step in docker.
COPY pyproject.toml poetry.lock /cli/
ARG INSTALL_DEV=true
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --no-dev ; fi"
RUN bash -c "if [ $INSTALL_DEV == 'true' ] ; then poetry install --no-root ; else poetry install --no-root --only main ; fi"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CLI tool for using the CSA Test Harness
## Requirements

1. Ubuntu Server OS
2. Python >= 3.10
2. Python >= 3.12
3. Poetry installed (see: https://python-poetry.org/docs/#installation)

## Setup
Expand Down
1 change: 1 addition & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
; See the License for the specific language governing permissions and
; limitations under the License.
[mypy]
python_version = 3.12
plugins = pydantic.mypy
ignore_missing_imports = True
disallow_untyped_defs = True
Expand Down
Loading
Loading