Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
437757b
Update the ids and trackingURL variables to use lowercase camelcase, …
nate-williams-auctane Jun 28, 2021
970d9df
Revert request id [skip ci]
nate-williams-auctane Jun 28, 2021
6505215
made requestId a base58 string and added a dependency fuuid
KaseyCantu Jun 28, 2021
785b4ea
updated lock file
KaseyCantu Jun 28, 2021
8f81046
updated requirements.txt
KaseyCantu Jun 28, 2021
0973b6f
work in progress - obeserver pattern
KaseyCantu Jun 29, 2021
c4d659d
work in progress - Event/Observer pattern implementation
KaseyCantu Jun 30, 2021
8874d41
import fixes
KaseyCantu Jun 30, 2021
00c9a69
Observer pattern implementation to emit events from the SDK :dart:
KaseyCantu Jun 30, 2021
a283b1b
Handle country code non-US casing ON -> On and postal code formatting…
nate-williams-auctane Jun 30, 2021
5b4ac7c
Update server error message for tests
nate-williams-auctane Jun 30, 2021
8439c48
Handle NoneType track package data fields
nate-williams-auctane Jun 30, 2021
a83214b
Reset to the correct test url
nate-williams-auctane Jul 1, 2021
bcc739f
Add missing microseconds for date strings that do not have it on the …
nate-williams-auctane Jul 1, 2021
43a11ca
Format multiline None checks
nate-williams-auctane Jul 1, 2021
5bc5af0
Update track package result assertions for elixir SimEngine API endpoint
nate-williams-auctane Jul 1, 2021
7089959
Revert to main branch lock/requirements files
nate-williams-auctane Jul 1, 2021
208f2ac
Revert to main branch toml file
nate-williams-auctane Jul 1, 2021
8e0b11d
Sensibly re-add fuuid from Nate's botched depedency flow
nate-williams-auctane Jul 1, 2021
8461e5d
Resolve merge conflicts
nate-williams-auctane Jul 1, 2021
f7c101c
Remove unused output statement
nate-williams-auctane Jul 1, 2021
98ad92c
Add fuuid dependency needed for test to the tox.ini
nate-williams-auctane Jul 1, 2021
8583d37
Added calls to emit_event() in the client to emit Req and Resp events
KaseyCantu Jul 1, 2021
f331654
Optimized response checks for 404, 429, and 500 error cases.
KaseyCantu Jul 2, 2021
8431b82
Appease linters
nate-williams-auctane Jul 2, 2021
0e28ad6
Generate updated requirements file for updated packages
nate-williams-auctane Jul 2, 2021
19bb8ad
Enable tracking URL asertions for track package tests for elixir SimE…
nate-williams-auctane Jul 6, 2021
fa8ca68
Update models to handle null values for string fields, and ensure no …
KaseyCantu Jul 6, 2021
cd62b9f
Merge pull request #19 from ShipEngine/observer-pattern-implementation
KaseyCantu Jul 6, 2021
d9713e9
Added pytest-mock
KaseyCantu Jul 6, 2021
b8fc8f6
work in progress - test Event/Observer pattern
KaseyCantu Jul 6, 2021
3000e05
quick fixes
KaseyCantu Jul 9, 2021
81f9222
Merge pull request #20 from ShipEngine/kc/observer-pattern-event-tests
KaseyCantu Jul 14, 2021
5494f21
:construction: Work in progress.
KaseyCantu Jul 14, 2021
87c3c02
AC per DX-1527 - Test config retries disabled
KaseyCantu Jul 15, 2021
b334308
Work in progress :construction:
KaseyCantu Jul 15, 2021
d62cd4c
AC per DX-1528 and rename of test file
KaseyCantu Jul 16, 2021
e8ef2a0
Update test API_KEY and refactor tests to use it
KaseyCantu Jul 16, 2021
7335157
Added a setup script to improve dev QOL
KaseyCantu Jul 16, 2021
94b6df6
Updated documentation to reflect the use of bin/setup
KaseyCantu Jul 16, 2021
773bf47
Config and emitted event tests
KaseyCantu Jul 19, 2021
cd4c922
Fixed while loop that manages request retries
KaseyCantu Jul 19, 2021
fa2265f
Updated response_headers in respnose event emission
KaseyCantu Jul 19, 2021
e714934
Added pytest-mock to spy on events and their methods
KaseyCantu Jul 19, 2021
956362e
Improved the event message and event workflow
KaseyCantu Jul 19, 2021
8aa3e40
Using a fake ApiKey for use with simengine and removed test rpc url m…
KaseyCantu Jul 19, 2021
1420c12
made is_residential an optional bool with a default instead of a requ…
KaseyCantu Jul 19, 2021
dc0e2cf
Removed unused python versions from coveralls action
KaseyCantu Jul 19, 2021
ad2e5b4
Merge pull request #21 from ShipEngine/kc/observer-pattern-event-tests
KaseyCantu Jul 19, 2021
c05e464
update needs statement to new value
KaseyCantu Jul 19, 2021
5eeb0a6
Improved CI
KaseyCantu Jul 19, 2021
5f0f915
Improved CI
KaseyCantu Jul 19, 2021
233bd57
fixed time eval
KaseyCantu Jul 19, 2021
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
23 changes: 6 additions & 17 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- main

