Skip to content

Commit 763ec75

Browse files
authored
Merge pull request #377 from EasyPost/EXP-756_pyproject
chore: convert setup.py to pyproject.toml
2 parents f59f6cc + 0183b90 commit 763ec75

35 files changed

+109
-81
lines changed

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,3 @@ Icon
2525
test
2626
venv
2727
virtualenv
28-
/.flake8
29-
/pyproject.toml

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ help:
1010

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

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

1919
## build - Builds the project in preparation for release
2020
build:
@@ -35,7 +35,7 @@ docs:
3535

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

4040
## init-examples-submodule - Initialize the examples submodule
4141
init-examples-submodule:
@@ -54,11 +54,11 @@ update-examples-submodule:
5454

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

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

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

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

7373
## release - Cuts a release for the project on GitHub (requires GitHub CLI)
7474
# tag = The associated tag title of the release

easypost/requestor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from urllib.parse import urlencode
1515

1616
import requests
17+
1718
from easypost.constant import (
1819
API_VERSION,
1920
COMMUNICATION_ERROR,

easypost/services/referral_customer_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
)
66

77
import requests
8+
89
from easypost.constant import (
910
_FILTERS_KEY,
1011
SEND_STRIPE_DETAILS_ERROR,

pyproject.toml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "easypost"
7+
description = "EasyPost Shipping API Client Library for Python"
8+
version = "10.3.0"
9+
readme = "README.md"
10+
requires-python = ">=3.9"
11+
license = { file = "LICENSE" }
12+
authors = [{ name = "EasyPost", email = "[email protected]" }]
13+
classifiers = [
14+
"Development Status :: 5 - Production/Stable",
15+
"Environment :: Web Environment",
16+
"Programming Language :: Python",
17+
"Programming Language :: Python :: 3.9",
18+
"Programming Language :: Python :: 3.10",
19+
"Programming Language :: Python :: 3.11",
20+
"Programming Language :: Python :: 3.12",
21+
"Programming Language :: Python :: 3.13",
22+
"Intended Audience :: Developers",
23+
"Operating System :: OS Independent",
24+
"License :: OSI Approved :: MIT License",
25+
"Topic :: Software Development :: Libraries",
26+
]
27+
dependencies = ["requests >= 2.4.3"]
28+
optional-dependencies = { dev = [
29+
"bandit == 1.8.*",
30+
"black == 25.*",
31+
"build == 1.2.*",
32+
"flake8 == 6.*",
33+
"Flake8-pyproject == 1.2.*",
34+
"isort == 6.*",
35+
"mypy == 1.15.*",
36+
"pdoc == 15.*",
37+
"pytest-cov == 6.*",
38+
"pytest-vcr == 1.*",
39+
"pytest == 8.*",
40+
"vcrpy == 7.*",
41+
] }
42+
43+
[project.urls]
44+
Docs = "https://docs.easypost.com"
45+
Tracker = "https://github.com/EasyPost/easypost-python/issues"
46+
Source = "https://github.com/EasyPost/easypost-python"
47+
48+
[tool.setuptools.packages.find]
49+
exclude = ["docs", "examples", "tests"]
50+
51+
[tool.setuptools.package-data]
52+
easypost = ["py.typed"]
53+
54+
[tool.black]
55+
line-length = 120
56+
57+
[tool.isort]
58+
profile = "black"
59+
line_length = 120
60+
indent = 4
61+
force_grid_wrap = 2
62+
multi_line_output = 3
63+
sections = "FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER"
64+
lines_after_imports = 2
65+
include_trailing_comma = true
66+
use_parentheses = true
67+
68+
[tool.flake8]
69+
max-line-length = 120
70+
extend-ignore = ["E203", "F821"]
71+
per-file-ignores = "__init__.py:F401"

setup.py

Lines changed: 0 additions & 72 deletions
This file was deleted.

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
)
99

1010
import pytest
11+
1112
from easypost.easypost_client import EasyPostClient
1213

1314

tests/test_address.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from easypost.constant import (
34
_FILTERS_KEY,
45
_TEST_FAILED_INTENTIONALLY_ERROR,

tests/test_api_key.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pytest
2+
23
from easypost.models import ApiKey
34

45

tests/test_base_service.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from unittest.mock import patch
22

33
import pytest
4+
45
from easypost.constant import NO_MORE_PAGES_ERROR
56
from easypost.errors import EndOfPaginationError
67

0 commit comments

Comments
 (0)