Skip to content

Commit

Permalink
Release 2.0.2 (#43)
Browse files Browse the repository at this point in the history
* [CCTRI-2939] move from pip to pipenv (#42)

* Release 2.0.2
  • Loading branch information
mstoro authored Aug 23, 2021
1 parent 149d7f4 commit 07c2c88
Show file tree
Hide file tree
Showing 8 changed files with 449 additions and 32 deletions.
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM alpine:3.14
LABEL maintainer="Ian Redden <iaredden@cisco.com>"

ENV PIP_IGNORE_INSTALLED 1

# install packages we need
RUN apk update && apk add --no-cache musl-dev openssl-dev gcc py3-configobj \
supervisor git libffi-dev uwsgi-python3 uwsgi-http jq syslog-ng uwsgi-syslog \
supervisor libffi-dev uwsgi-python3 uwsgi-http jq syslog-ng uwsgi-syslog \
py3-pip python3-dev

# do the Python dependencies
ADD code /app
RUN pip3 install -r /app/requirements.txt
ADD code/Pipfile code/Pipfile.lock /
RUN set -ex && pip install --no-cache-dir --upgrade pipenv && \
pipenv install --system
RUN chown -R uwsgi.uwsgi /etc/uwsgi

# copy over scripts to init
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,23 @@ As some providers do not fully support OData query filters yet (e.g. Office 365

## Testing (Optional)

If you want to test the application you will require Docker and several dependencies from the [requirements.txt](code/requirements.txt) file:
Open the code folder in your terminal.
```
pip install --upgrade --requirement code/requirements.txt
cd code
```

If you want to test the application you will require Docker and several dependencies from the [Pipfile](code/Pipfile) file:
```
pip install --no-cache-dir --upgrade pipenv && pipenv install --dev
```

You can perform two kinds of testing:

- Run static code analysis checking for any semantic discrepancies and [PEP 8](https://www.python.org/dev/peps/pep-0008/) compliance:

`flake8 code`
`flake8 .`

- Run the suite of unit tests and measure the code coverage:
`cd code`
`coverage run --source api/ -m pytest --verbose tests/unit/ && coverage report`

**NOTE.** If you need input data for testing purposes you can use data from the
Expand Down
19 changes: 19 additions & 0 deletions code/Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
cryptography = "==3.3.2"
Flask = "==2.0.1"
marshmallow = "==3.12.1"
requests = "==2.25.1"
PyJWT = "==2.1.0"

[dev-packages]
flake8 = "==3.9.2"
coverage = "==5.5"
pytest = "==6.2.4"

[requires]
python_version = "3.9"
415 changes: 415 additions & 0 deletions code/Pipfile.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion code/container_settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"VERSION": "2.0.1",
"VERSION": "2.0.2",
"NAME": "Microsoft Graph Security"
}
8 changes: 0 additions & 8 deletions code/requirements.txt

This file was deleted.

6 changes: 0 additions & 6 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/usr/bin/env sh
set -e

# Grab the repository
if [ -n "$GITREPO" ]; then
echo "rm -rf /app && git clone $GITREPO /app"
rm -rf /app && git clone $GITREPO /app
fi


if [ -n "$ALPINEPYTHON" ] ; then
export PYTHONPATH=$PYTHONPATH:/usr/local/lib/$ALPINEPYTHON/site-packages:/usr/lib/$ALPINEPYTHON/site-packages
Expand Down

0 comments on commit 07c2c88

Please sign in to comment.