Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md inlcuded snyk tag. #27

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
# Python CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-python/ for more details
Expand Down Expand Up @@ -67,25 +68,27 @@ jobs:
test-3.5:
<<: *test-template
docker:
- image: circleci/python:3.5
- image: circleci/python:3.5
test-2.7:
<<: *test-template
docker:
- image: circleci/python:2.7
- image: circleci/python:2.7
steps:
- checkout
# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies-{{ checksum "setup.py" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- v1-dependencies-{{ checksum "setup.py" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-

- run:
name: install dependencies
command: |
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
sudo apt-get install -y make build-essential \
libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev \
wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
curl https://pyenv.run | bash
export PATH="$HOME/.pyenv/bin:$PATH"
Expand All @@ -95,7 +98,7 @@ jobs:
sudo chown -R circleci:circleci ~/.pyenv/versions/venv
- save_cache:
paths:
- ~/.pyenv/versions/venv
- ~/.pyenv/versions/venv
key: v1-dependencies-{{ checksum "setup.py" }}

# run tests!
Expand All @@ -114,7 +117,5 @@ jobs:
. ~/.pyenv/versions/venv/bin/activate
tox

- store_artifacts:
path: test-reports
destination: test-reports

- store_test_results:
path: test-results
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ install: clean-build ## Install project dependencies.
@echo "Installing project in dependencies..."
@$(PYTHON_PIP) install -r requirements.txt

install-lint: pipconf clean-build ## Install lint extra dependencies.
install-lint: clean-build ## Install lint extra dependencies.
@echo "Installing lint extra requirements..."
@$(PYTHON_PIP) install -e .'[lint]'

install-test: clean-build ## Install test extra dependencies.
install-test: clean-build clean-test-all ## Install test extra dependencies.
@echo "Installing test extra requirements..."
@$(PYTHON_PIP) install -e .'[test]'

Expand Down Expand Up @@ -83,5 +83,6 @@ tox: install-test ## Run tox test

clean-test-all: clean-build ## Clean build and test assets.
@rm -rf .tox/
@rm -rf test-results
@rm -rf .pytest_cache/
@rm test.db
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django_clone.svg)](https://pypi.org/project/django-clone)
[![PyPI - License](https://img.shields.io/pypi/l/django_clone.svg)](https://github.com/jackton1/django-clone/blob/master/LICENSE)
[![PyPI - Django Version](https://img.shields.io/pypi/djversions/django_clone.svg)](https://docs.djangoproject.com/en/2.2/releases/)
[![Known Vulnerabilities](https://snyk.io/test/github/jackton1/django-clone/badge.svg?targetFile=requirements.txt)](https://snyk.io/test/github/jackton1/django-clone?targetFile=requirements.txt)
## django-clone

Creating copies of a model instance on the fly offering more control on how the object should be cloned with support for limiting the fields or related objects copied.
Expand Down
11 changes: 11 additions & 0 deletions django_clone/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,14 @@
# https://docs.djangoproject.com/en/2.0/howto/static-files/

STATIC_URL = '/static/'

try:
import xmlrunner
except ImportError:
pass
else:
# https://github.com/xmlrunner/unittest-xml-reporting#django
TEST_RUNNER = 'xmlrunner.extra.djangotestrunner.XMLTestRunner'
TEST_OUTPUT_VERBOSE = 2
TEST_OUTPUT_DESCRIPTIONS = True
TEST_OUTPUT_DIR = 'test-reports'
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ exclude =
sample/urls.py,
django_clone/settings.py,
manage.py,
venv,
max-line-length = 95
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
'tox==3.8.6',
'pluggy>=0.7',
'mock==2.0.0',
'unittest-xml-reporting==2.5.2',
'codacy-coverage==1.3.11',
]

Expand Down
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
minversion = 3.8.0
skipsdist = false
envlist =
yamllint
flake8
py27-django{11}
py35-django{11,20,21}
Expand All @@ -20,6 +21,7 @@ basepython =
py35: python3.5
py36: python3.6
flake8: python3.7
yamllint: python3.7
whitelist_externals = make
setenv = DJANGO_SETTINGS_MODULE=django_clone.settings
passenv = PYTHONPATH HOME DISPLAY CODACY_PROJECT_TOKEN
Expand Down Expand Up @@ -48,3 +50,9 @@ commands =
deps = flake8
commands =
flake8 .

[testenv:yamllint]
deps = yamllint==1.10.0
changedir = {toxinidir}
commands =
yamllint --strict -f standard .circleci/config.yml