Skip to content

Updates for Sprint 2025 Semester #39

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

Merged
merged 6 commits into from
Feb 15, 2025
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
15 changes: 5 additions & 10 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Image for a Python 3 development environment
FROM python:3.11-slim

# Add any tools that are needed beyond Python 3.9
# Add any tools that are needed beyond Python 3.11
RUN apt-get update && \
apt-get install -y sudo vim make git zip tree curl wget jq procps net-tools && \
apt-get autoremove -y && \
Expand All @@ -20,18 +20,13 @@ RUN groupadd --gid $USER_GID $USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME \
&& chown -R $USERNAME:$USERNAME /home/$USERNAME

# Install poetry stand alone
# RUN curl -sSL https://install.python-poetry.org | python3 - && \
# poetry config virtualenvs.create false

# Set up the Python development environment
WORKDIR /app
COPY pyproject.toml poetry.lock ./
RUN python -m pip install -U pip poetry && \
poetry config virtualenvs.create false && \
poetry install
COPY Pipfile Pipfile.lock ./
RUN python -m pip install -U pip pipenv && \
pipenv install --system --dev

ENV PORT 8000
ENV PORT=8000
EXPOSE $PORT

# Enable color terminal for docker exec bash
Expand Down
3 changes: 1 addition & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@
"hbenl.vscode-test-explorer",
"LittleFoxTeam.vscode-python-test-adapter",
"redhat.vscode-yaml",
"rangav.vscode-thunder-client",
"unjinjang.rest-api-client",
"ms-azuretools.vscode-docker",
"redhat.fabric8-analytics",
"github.vscode-github-actions",
"streetsidesoftware.code-spell-checker",
"bbenoist.vagrant"
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
- name: Install Python package dependencies
run: |
python -m pip install -U pip poetry
poetry config virtualenvs.create false
poetry install
python -m pip install -U pip pipenv
pipenv install --system --dev

- name: Run Code Quality Checks
run: |
Expand Down
27 changes: 27 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
flask = "==3.1.0"
flask-sqlalchemy = "==3.1.1"
psycopg = {extras = ["binary"], version = "==3.2.4"}
retry2 = "==0.9.5"
python-dotenv = "==1.0.1"
gunicorn = "==23.0.0"

[dev-packages]
honcho = "~=2.0.0"
pylint = "~=3.3.4"
flake8 = "~=7.1.1"
black = "~=25.1.0"
pytest = "~=8.3.4"
pytest-pspec = "~=0.0.4"
pytest-cov = "~=6.0.0"
factory-boy = "~=3.3.3"
coverage = "~=7.6.12"
httpie = "~=3.2.4"

[requires]
python_version = "3.11"
1,033 changes: 1,033 additions & 0 deletions Pipfile.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lab/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Assume you have been asked to create a web service that can keep track of multip

- The API must be RESTful.
- The endpoint must be called `/counters`.
- The data returned should be this `{"name":"some_name", "counter":0}`
- When creating a counter, you must specify the name in the path.
- Duplicate names must return a conflict error code.
- The service must be able to update a counter by name.
Expand Down
2 changes: 1 addition & 1 deletion lab/test_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
Requirements for the counter service
- The API must be RESTful.
- The endpoint must be called `/counters`.
- The data returned should be this {"name":"some_name", "counter":0}
- When creating a counter, you must specify the name in the path.
- The data returned should be this {"name":"some_name", "counter:0}
- Duplicate names must return a 409 conflict error code.
- The service must be able to update a counter by name.
- The service must be able to get a counter's current value.
Expand Down
1,381 changes: 0 additions & 1,381 deletions poetry.lock

This file was deleted.

73 changes: 0 additions & 73 deletions pyproject.toml

This file was deleted.

48 changes: 47 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,52 @@
# Code Quality
########################################
# Tool configurations
########################################
# cspell: disable

# Setup Pytest configuration
[tool:pytest]
minversion = 6.0
addopts = --pspec --cov=service --cov-fail-under=95
testpaths =
tests
integration

# Setup PyLint configuration
[pylint.FORMAT]
max-line-length = 127

[pylint.'MESSAGES CONTROL']
disable = no-member,protected-access,global-statement

# setup Flake8 configuration
[flake8]
max-line-length = 127
per-file-ignores =
*/__init__.py: F401 E402
count = true

# Setup Black configurtion
[black]
line-length = 127

# Setup Coverage configuration
[coverage:run]
source = service
omit =
venv/*
.venv/*

[coverage:report]
show_missing = true
exclude_lines =
pragma: no cover
pragma: no branch
pass
subprocess.CalledProcessError
sys.exit
if __name__ == .__main__.:
ignore_errors = true

[coverage:html]
title = 'Test Coverage Report'