Skip to content

Commit ae8969b

Browse files
authored
Merge pull request #142 from bckohan/v2.2.x
V2.2.x
2 parents dc7e5df + 579d09b commit ae8969b

File tree

9 files changed

+502
-549
lines changed

9 files changed

+502
-549
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
poetry check
5050
poetry run pip check
5151
poetry export --without-hashes --format=requirements.txt | poetry run safety check --stdin
52-
poetry run python -m readme_renderer ./README.rst -o /tmp/README.html
52+
poetry run python -m readme_renderer ./README.md -o /tmp/README.html
5353
cd ./doc
5454
poetry run doc8 --ignore-path build --max-line-length 100
5555

CONTRIBUTING.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Contributing
2+
3+
Contributions are encouraged and welcome!! Please use the issue page to submit feature requests or
4+
bug reports. Issues with attached PRs will be given priority and have a much higher likelihood of
5+
acceptance. Please also open an issue and associate it with any submitted PRs.
6+
7+
We are actively seeking additional maintainers. If you're interested, please
8+
[contact me](https://github.com/bckohan).
9+
10+
11+
## Installation
12+
13+
`django-render-static` uses [Poetry](https://python-poetry.org/) for environment, package and
14+
dependency management. [Poetry](https://python-poetry.org/) greatly simplifies environment
15+
bootstrapping. Once it's installed.
16+
17+
```shell
18+
poetry install -E all
19+
```
20+
21+
### External Dependencies
22+
23+
Some of the tests require [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm)
24+
to be installed.
25+
26+
## Documentation
27+
28+
`django-render-static` documentation is generated using
29+
[Sphinx](https://www.sphinx-doc.org/en/master/) with the [readthedocs](https://readthedocs.org/)
30+
theme. Any new feature PRs must provide updated documentation for the features added. To build
31+
the docs run:
32+
33+
```shell
34+
cd ./doc
35+
poetry run doc8 --ignore-path build --max-line-length 100
36+
poetry run make html
37+
```
38+
39+
## Static Analysis
40+
41+
`django-render-static` uses [Pylint](https://www.pylint.org/) for Python linting and
42+
[mypy](http://mypy-lang.org/) for type checking. Header imports are also standardized using
43+
[isort](https://pycqa.github.io/isort/). Before any PR is accepted the following must be run, and
44+
static analysis tools should not produce any errors or warnings. Disabling certain errors or
45+
warnings where justified is acceptable:
46+
47+
```shell
48+
poetry run isort render_static
49+
poetry run black render_static
50+
poetry run mypy render_static
51+
poetry run pylint render_static
52+
poetry check
53+
poetry run pip check
54+
poetry run python -m readme_renderer ./README.md
55+
```
56+
57+
## Running Tests
58+
59+
`django-render-static` is setup to use
60+
[django-pytest](https://pytest-django.readthedocs.io/en/latest/) to allow
61+
[pytest](https://docs.pytest.org/en/stable/) to run Django unit tests. All the tests are housed in
62+
render_static/tests/tests.py. Before a PR is accepted, all tests must be passing and the code
63+
coverage must be at 100%.
64+
65+
To run the full suite:
66+
67+
```shell
68+
poetry run pytest
69+
```
70+
71+
To run a single test, or group of tests in a class:
72+
73+
```shell
74+
poetry run pytest <path_to_tests_file>::ClassName::FunctionName
75+
```
76+
77+
For instance to run all tests in DefinesToJavascriptTest, and then just the test_classes_to_js test
78+
you would do:
79+
80+
```shell
81+
poetry run pytest render_static/tests/tests.py::DefinesToJavascriptTest
82+
poetry run pytest render_static/tests/tests.py::DefinesToJavascriptTest::test_classes_to_js
83+
```

CONTRIBUTING.rst

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

0 commit comments

Comments
 (0)