Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit dacb6fa

Browse files
committed
Improved project organization
1 parent 4cee18a commit dacb6fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1053
-141
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ docs/_build/
1111
public/
1212
.tox
1313
tests/_testdata/media/
14-
.cache/
14+
.cache/
15+
.pytest_cache/

.travis.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ matrix:
1818
exclude:
1919
- python: "2.7"
2020
env: DJANGO="django>=2.0,<2.1"
21+
2122
install:
22-
- "pip install $DJANGO"
23+
- pip install pip pipenv -U
24+
- pipenv install $DJANGO --skip-lock
25+
- pipenv install --dev --skip-lock
2326
script:
24-
- make travis
27+
- make qa
28+
- make coverage
2529
after_success:
2630
- codecov

Makefile

+48-16
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,58 @@
1-
.PHONY: install upgrade lint coverage travis docs
1+
.PHONY: init install qa lint tests spec coverage docs
22

3-
install:
4-
pip install -r dev-requirements.txt
5-
pip install -e .
63

7-
upgrade:
8-
pip install -r dev-requirements.txt -U
9-
pip install -e . -U
4+
init:
5+
pipenv install --three --dev
106

7+
8+
# DEVELOPMENT
9+
# ~~~~~~~~~~~
10+
# The following rules can be used during development in order to compile generate locales, build
11+
# documentation, etc.
12+
# --------------------------------------------------------------------------------------------------
13+
14+
# Generate the project's .po files.
15+
messages:
16+
cd precise_bbcode && pipenv run python -m django makemessages -a
17+
18+
# Compiles the project's .po files.
19+
compiledmessages:
20+
cd precise_bbcode && pipenv run python -m django compilemessages
21+
22+
# Builds the documentation.
23+
docs:
24+
cd docs && rm -rf _build && pipenv run make html
25+
26+
27+
# QUALITY ASSURANCE
28+
# ~~~~~~~~~~~~~~~~~
29+
# The following rules can be used to check code quality, import sorting, etc.
30+
# --------------------------------------------------------------------------------------------------
31+
32+
qa: lint isort
33+
34+
# Code quality checks (eg. flake8, eslint, etc).
1135
lint:
12-
flake8
36+
pipenv run flake8
1337

38+
# Import sort checks.
1439
isort:
15-
isort --check-only --recursive precise_bbcode tests
40+
pipenv run isort --check-only --recursive --diff precise_bbcode tests
1641

17-
coverage:
18-
py.test --cov-report term-missing --cov precise_bbcode
1942

20-
spec:
21-
py.test --spec
43+
# TESTING
44+
# ~~~~~~~
45+
# The following rules can be used to trigger tests execution and produce coverage reports.
46+
# --------------------------------------------------------------------------------------------------
2247

23-
travis: install lint coverage isort
48+
# Just runs all the tests!
49+
tests:
50+
pipenv run py.test
2451

25-
docs:
26-
cd docs && make html
52+
# Collects code coverage data.
53+
coverage:
54+
pipenv run py.test --cov-report term-missing --cov precise_bbcode
55+
56+
# Run the tests in "spec" mode.
57+
spec:
58+
pipenv run py.test --spec -p no:sugar

Pipfile

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[[source]]
2+
3+
url = "https://pypi.python.org/simple"
4+
verify_ssl = true
5+
name = "pypi"
6+
7+
8+
[dev-packages]
9+
10+
ipython = "*"
11+
pytest = "*"
12+
pytest-cov = "*"
13+
pytest-django = "*"
14+
pytest-pythonpath = "*"
15+
pytest-spec = "*"
16+
codecov = "*"
17+
"flake8" = "*"
18+
isort = "*"
19+
transifex-client = "*"
20+
django-debug-toolbar = "*"
21+
factory-boy = "*"
22+
sphinx = "*"
23+
sphinx-rtd-theme = "*"
24+
25+
26+
[packages]
27+
28+
"e1839a8" = {path = ".", editable = true}

0 commit comments

Comments
 (0)