File tree Expand file tree Collapse file tree 7 files changed +1197
-1530
lines changed Expand file tree Collapse file tree 7 files changed +1197
-1530
lines changed Original file line number Diff line number Diff line change 11# Image for a Python 3 development environment
2- FROM python:3.11-slim
3-
4- # Add any tools that are needed beyond Python 3.11
5- RUN apt-get update && \
6- apt-get install -y sudo vim make git zip tree curl wget jq procps net-tools && \
7- apt-get autoremove -y && \
8- apt-get clean -y
9-
10- # Create a user for development
11- ARG USERNAME=devops
12- ARG USER_UID=1000
13- ARG USER_GID=$USER_UID
14-
15- # Create the user with passwordless sudo privileges
16- RUN groupadd --gid $USER_GID $USERNAME \
17- && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash \
18- && usermod -aG sudo $USERNAME \
19- && echo $USERNAME ALL=\( root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
20- && chmod 0440 /etc/sudoers.d/$USERNAME
2+ FROM rofrano/nyu-devops-base:sp25
213
224# Set up the Python development environment
235WORKDIR /app
24- COPY pyproject.toml poetry.lock ./
25- RUN python -m pip install -U pip poetry && \
26- poetry config virtualenvs.create false && \
27- poetry install
6+ COPY Pipfile Pipfile.lock ./
7+ RUN python -m pip install -U pip pipenv && \
8+ pipenv install --system --dev
289
29- ENV PORT 8080
10+ ENV PORT= 8080
3011EXPOSE $PORT
3112
3213# Enable color terminal for docker exec bash
Original file line number Diff line number Diff line change @@ -6,11 +6,10 @@ FROM python:3.11-slim
66# Establish a working folder
77WORKDIR /app
88
9- # Establish dependencies
10- COPY pyproject.toml poetry.lock ./
11- RUN python -m pip install poetry && \
12- poetry config virtualenvs.create false && \
13- poetry install --without dev
9+ # Establish dependencies without dev tools
10+ COPY Pipfile Pipfile.lock ./
11+ RUN python -m pip install -U pip pipenv && \
12+ pipenv install --system
1413
1514# Copy source files last because they change the most
1615COPY wsgi.py .
@@ -23,7 +22,7 @@ USER flask
2322
2423# Expose any ports the app is expecting in the environment
2524ENV FLASK_APP=wsgi:app
26- ENV PORT 8080
25+ ENV PORT= 8080
2726EXPOSE $PORT
2827
2928ENV GUNICORN_BIND 0.0.0.0:$PORT
Original file line number Diff line number Diff line change 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-restx = " ==1.3.0"
9+ cloudant = " ==2.15.0"
10+ urllib3 = " ==1.26.19" # DO NOT upgrade this!
11+ retry2 = " ==0.9.5"
12+ python-dotenv = " ==1.0.1"
13+ gunicorn = " ==23.0.0"
14+
15+ [dev-packages ]
16+ honcho = " ~=2.0.0"
17+ pylint = " ~=3.3.4"
18+ flake8 = " ~=7.1.1"
19+ black = " ~=25.1.0"
20+ pytest = " ~=8.3.4"
21+ pytest-pspec = " ~=0.0.4"
22+ pytest-cov = " ~=6.0.0"
23+ factory-boy = " ~=3.3.3"
24+ coverage = " ~=7.6.12"
25+ httpie = " ~=3.2.4"
26+
27+ [requires ]
28+ python_version = " 3.11"
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # #######################################
2+ # Tool configurations
3+ # #######################################
4+ # cspell: disable
5+
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
122[flake8]
223max-line-length = 127
324per-file-ignores =
425 */__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:xml]
51+ output =./coverage.xml
52+
53+ [coverage:html]
54+ title = ' Test Coverage Report'
55+ directory = ' coverage_html_report'
You can’t perform that action at this time.
0 commit comments