forked from cds-snc/notification-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from department-of-veterans-affairs/90
Upgrade dependencies. Remove unused Docker-related files. Update the README.
- Loading branch information
Showing
18 changed files
with
123 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fileignoreconfig: | ||
- filename: notifications_utils/sanitise_text.py | ||
checksum: 96cf794e49031d454616ae36522a62082e68e3019ba4533084cebf6a6ce0ec0d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,58 +1,26 @@ | ||
# Notification - notifications-utils [BETA] | ||
Shared python code for Notification | ||
# notifications-utils | ||
|
||
Provides logging utils etc. | ||
Shared Python 3 code for Notification to provide logging utilities, etc. It has not been run against any version of python 2.x | ||
|
||
## Installing | ||
## Installing Dependencies | ||
|
||
This is a [python](https://www.python.org/) application. | ||
Run these commands from the project's root directory to install and activate a virtual environment and to install Python dependencies, including dependencies for running unit tests. | ||
|
||
#### Python version | ||
This is a python 3 application. It has not been run against any version of python 2.x | ||
1. `python3 -m venv venv/` | ||
2. `./scripts/bootstrap.sh` | ||
|
||
brew install python3 | ||
If you encounter an error about Wheel failing to build, ensure you have the Python3 development libraries installed on your machine. On Linux, this is the package `libpython3-dev`. | ||
|
||
#### Dependency management | ||
## Unit Tests | ||
|
||
This is done through [pip](https://pip.readthedocs.io) and [virtualenv](https://virtualenv.readthedocs.org/en/latest/). In practise we have used | ||
[VirtualEnvWrapper](http://virtualenvwrapper.readthedocs.org/en/latest/command_ref.html) for our virtual environments. | ||
|
||
Setting up a virtualenvwrapper for python3 | ||
|
||
mkvirtualenv -p /usr/local/bin/python3 notifications-utils | ||
|
||
|
||
The boostrap script will set the application up. *Ensure you have activated the virtual environment first.* | ||
|
||
./scripts/bootstrap.sh | ||
|
||
This will | ||
|
||
* Use pip to install dependencies. | ||
|
||
#### Tests | ||
|
||
The `./scripts/run_tests.sh` script will run all the tests. [py.test](http://pytest.org/latest/) is used for testing. | ||
|
||
Running tests will also apply syntax checking, using [pycodestyle](https://pypi.python.org/pypi/pycodestyle). | ||
|
||
Additionally code coverage is checked via pytest-cov: | ||
The `./scripts/run_tests.sh` script runs all unit tests using [py.test](http://pytest.org/latest/) and applies syntax checking using [pycodestyle](https://pypi.python.org/pypi/pycodestyle). | ||
|
||
## Versioning | ||
|
||
After making changes in this repo, complete the following steps to see those changes in `notification-api`. | ||
Note: to test locally before pushing, do steps #1 and #4 below and then follow instructions in the `notification-api` README. | ||
|
||
1. Increment the version in `notifications_utils/version.py`. | ||
|
||
2. Push this change. | ||
|
||
3. Manually run `./scripts/push-tag.sh`, which will look at `version.py` and push a tag with that version. | ||
|
||
4. In `notification-api`, update `requirements.txt` and `requirements-app.txt` to point at the newly generated tag. | ||
With the virtual environment active, run `python setup.py --version` to see the current version **on the current branch**. Use `git tag` to add release tags to commits, and push the tags. | ||
|
||
5. Push this change. | ||
You can reference these release tags in requirements files in other repositories. See [notification-api](https://github.com/department-of-veterans-affairs/notification-api/blob/master/requirements-app.txt) for an example. | ||
|
||
## Documentation | ||
## E-mail Template Documentation | ||
|
||
Documentation for the template used to render emails is in the [docs](./docs/README.md) folder. | ||
Documentation for the template used to render e-mails is in the [docs](./docs/README.md) folder. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,10 @@ | ||
-r requirements.txt | ||
|
||
flake8==3.7.8 | ||
flake8-print==3.1.4 | ||
freezegun==1.0.0 | ||
phonenumbers==8.12.12 | ||
pytest==5.1.2 | ||
pytest-cov==2.10.1 | ||
pytest-mock==1.10.4 | ||
pytest-xdist==1.29.0 | ||
requests-mock==1.8.0 | ||
flake8~=5.0.4 | ||
flake8-print~=5.0.0 | ||
freezegun~=1.2.2 | ||
pytest~=7.1.2 | ||
pytest-cov~=3.0.0 | ||
pytest-mock~=3.8.2 | ||
pytest-xdist~=2.5.0 | ||
requests-mock~=1.9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.