Skip to content

Commit

Permalink
Upgrade dependencies to match quality checklist
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Villavicencio committed Mar 19, 2020
1 parent 2481981 commit c627dfc
Show file tree
Hide file tree
Showing 16 changed files with 154 additions and 65 deletions.
3 changes: 2 additions & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Coverage configuration file

[run]
source = .
source =
airtng_flask

omit =
*/migrations/*
Expand Down
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TWILIO_ACCOUNT_SID=Your-Account-SID
TWILIO_AUTH_TOKEN=Your-Twilio-Auth-Token
TWILIO_NUMBER=Your-Twilio-Phone-Number
SQLALCHEMY_DATABASE_URI="sqlite://"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ __pycache__/
*.so

# Distribution / packaging
venv
.Python
env/
ivr-env/
Expand Down Expand Up @@ -63,3 +64,5 @@ target/

.idea
dev.sqlite

.vscode
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: python
python:
- '2.7'
- '3.4'
- '3.6'
install:
- pip install -r requirements.txt
- pip install coveralls
Expand Down
73 changes: 73 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at open-source@twilio.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
3 changes: 3 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contributing to Twilio

All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.
37 changes: 18 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
Copyright (c) 2012 Twilio, Inc.
MIT License

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
Copyright (c) 2020 Twilio Labs

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Learn how to automate your workflow using Twilio's REST API and Twilio SMS. This

Remember that the number where you change the _SMS webhook_ must be the same one you set on the `TwilioPhoneNumber` setting.

![Configure Messaging](webhook.png)

To start using `ngrok` in our project you'll have execute to the following line in the _command prompt_.

```
Expand Down Expand Up @@ -56,15 +58,15 @@ Learn how to automate your workflow using Twilio's REST API and Twilio SMS. This
pip install -r requirements.txt
```

1. Edit the following keys/values for the `config.py` file inside the `airtng_flask/` directory. Be sure to replace the place holders and connection string with real information. Replace the connection string preferably under development config.
1. Copy the sample configuration `.env.example` to `.env`, and then edit `.env` to match your configuration.

```
TWILIO_ACCOUNT_SID = 'your_twilio_account_sid'
TWILIO_AUTH_TOKEN = 'your_twilio_auth_token'
TWILIO_NUMBER = 'your_twilio_phone_number'
```bash
cp .env.example .env
```

SQLALCHEMY_DATABASE_URI = 'sqlite://'
```
You can find your `TWILIO_ACCOUNT_SID` and `TWILIO_AUTH_TOKEN` in your
[Twilio Account Settings](https://www.twilio.com/console).
You will also need a `TWILIO_PHONE_NUMBER`, which you may find [here](https://www.twilio.com/console/phone-numbers/incoming).

1. Run the migrations.

Expand Down Expand Up @@ -98,5 +100,6 @@ You can then view the results with `coverage report` or build an HTML report wit
## Meta
* No warranty expressed or implied. Software is as is. Diggity.
* The CodeExchange repository can be found [here](https://github.com/twilio-labs/code-exchange/).
* [MIT License](http://www.opensource.org/licenses/mit-license.html)
* Lovingly crafted by Twilio Developer Education.
5 changes: 3 additions & 2 deletions airtng_flask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from airtng_flask.config import config_env_files
from flask import Flask

from flask.ext.bcrypt import Bcrypt
from flask.ext.sqlalchemy import SQLAlchemy
from flask_bcrypt import Bcrypt
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager

db = SQLAlchemy()
Expand All @@ -14,6 +14,7 @@
def create_app(config_name='development', p_db=db, p_bcrypt=bcrypt, p_login_manager=login_manager):
new_app = Flask(__name__)
config_app(config_name, new_app)
new_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

p_db.init_app(new_app)
p_bcrypt.init_app(new_app)
Expand Down
10 changes: 6 additions & 4 deletions airtng_flask/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

basedir = os.path.abspath(os.path.dirname(__file__))

from dotenv import load_dotenv
load_dotenv()

class DefaultConfig(object):
SECRET_KEY = 'secret-key'
DEBUG = False
SQLALCHEMY_DATABASE_URI = 'sqlite://'
TWILIO_ACCOUNT_SID = 'your_twilio_account_sid'
TWILIO_AUTH_TOKEN = 'your_twilio_auth_token'
TWILIO_NUMBER = 'your_twilio_number'
SQLALCHEMY_DATABASE_URI = os.getenv('SQLALCHEMY_DATABASE_URI')
TWILIO_ACCOUNT_SID = os.getenv('TWILIO_ACCOUNT_SID')
TWILIO_AUTH_TOKEN = os.getenv('TWILIO_AUTH_TOKEN')
TWILIO_NUMBER = os.getenv('TWILIO_NUMBER')


class DevelopmentConfig(DefaultConfig):
Expand Down
2 changes: 1 addition & 1 deletion airtng_flask/forms.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask_wtf import Form
from flask_wtf import FlaskForm as Form
from wtforms import TextField, PasswordField, IntegerField, HiddenField
from wtforms.validators import DataRequired, Length, Email, URL

Expand Down
2 changes: 1 addition & 1 deletion airtng_flask/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from airtng_flask import db, bcrypt, app, login_manager
from flask import session, g, request, flash, Blueprint
from flask.ext.login import login_user, logout_user, current_user, login_required
from flask_login import login_user, logout_user, current_user, login_required
from twilio.twiml.voice_response import VoiceResponse

from airtng_flask.forms import RegisterForm, LoginForm, VacationPropertyForm, ReservationForm, \
Expand Down
4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from flask.ext.script import Manager
from flask.ext.migrate import Migrate, MigrateCommand
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand

from airtng_flask import app, db

Expand Down
51 changes: 26 additions & 25 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
alembic==0.8.4
bcrypt==2.0.0
alembic==1.4.1
bcrypt==3.1.7
blinker==1.4
cffi==1.4.2
coverage==4.0.3
Flask==0.10.1
cffi==1.14.0
coverage==5.0.4
Flask==1.1.1
Flask-Bcrypt==0.7.1
Flask-Login==0.3.2
Flask-Migrate==1.7.0
Flask-Script==2.0.5
Flask-SQLAlchemy==2.1
Flask-Testing==0.4.2
Flask-WTF==0.12
httplib2==0.9.2
itsdangerous==0.24
Jinja2==2.8
Flask-Login==0.5.0
Flask-Migrate==2.5.3
Flask-Script==2.0.6
Flask-SQLAlchemy==2.4.1
Flask-Testing==0.8.0
Flask-WTF==0.14.3
httplib2==0.17.0
itsdangerous==1.1.0
Jinja2==2.11.1
linecache2==1.0.0
Mako==1.0.3
MarkupSafe==0.23
pycparser==2.14
python-editor==0.5
pytz==2015.7
six==1.10.0
SQLAlchemy==1.0.11
Mako==1.1.2
MarkupSafe==1.1.1
pycparser==2.20
python-dotenv==0.12.0
python-editor==1.0.4
pytz==2019.3
six==1.14.0
SQLAlchemy==1.3.15
traceback2==1.4.0
twilio==6.9.0
twilio==6.37.0
unittest2==1.1.0
Werkzeug==0.11.3
wheel==0.24.0
WTForms==2.1
Werkzeug==1.0.0
wheel==0.34.0
WTForms==2.2.1
2 changes: 1 addition & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from flask.ext.testing import TestCase
from flask_testing import TestCase

from airtng_flask import app, config_app

Expand Down
Binary file added webhook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c627dfc

Please sign in to comment.