File tree Expand file tree Collapse file tree 10 files changed +1118
-1472
lines changed Expand file tree Collapse file tree 10 files changed +1118
-1472
lines changed Original file line number Diff line number Diff line change 11# Image for a Python 3 development environment
22FROM 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
55RUN 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
2824WORKDIR /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
3530EXPOSE $PORT
3631
3732# Enable color terminal for docker exec bash
Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff 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 : |
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-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"
Original file line number Diff line number Diff 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.
Original file line number Diff line number Diff line change 44Requirements 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.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 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]
423max-line-length = 127
524per-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+
You can’t perform that action at this time.
0 commit comments