Skip to content

Commit ef78355

Browse files
authored
Merge pull request #39 from nyu-devops/sp25-updates
Updates for Sprint 2025 Semester
2 parents 9152b4b + f2d447c commit ef78355

File tree

10 files changed

+1118
-1472
lines changed

10 files changed

+1118
-1472
lines changed

.devcontainer/Dockerfile

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Image for a Python 3 development environment
22
FROM python:3.11-slim
33

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

23-
# Install poetry stand alone
24-
# RUN curl -sSL https://install.python-poetry.org | python3 - && \
25-
# poetry config virtualenvs.create false
26-
2723
# Set up the Python development environment
2824
WORKDIR /app
29-
COPY pyproject.toml poetry.lock ./
30-
RUN python -m pip install -U pip poetry && \
31-
poetry config virtualenvs.create false && \
32-
poetry install
25+
COPY Pipfile Pipfile.lock ./
26+
RUN python -m pip install -U pip pipenv && \
27+
pipenv install --system --dev
3328

34-
ENV PORT 8000
29+
ENV PORT=8000
3530
EXPOSE $PORT
3631

3732
# Enable color terminal for docker exec bash

.devcontainer/devcontainer.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@
5454
"hbenl.vscode-test-explorer",
5555
"LittleFoxTeam.vscode-python-test-adapter",
5656
"redhat.vscode-yaml",
57-
"rangav.vscode-thunder-client",
57+
"unjinjang.rest-api-client",
5858
"ms-azuretools.vscode-docker",
59-
"redhat.fabric8-analytics",
6059
"github.vscode-github-actions",
6160
"streetsidesoftware.code-spell-checker",
6261
"bbenoist.vagrant"

.github/workflows/ci.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,10 @@ jobs:
4242
- name: Checkout
4343
uses: actions/checkout@v3
4444

45-
- name: Install dependencies
45+
- name: Install Python package dependencies
4646
run: |
47-
python -m pip install -U pip poetry
48-
poetry config virtualenvs.create false
49-
poetry install
47+
python -m pip install -U pip pipenv
48+
pipenv install --system --dev
5049
5150
- name: Run Code Quality Checks
5251
run: |

Pipfile

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[[source]]
2+
url = "https://pypi.org/simple"
3+
verify_ssl = true
4+
name = "pypi"
5+
6+
[packages]
7+
flask = "==3.1.0"
8+
flask-sqlalchemy = "==3.1.1"
9+
psycopg = {extras = ["binary"], version = "==3.2.4"}
10+
retry2 = "==0.9.5"
11+
python-dotenv = "==1.0.1"
12+
gunicorn = "==23.0.0"
13+
14+
[dev-packages]
15+
honcho = "~=2.0.0"
16+
pylint = "~=3.3.4"
17+
flake8 = "~=7.1.1"
18+
black = "~=25.1.0"
19+
pytest = "~=8.3.4"
20+
pytest-pspec = "~=0.0.4"
21+
pytest-cov = "~=6.0.0"
22+
factory-boy = "~=3.3.3"
23+
coverage = "~=7.6.12"
24+
httpie = "~=3.2.4"
25+
26+
[requires]
27+
python_version = "3.11"

Pipfile.lock

+1,033
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lab/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Assume you have been asked to create a web service that can keep track of multip
88

99
- The API must be RESTful.
1010
- The endpoint must be called `/counters`.
11+
- The data returned should be this `{"name":"some_name", "counter":0}`
1112
- When creating a counter, you must specify the name in the path.
1213
- Duplicate names must return a conflict error code.
1314
- The service must be able to update a counter by name.

lab/test_counter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Requirements for the counter service
55
- The API must be RESTful.
66
- The endpoint must be called `/counters`.
7+
- The data returned should be this {"name":"some_name", "counter":0}
78
- When creating a counter, you must specify the name in the path.
8-
- The data returned should be this {"name":"some_name", "counter:0}
99
- Duplicate names must return a 409 conflict error code.
1010
- The service must be able to update a counter by name.
1111
- The service must be able to get a counter's current value.

poetry.lock

-1,381
This file was deleted.

pyproject.toml

-73
This file was deleted.

setup.cfg

+47-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,52 @@
1-
# Code Quality
1+
########################################
2+
# Tool configurations
3+
########################################
4+
# cspell: disable
25

6+
# Setup Pytest configuration
7+
[tool:pytest]
8+
minversion = 6.0
9+
addopts = --pspec --cov=service --cov-fail-under=95
10+
testpaths =
11+
tests
12+
integration
13+
14+
# Setup PyLint configuration
15+
[pylint.FORMAT]
16+
max-line-length = 127
17+
18+
[pylint.'MESSAGES CONTROL']
19+
disable = no-member,protected-access,global-statement
20+
21+
# setup Flake8 configuration
322
[flake8]
423
max-line-length = 127
524
per-file-ignores =
625
*/__init__.py: F401 E402
26+
count = true
27+
28+
# Setup Black configurtion
29+
[black]
30+
line-length = 127
31+
32+
# Setup Coverage configuration
33+
[coverage:run]
34+
source = service
35+
omit =
36+
venv/*
37+
.venv/*
38+
39+
[coverage:report]
40+
show_missing = true
41+
exclude_lines =
42+
pragma: no cover
43+
pragma: no branch
44+
pass
45+
subprocess.CalledProcessError
46+
sys.exit
47+
if __name__ == .__main__.:
48+
ignore_errors = true
49+
50+
[coverage:html]
51+
title = 'Test Coverage Report'
52+

0 commit comments

Comments
 (0)