File tree 10 files changed +1118
-1472
lines changed
10 files changed +1118
-1472
lines changed Original file line number Diff line number Diff line change 1
1
# Image for a Python 3 development environment
2
2
FROM python:3.11-slim
3
3
4
- # Add any tools that are needed beyond Python 3.9
4
+ # Add any tools that are needed beyond Python 3.11
5
5
RUN apt-get update && \
6
6
apt-get install -y sudo vim make git zip tree curl wget jq procps net-tools && \
7
7
apt-get autoremove -y && \
@@ -20,18 +20,13 @@ RUN groupadd --gid $USER_GID $USERNAME \
20
20
&& chmod 0440 /etc/sudoers.d/$USERNAME \
21
21
&& chown -R $USERNAME:$USERNAME /home/$USERNAME
22
22
23
- # Install poetry stand alone
24
- # RUN curl -sSL https://install.python-poetry.org | python3 - && \
25
- # poetry config virtualenvs.create false
26
-
27
23
# Set up the Python development environment
28
24
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
33
28
34
- ENV PORT 8000
29
+ ENV PORT= 8000
35
30
EXPOSE $PORT
36
31
37
32
# Enable color terminal for docker exec bash
Original file line number Diff line number Diff line change 54
54
" hbenl.vscode-test-explorer" ,
55
55
" LittleFoxTeam.vscode-python-test-adapter" ,
56
56
" redhat.vscode-yaml" ,
57
- " rangav.vscode-thunder -client" ,
57
+ " unjinjang.rest-api -client" ,
58
58
" ms-azuretools.vscode-docker" ,
59
- " redhat.fabric8-analytics" ,
60
59
" github.vscode-github-actions" ,
61
60
" streetsidesoftware.code-spell-checker" ,
62
61
" bbenoist.vagrant"
Original file line number Diff line number Diff line change @@ -42,11 +42,10 @@ jobs:
42
42
- name : Checkout
43
43
uses : actions/checkout@v3
44
44
45
- - name : Install dependencies
45
+ - name : Install Python package dependencies
46
46
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
50
49
51
50
- name : Run Code Quality Checks
52
51
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
8
8
9
9
- The API must be RESTful.
10
10
- The endpoint must be called ` /counters ` .
11
+ - The data returned should be this ` {"name":"some_name", "counter":0} `
11
12
- When creating a counter, you must specify the name in the path.
12
13
- Duplicate names must return a conflict error code.
13
14
- The service must be able to update a counter by name.
Original file line number Diff line number Diff line change 4
4
Requirements for the counter service
5
5
- The API must be RESTful.
6
6
- The endpoint must be called `/counters`.
7
+ - The data returned should be this {"name":"some_name", "counter":0}
7
8
- When creating a counter, you must specify the name in the path.
8
- - The data returned should be this {"name":"some_name", "counter:0}
9
9
- Duplicate names must return a 409 conflict error code.
10
10
- The service must be able to update a counter by name.
11
11
- 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
2
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
3
22
[flake8]
4
23
max-line-length = 127
5
24
per-file-ignores =
6
25
*/__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