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
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,3 @@ Icon
test
venv
virtualenv
/.flake8
/pyproject.toml
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ help:

## black - Runs the Black Python formatter against the project
black:
$(VIRTUAL_BIN)/black $(PROJECT_NAME)/ $(TEST_DIR)/ --config examples/style_guides/python/pyproject.toml
$(VIRTUAL_BIN)/black $(PROJECT_NAME)/ $(TEST_DIR)/

## black-check - Checks if the project is formatted correctly against the Black rules
black-check:
$(VIRTUAL_BIN)/black $(PROJECT_NAME)/ $(TEST_DIR)/ --config examples/style_guides/python/pyproject.toml --check
$(VIRTUAL_BIN)/black $(PROJECT_NAME)/ $(TEST_DIR)/ --check

## build - Builds the project in preparation for release
build:
Expand All @@ -35,7 +35,7 @@ docs:

## flake8 - Lint the project with flake8
flake8:
$(VIRTUAL_BIN)/flake8 $(PROJECT_NAME)/ $(TEST_DIR)/ --append-config examples/style_guides/python/.flake8
$(VIRTUAL_BIN)/flake8 $(PROJECT_NAME)/ $(TEST_DIR)/

## init-examples-submodule - Initialize the examples submodule
init-examples-submodule:
Expand All @@ -54,11 +54,11 @@ update-examples-submodule:

## isort - Sorts imports throughout the project
isort:
$(VIRTUAL_BIN)/isort $(PROJECT_NAME)/ $(TEST_DIR)/ --settings-file examples/style_guides/python/pyproject.toml
$(VIRTUAL_BIN)/isort $(PROJECT_NAME)/ $(TEST_DIR)/

## isort-check - Checks that imports throughout the project are sorted correctly
isort-check:
$(VIRTUAL_BIN)/isort $(PROJECT_NAME)/ $(TEST_DIR)/ --settings-file examples/style_guides/python/pyproject.toml --check-only
$(VIRTUAL_BIN)/isort $(PROJECT_NAME)/ $(TEST_DIR)/ --check-only

## lint - Run linters on the project
lint: black-check isort-check flake8 mypy scan
Expand All @@ -68,7 +68,7 @@ lint-fix: black isort

## mypy - Run mypy type checking on the project
mypy:
$(VIRTUAL_BIN)/mypy $(PROJECT_NAME)/ $(TEST_DIR)/ --config-file examples/style_guides/python/pyproject.toml --install-types --non-interactive
$(VIRTUAL_BIN)/mypy $(PROJECT_NAME)/ $(TEST_DIR)/ --install-types --non-interactive

## release - Cuts a release for the project on GitHub (requires GitHub CLI)
# tag = The associated tag title of the release
Expand Down
1 change: 1 addition & 0 deletions easypost/requestor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from urllib.parse import urlencode

import requests

from easypost.constant import (
API_VERSION,
COMMUNICATION_ERROR,
Expand Down
1 change: 1 addition & 0 deletions easypost/services/referral_customer_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
)

import requests

from easypost.constant import (
_FILTERS_KEY,
SEND_STRIPE_DETAILS_ERROR,
Expand Down
71 changes: 71 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "easypost"
description = "EasyPost Shipping API Client Library for Python"
version = "10.3.0"
readme = "README.md"
requires-python = ">=3.9"
license = { file = "LICENSE" }
authors = [{ name = "EasyPost", email = "[email protected]" }]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Programming Language :: Python",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries",
]
dependencies = ["requests >= 2.4.3"]
optional-dependencies = { dev = [
"bandit == 1.8.*",
"black == 25.*",
"build == 1.2.*",
"flake8 == 6.*",
"Flake8-pyproject == 1.2.*",
"isort == 6.*",
"mypy == 1.15.*",
"pdoc == 15.*",
"pytest-cov == 6.*",
"pytest-vcr == 1.*",
"pytest == 8.*",
"vcrpy == 7.*",
] }

[project.urls]
Docs = "https://docs.easypost.com"
Tracker = "https://github.com/EasyPost/easypost-python/issues"
Source = "https://github.com/EasyPost/easypost-python"

[tool.setuptools.packages.find]
exclude = ["docs", "examples", "tests"]

[tool.setuptools.package-data]
easypost = ["py.typed"]

[tool.black]
line-length = 120

[tool.isort]
profile = "black"
line_length = 120
indent = 4
force_grid_wrap = 2
multi_line_output = 3
sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
lines_after_imports = 2
include_trailing_comma = true
use_parentheses = true

[tool.flake8]
max-line-length = 120
extend-ignore = ["E203", "F821"]
per-file-ignores = "__init__.py:F401"
72 changes: 0 additions & 72 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
)

import pytest

from easypost.easypost_client import EasyPostClient


Expand Down
1 change: 1 addition & 0 deletions tests/test_address.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_api_key.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.models import ApiKey


Expand Down
1 change: 1 addition & 0 deletions tests/test_base_service.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from unittest.mock import patch

import pytest

from easypost.constant import NO_MORE_PAGES_ERROR
from easypost.errors import EndOfPaginationError

Expand Down
1 change: 1 addition & 0 deletions tests/test_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import time

import pytest

from easypost.models import Batch


Expand Down
1 change: 1 addition & 0 deletions tests/test_beta_rate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.util import get_lowest_stateless_rate


Expand Down
1 change: 1 addition & 0 deletions tests/test_beta_referral_customer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.errors.api.api_error import ApiError


Expand Down
3 changes: 2 additions & 1 deletion tests/test_billing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from unittest.mock import patch

import easypost
import pytest

import easypost
from easypost.errors import InvalidObjectError


Expand Down
1 change: 1 addition & 0 deletions tests/test_carrier_account.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.errors.api.api_error import ApiError
from easypost.models import CarrierAccount

Expand Down
1 change: 1 addition & 0 deletions tests/test_claim.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_customs_info.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.models import CustomsInfo


Expand Down
1 change: 1 addition & 0 deletions tests/test_customs_item.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.models import CustomsItem


Expand Down
1 change: 1 addition & 0 deletions tests/test_easypost_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import pytest
import requests

from easypost.easypost_client import EasyPostClient
from easypost.errors import TimeoutError

Expand Down
1 change: 1 addition & 0 deletions tests/test_end_shipper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.models import EndShipper


Expand Down
1 change: 1 addition & 0 deletions tests/test_error.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.errors.api.api_error import ApiError


Expand Down
1 change: 1 addition & 0 deletions tests/test_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import time

import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_insurance.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_order.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.errors import FilteringError
from easypost.models import (
Order,
Expand Down
1 change: 1 addition & 0 deletions tests/test_parcel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.models import Parcel


Expand Down
1 change: 1 addition & 0 deletions tests/test_pickup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_rate.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.models import Rate


Expand Down
1 change: 1 addition & 0 deletions tests/test_referral_customer.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from unittest.mock import patch

import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_refund.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_report.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_scan_form.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_shipment.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_tracker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_FILTERS_KEY,
_TEST_FAILED_INTENTIONALLY_ERROR,
Expand Down
1 change: 1 addition & 0 deletions tests/test_user.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pytest

from easypost.constant import (
_TEST_FAILED_INTENTIONALLY_ERROR,
NO_MORE_PAGES_ERROR,
Expand Down
Loading