Skip to content
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
45 changes: 45 additions & 0 deletions .github/workflows/CD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
push:
branches:
- main

name: ShipEngine Python CD
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/release-please-action@v2
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: python
package-name: shipengine

# Checkout code if release was created
- uses: actions/checkout@v2
if: ${{ setps.release.outputs.release_created }}

# Setup Python if release was created
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.7
if: ${{ steps.release.outputs.release_created }}

- name: Install dependancies
run: |
python -m pip install --upgrade pip
python -m pip install poetry
if: ${{ steps.release.outputs.release_created }}

- name: Build the code
run: |
poetry build
if: ${{ steps.release.outputs.release_created }}

- name: Publish package
run: |
poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
if: ${{ steps.release.outputs.release_created }}
3 changes: 1 addition & 2 deletions .github/workflows/main.yml → .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: ShipEngine SDK

on:
push:
branches:
Expand All @@ -11,6 +9,7 @@ on:
branches:
- main

name: ShipEngine SDK CI
jobs:
lint_and_pytest:
runs-on: ubuntu-latest
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@ pip install shipengine

Instantiate ShipEngine Class
----------------------------

```python
import os

from shipengine_sdk import ShipEngine
from shipengine import ShipEngine

api_key = os.getenv("SHIPENGINE_API_KEY")

shipengine = ShipEngine(api_key)
```
- You can also pass in a `dictionary` containing configuration options instead of just passing in a string that is your `API Key`.

```python
import os

from shipengine_sdk import ShipEngine
from shipengine import ShipEngine

api_key = os.getenv("SHIPENGINE_API_KEY")

Expand Down
10 changes: 5 additions & 5 deletions docs/address_validation_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Input Parameters
----------------

The `validate_address` method accepts an address object containing the properties listed below.
You can import the [`Address`](../shipengine_sdk/models/address/__init__.py)
You can import the [`Address`](../shipengine/models/address/__init__.py)
type into your project to take advantage of your
IDE's code completion functionality.

Expand Down Expand Up @@ -108,7 +108,7 @@ A *string* between `0` and `1000` characters indicating the company name, if thi
Output
------
The `validate_address` method returns an address validation result object containing the properties listed below.
You can import the [`AddressValidationResult`](../shipengine_sdk/models/address/__init__.py)
You can import the [`AddressValidationResult`](../shipengine/models/address/__init__.py)
type into your project to take advantage of your IDE's code completion functionality.

* `is_valid` <br>
Expand Down Expand Up @@ -179,8 +179,8 @@ Examples:
```python
import os

from shipengine_sdk import ShipEngine
from shipengine_sdk.models import Address
from shipengine import ShipEngine
from shipengine.models import Address

api_key = os.getenv("SHIPENGINE_API_KEY")

Expand Down Expand Up @@ -309,5 +309,5 @@ Exceptions
==========

- This method will only throw an exception that is an instance/extension of
([ShipEngineError](../shipengine_sdk/errors/__init__.py)) if there is a problem if a problem occurs, such as a
([ShipEngineError](../shipengine/errors/__init__.py)) if there is a problem if a problem occurs, such as a
network error or an error response from the API.
6 changes: 3 additions & 3 deletions docs/normalize_address_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ containing method-level configuration options.

- **Behavior**: The `normalize_address` method will either return a normalized version of the address you pass in. This
will throw an exception if address validation fails, or an invalid address is provided. The normalized address will
be returned as an instance of the [Address](../shipengine_sdk/models/address/__init__.py) class.
be returned as an instance of the [Address](../shipengine/models/address/__init__.py) class.

- **Method level configuration** - You can optionally pass in an list that contains `configuration` values to be used
for the current method call. The options are `api_key`, `base_uri`, `page_size`,
Expand Down Expand Up @@ -150,8 +150,8 @@ Examples:
```python
import os

from shipengine_sdk import ShipEngine
from shipengine_sdk.models import Address
from shipengine import ShipEngine
from shipengine.models import Address

api_key = os.getenv("SHIPENGINE_API_KEY")

Expand Down
5 changes: 3 additions & 2 deletions docs/track_package_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,12 @@ An *array of objects* representing the individual tracking events that have occu

Example
=======

```python
import os

from shipengine_sdk import ShipEngine
from shipengine_sdk.models import TrackingQuery
from shipengine import ShipEngine
from shipengine.models import TrackingQuery

api_key = os.getenv("SHIPENGINE_API_KEY")

Expand Down
Loading