-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adjust python package manager run command (#134)
* chore: add test project with Pipenv Add test project with Pipenv and updates the test function to work with both GitLab and Github * fix: adjust Eta.js whitespace delimiter Eta.js comes with an implemented way of handling white spaces(see: https://eta.js.org/docs/syntax/whitespace-control). Some commands were using the delimiter _ at the end of the tag which trims all withe space after it, in our case just put a space before the delimiter resolves the problem. ref #132
- Loading branch information
1 parent
5b37cc6
commit 57601ad
Showing
22 changed files
with
435 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/fixtures/python/python-pipenv/expected/.github/workflows/pipelinit.python.format.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
name: Format Python | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.py" | ||
jobs: | ||
format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
- run: python -m pip install pipenv; pipenv install --dev | ||
|
||
- run: python -m pip install pip black | ||
|
||
- run: pipenv run black . --check | ||
- run: pipenv run isort . -c |
23 changes: 23 additions & 0 deletions
23
tests/fixtures/python/python-pipenv/expected/.github/workflows/pipelinit.python.lint.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
name: Lint Python | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.py" | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
- run: python -m pip install pipenv; pipenv install --dev | ||
|
||
|
||
# Adapts Flake8 to run with the Black formatter, using the '--ignore' flag to skip incompatibilities errors | ||
# Reference: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html?highlight=other%20tools#id1 | ||
- run: pipenv run flake8 --ignore E203,E501,W503 . | ||
- run: pipenv run bandit -r . |
17 changes: 17 additions & 0 deletions
17
tests/fixtures/python/python-pipenv/expected/.github/workflows/pipelinit.python.sast.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
name: SAST Python | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.py" | ||
jobs: | ||
semgrep: | ||
name: Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: returntocorp/semgrep-action@v1 | ||
with: | ||
config: >- | ||
p/owasp-top-ten |
21 changes: 21 additions & 0 deletions
21
tests/fixtures/python/python-pipenv/expected/.github/workflows/pipelinit.python.test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
name: Test Python | ||
on: | ||
pull_request: | ||
paths: | ||
- "**.py" | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
- run: python -m pip install pipenv; pipenv install --dev | ||
|
||
- name: Run Tests | ||
run: | | ||
python manage.py test |
13 changes: 13 additions & 0 deletions
13
tests/fixtures/python/python-pipenv/expected/.gitlab-ci.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
stages: | ||
- lint | ||
- format | ||
- sast | ||
- test | ||
|
||
include: | ||
- local: ".gitlab-ci/pipelinit.python.lint.yaml" | ||
- local: ".gitlab-ci/pipelinit.python.format.yaml" | ||
- local: ".gitlab-ci/pipelinit.python.test.yaml" | ||
- local: ".gitlab-ci/pipelinit.python.sast.yaml" |
16 changes: 16 additions & 0 deletions
16
tests/fixtures/python/python-pipenv/expected/.gitlab-ci/pipelinit.python.format.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
format: | ||
stage: format | ||
image: python:3.8 | ||
needs: [] | ||
script: | ||
- python -m pip install pipenv; pipenv install --dev | ||
- python -m pip install pip black | ||
- pipenv run black . --check | ||
- pipenv run isort . -c | ||
only: | ||
refs: | ||
- merge_requests | ||
changes: | ||
- "**/*.py" |
16 changes: 16 additions & 0 deletions
16
tests/fixtures/python/python-pipenv/expected/.gitlab-ci/pipelinit.python.lint.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
lint: | ||
stage: lint | ||
image: python:3.8 | ||
needs: [] | ||
script: | ||
- python -m pip install pipenv; pipenv install --dev | ||
# Adapts Flake8 to run with the Black formatter, using the '--ignore' flag to skip incompatibilities errors | ||
# Reference: https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html?highlight=other%20tools#id1 | ||
- pipenv run flake8 --ignore E203,E501,W503 . | ||
only: | ||
refs: | ||
- merge_requests | ||
changes: | ||
- "**/*.py" |
28 changes: 28 additions & 0 deletions
28
tests/fixtures/python/python-pipenv/expected/.gitlab-ci/pipelinit.python.sast.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
semgrep: | ||
stage: sast | ||
image: returntocorp/semgrep-agent:v1 | ||
needs: ["format", "lint"] | ||
only: | ||
refs: | ||
- merge_requests | ||
changes: | ||
- "**/*.py" | ||
script: semgrep-agent | ||
variables: | ||
SEMGREP_RULES: >- | ||
p/owasp-top-ten | ||
bandit: | ||
stage: sast | ||
image: python:3.8 | ||
needs: ["format", "lint"] | ||
script: | ||
- python -m pip install pipenv; pipenv install --dev | ||
- pipenv run bandit -r . | ||
only: | ||
refs: | ||
- merge_requests | ||
changes: | ||
- "**/*.py" |
14 changes: 14 additions & 0 deletions
14
tests/fixtures/python/python-pipenv/expected/.gitlab-ci/pipelinit.python.test.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Generated with pipelinit 0.3.0 | ||
# https://pipelinit.com/ | ||
test: | ||
stage: test | ||
image: python:3.8 | ||
needs: ["format", "lint", "bandit", "semgrep"] | ||
only: | ||
refs: | ||
- merge_requests | ||
changes: | ||
- "**/*.py" | ||
script: | ||
- python -m pip install pipenv; pipenv install --dev | ||
- python manage.py test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
platforms = ["github", "gitlab"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
requests = "~=2.25" | ||
gunicorn = "~=20.1" | ||
whitenoise = "~=5.2" | ||
django = "~=3.0" | ||
|
||
[dev-packages] | ||
flake8 = "~=3.9.2" | ||
isort = "~=5.9.3" | ||
bandit = "~=1.7.0" | ||
|
||
[requires] | ||
python_version = "3.8" | ||
|
||
[pipenv] | ||
allow_prereleases = true |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
""" | ||
It exposes the ASGI callable as a module-level variable named ``application``. | ||
For more information on this file, see | ||
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/ | ||
""" | ||
|
||
import os | ||
|
||
from django.core.asgi import get_asgi_application | ||
|
||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "api.settings") | ||
|
||
application = get_asgi_application() |
Oops, something went wrong.