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

docs: improve, help contributions #1438

Merged
merged 2 commits into from
Jul 16, 2020
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
20 changes: 13 additions & 7 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@

Thank you for contributing to Flask-Appbuilder.
<!--- Thank you for contributing to Flask-Appbuilder. -->
<!--- This repo uses a PR lint bot (https://github.com/apps/prlint), make sure to prefix your PR title with one of: -->
<!--- build|chore|ci|docs|feat|fix|perf|refactor|style|test|other -->

For Fixes:
### Description

Please, prefix the title with "Fix, " and describe in detail what you're fixing and the steps required to reproduce the problem.

For new features:

Please, prefix the title with "New, " and describe this new feature in detail, remember to update documentation.
<!--- Describe the change below, including rationale and design decisions -->

### ADDITIONAL INFORMATION
<!--- Check any relevant boxes with "x" -->
<!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
- [ ] Has associated issue:
- [ ] Changes UI
- [ ] Requires DB Migration.
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
8 changes: 8 additions & 0 deletions .github/prlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"title": [
{
"pattern": "^(build|chore|ci|docs|feat|fix|perf|refactor|style|test|other)((.+))?:\\s.+",
"message": "Your title needs to be prefixed with a topic."
}
]
}
32 changes: 32 additions & 0 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Contributing

Contributions are very welcome and highly appreciated!

## Setup you dev environment

1 - First create a python development virtualenv

``` bash
$ python -m venv venv
$ source venv/bin/activate
$ pip install -r requirements.txt -r requirements-dev.txt
```

2 - Install `docker` and `docker-compose`

## Run tests

Contributions for new features or fixes should have tests associated. To verify that all tests are green you
can run a subset of tests targeting only Postgres.

1 - Start Postgres

``` bash
$ docker-compose up -d
```

2 - Run Postgres tests

``` bash
$ tox -e postgres
```
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3.7"
services:
postgres:
container_name: fab-postgres
image: postgres:10
restart: unless-stopped
env_file: .env
command: postgres -c 'max_connections=500'
environment:
POSTGRES_DB: app
POSTGRES_PASSWORD: pguserpassword
POSTGRES_USER: pguser
ports:
- 5432:5432
7 changes: 0 additions & 7 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,7 @@ flake8==3.6.0
nose==1.3.7
pip-tools==3.5.0
tox==3.5.3
mongoengine>=0.7.10, <0.7.99
flask-mongoengine==0.7.1
pymongo>=2.8.1, <2.8.99
Pillow>=7.0.0, <8.0.0
mockldap>=0.3.0
psycopg2-binary==2.7.5
mysqlclient>=1.4.2, < 2.0.0
cython==0.29.17
pymssql==2.1.4
black==19.3b0
jmespath==0.9.5
7 changes: 7 additions & 0 deletions requirements-extra.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
mongoengine>=0.7.10, <0.7.99
flask-mongoengine==0.7.1
pymongo>=2.8.1, <2.8.99
Pillow>=7.0.0, <8.0.0
mysqlclient>=1.4.2, < 2.0.0
cython==0.29.17
pymssql==2.1.4
13 changes: 12 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ deps =
-rrequirements.txt
-rrequirements-dev.txt


[testenv:api-sqlite]
setenv =
SQLALCHEMY_DATABASE_URI = sqlite:///
Expand All @@ -21,6 +20,10 @@ commands =
[testenv:mysql]
setenv =
SQLALCHEMY_DATABASE_URI = mysql://mysqluser:[email protected]/app?charset=utf8
deps =
-rrequirements.txt
-rrequirements-dev.txt
-rrequirements-extra.txt
commands =
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder flask_appbuilder.tests --ignore-files="test_mongoengine\.py"

Expand All @@ -33,10 +36,18 @@ commands =
[testenv:mssql]
setenv =
SQLALCHEMY_DATABASE_URI = mssql+pymssql://sa:Password_123@localhost:1433/master
deps =
-rrequirements.txt
-rrequirements-dev.txt
-rrequirements-extra.txt
commands =
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder flask_appbuilder.tests --ignore-files="test_mongoengine\.py"

[testenv:mongodb]
deps =
-rrequirements.txt
-rrequirements-dev.txt
-rrequirements-extra.txt
commands =
nosetests --stop -v --with-coverage --cover-package=flask_appbuilder flask_appbuilder/tests/test_mongoengine.py

Expand Down