jobs:
linting:
lint_and_pytest:
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down Expand Up @@ -47,12 +47,15 @@ jobs:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics
- name: Pytest
run: |
pytest
- name: Run linting environment and pre-commit hooks
run: |
tox -e lint


tox-coveralls:
coveralls:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -61,26 +64,12 @@ jobs:
with:
python-version: 3.7

- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox pytest pytest-cov coverage responses
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi

- name: Tox testenv
run: |
tox

- name: Pytest
run: |
pytest
Expand All @@ -92,7 +81,7 @@ jobs:
flag-name: Python Test Suite

coveralls_finish:
needs: tox-coveralls
needs: coveralls
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
Expand Down
37 changes: 15 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,37 +76,30 @@ on `osx / linux / bashonwindows`:
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
```

- Once you have **Poetry** installed you need to install the projects dependencies with this command:
- Once you have **Poetry** installed you need to install the projects dependencies with this command from the project root:

```bash
poetry install
bin/setup
```
- This script will install all dependencies specified in `pyproject.toml` via `Poetry` and install the `pre-commit` hooks
this project uses.

- After you have installed **Poetry**, you need to start the python environment managed by Poetry by
running `poetry shell` in your terminal.

## Adding dependencies to the project
If your changes require you to install a python package/module using `poetry add <some package>` or
`poetry add <some package> -D` for a dev dependency. You will also need to run the following command to
regenerate a `requirements.txt` file that includes the newly added dependencies:
```bash
poetry shell
```
poetry export -f requirements.txt --output requirements.txt --without-hashes --dev
```

### Pre-Commit Hooks
## Pre-Commit Hooks
We are using [Pre-Commit](https://pre-commit.com/) to enforce formatting, lint rules, and code analysis so that
this repo is always in good health.
- If you choose not to globally install `pre-commit`, then you can skip installing via `pip` or `homebrew` directly.
You can simply run either `pip install -r requirements.txt` or `poetry install`
To be able to push a PR to the repo after making changes locally, you will need to install `pre-commit` which
is a tool that runs linting, formatting, and code analysis on your changes.
```bash
pip install pre-commit # Install via pip
- `Pre-Commit` is installed and initialized when you run `bin/setup` from the project root as outlined above.

OR

brew install pre-commit # Install via homebrew
```
- After you have run either `pip install -r requirements.txt`, `poetry install`, or globally installed
[Pre-Commit](https://pre-commit.com/) using the above commands you need to run the following command
in the project directory locally. This allows the pre-commit hooks to run when you are looking to commit
and push code to this repository.
- If you choose not to use `Poetry` and prefer `pip` you can simply run `pip install -r requirements.txt`
To be able to commit & push a PR to the repo after making changes locally, you will need to install `pre-commit` which
is a tool that runs tests, linting, formatting, and code analysis on your changes.
```bash
pre-commit install
```
Expand Down
5 changes: 5 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash

poetry install
pre-commit install
poetry shell
Loading