Skip to content

Commit e2e25d3

Browse files
committed
Refactoring to look like real repo
1 parent 6d4b31a commit e2e25d3

35 files changed

+194
-27
lines changed

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[run]
2+
source = .
3+
4+
[report]
5+
omit = *venv/*

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# environment
2+
/env/
3+
/venv/
4+
15
# Python compiled byte code
26
*.pyc
37

Makefile

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.PHONY: test fasttest run lint pep8 eslint
2+
3+
# Project settings
4+
LEVEL ?= development
5+
PROJECT = src
6+
7+
# Virtual environment settings
8+
ENV ?= ./venv
9+
VENV = $(shell python -c "import sys; print(int(hasattr(sys, 'real_prefix')));")
10+
11+
# Python commands
12+
ifeq ($(VENV),1)
13+
ANSIBLE_PLAYBOOK = ansible-playbook
14+
COVERAGE = coverage
15+
FLAKE8 = flake8
16+
GUNICORN = gunicorn
17+
PYTHON = python
18+
else
19+
ANSIBLE_PLAYBOOK = $(ENV)/bin/ansible-playbook
20+
COVERAGE = ${ENV}/bin/coverage
21+
FLAKE8 = $(ENV)/bin/flake8
22+
GUNICORN = $(ENV)/bin/gunicorn
23+
PYTHON = $(ENV)/bin/python
24+
endif
25+
26+
SERVER_HOST ?= 0.0.0.0
27+
SERVER_PORT ?= 8000
28+
29+
# Easy testing
30+
test:
31+
python manage.py test
32+
33+
# Fast testing
34+
fasttest:
35+
REUSE_DB=1 $(MAKE) test
36+
37+
# Run server
38+
run:
39+
python manage.py runserver $(SERVER_HOST):$(SERVER_PORT)
40+
41+
# Linter
42+
lint: pep8
43+
44+
# PEP8 code style
45+
pep8:
46+
ifeq ($(LEVEL),development)
47+
$(FLAKE8) --statistics ./$(PROJECT)/
48+
endif
49+
50+
# JavaScript linter
51+
eslint:
52+
ifeq ($(LEVEL),development)
53+
npm run lint
54+
endif

authentication/admin.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

authentication/tests.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

circle.yml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
## Customize the test machine
2+
machine:
3+
environment:
4+
COVERALLS_REPO_TOKEN: BIJEGOKsEvdhmwdLlC2QMSp1k9tbjwBYk
5+
DATABASE_URL: postgres://ubuntu:@127.0.0.1:5432/circle_test
6+
DJANGO_SETTINGS_MODULE: django_and_angular.settings
7+
LEVEL: development
8+
9+
timezone:
10+
Russia/Moscow # Set the timezone
11+
12+
# Version of ruby to use
13+
python:
14+
version:
15+
2.7.11
16+
17+
test:
18+
override:
19+
- TEST_ARGS=--with-xunit make lint test
20+
21+
post:
22+
- coveralls
23+
- mkdir -p $CIRCLE_TEST_REPORTS/junit/
24+
- "[ -r nosetests.xml ] && mv nosetests.xml $CIRCLE_TEST_REPORTS/junit/ || :"
25+
26+
# # Override /etc/hosts
27+
# hosts:
28+
# circlehost: 127.0.0.1
29+
# dev.mycompany.com: 127.0.0.1
30+
31+
# # Add some environment variables
32+
# environment:
33+
# CIRCLE_ENV: test
34+
# DATABASE_URL: postgres://ubuntu:@127.0.0.1:5432/circle_test
35+
36+
### Customize checkout
37+
#checkout:
38+
# post:
39+
# - git submodule sync
40+
# - git submodule update --init # use submodules
41+
42+
## Customize dependencies
43+
#dependencies:
44+
# pre:
45+
# - npm install coffeescript # install from a different package manager
46+
# - gem uninstall bundler # use a custom version of bundler
47+
# - gem install bundler --pre
48+
49+
# override:
50+
# - bundle install: # note ':' here
51+
# timeout: 180 # fail if command has no output for 3 minutes
52+
53+
# we automatically cache and restore many dependencies between
54+
# builds. If you need to, you can add custom paths to cache:
55+
# cache_directories:
56+
# - "custom_1" # relative to the build directory
57+
# - "~/custom_2" # relative to the user's home directory
58+
59+
## Customize database setup
60+
#database:
61+
# override:
62+
# # replace CircleCI's generated database.yml
63+
# - cp config/database.yml.ci config/database.yml
64+
# - bundle exec rake db:create db:schema:load
65+
66+
## Customize test commands
67+
#test:
68+
# override:
69+
# - phpunit test/unit-tests # use PHPunit for testing
70+
# post:
71+
# - bundle exec rake jasmine:ci: # add an extra test type
72+
# environment:
73+
# RAILS_ENV: test
74+
# RACK_ENV: test
75+
76+
## Customize deployment commands
77+
#deployment:
78+
# staging:
79+
# branch: master
80+
# heroku:
81+
# appname: foo-bar-123
82+
83+
## Custom notifications
84+
#notify:
85+
# webhooks:
86+
# # A list of hashes representing hooks. Only the url field is supported.
87+
# - url: https://someurl.com/hooks/circle

posts/admin.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

posts/tests.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements-dev.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
flake8==2.3.0
2+
flake8-import-order==0.5.3
3+
flake8-pep257==1.0.3
4+
pep257==0.6.0
5+
pep8==1.6.2
6+
pep8-naming==0.3.3

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ django-compressor==1.4
66
djangorestframework==3.0.0
77
drf-nested-routers==0.9.0
88
gunicorn==19.1.1
9+
raven==5.10.2
910
six==1.8.0
1011
static3==0.5.1
1112
wsgiref==0.1.2

0 commit comments

Comments
 (0)