Skip to content

Commit e885a4d

Browse files
authored
chore: migrate from setup.py to pyproject.toml (#144)
1 parent f359061 commit e885a4d

File tree

6 files changed

+92
-167
lines changed

6 files changed

+92
-167
lines changed

.github/workflows/on-pull-request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v4
14-
- uses: astral-sh/ruff-action@v1
14+
- uses: astral-sh/ruff-action@v3
1515
with:
1616
args: check
1717
format:
1818
name: Format
1919
runs-on: ubuntu-latest
2020
steps:
2121
- uses: actions/checkout@v4
22-
- uses: astral-sh/ruff-action@v1
22+
- uses: astral-sh/ruff-action@v3
2323
with:
2424
args: format --check
2525
test:

.github/workflows/release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ jobs:
2727
if: ${{ steps.release.outputs.release_created }}
2828
- name: Install dependencies
2929
if: ${{ steps.release.outputs.release_created }}
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install build
30+
run: pip install build
3331
- name: Build
3432
if: ${{ steps.release.outputs.release_created }}
3533
run: python -m build

BUILD.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Instructions for Deploying
1+
# Instructions for Building
22

33
### Install dependencies
44

@@ -7,34 +7,20 @@ Use a virtual environment and install dependencies
77
```
88
> python3 -m venv venv
99
> source venv/bin/activate
10-
> pip install twine build python-dotenv
10+
> pip install build
1111
12-
python3 -m venv venv; source venv/bin/activate; pip install twine build python-dotenv
12+
python3 -m venv venv; source venv/bin/activate; pip install build
1313
```
1414

1515
### Build the project
1616

1717
This will create the `/dist` directory
1818
```
19-
python setup.py sdist bdist_wheel
19+
python -m build
2020
```
2121

2222
### Run tests
2323

2424
```
25-
python setup.py pytest
26-
```
27-
28-
### Publish the package
29-
30-
To publish the package, you need an API key on pypi.org. You can save this API key in a `.pypirc` file
31-
32-
```
33-
[pypi]
34-
username = __token__
35-
password = pypi__abc...
36-
```
37-
38-
```
39-
python3 -m twine upload dist/*
25+
pytest
4026
```

pyproject.toml

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,86 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=42",
4-
"wheel"
5-
]
2+
requires = ["setuptools >= 75.0"]
63
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "passage-identity"
7+
version = "3.0.1"
8+
dependencies = [
9+
"cryptography ~= 44.0", # used by pyjwt
10+
"pydantic ~= 2.10", # used by codgen
11+
"pyjwt ~= 2.9",
12+
"python-dateutil ~= 2.9", # used by codegen
13+
"requests ~= 2.32",
14+
]
15+
requires-python = ">=3.8"
16+
authors = [
17+
{ name = "Passage by 1Password", email = "support@passage.id" },
18+
]
19+
description = "Passkey Complete for Python - Integrate into your Python API or service to enable a completely passwordless standalone auth solution with Passage by 1Password"
20+
readme = "README.md"
21+
classifiers = [
22+
"Development Status :: 5 - Production/Stable",
23+
"Intended Audience :: Developers",
24+
"License :: OSI Approved :: MIT License",
25+
"Operating System :: OS Independent",
26+
"Topic :: Security",
27+
"Programming Language :: Python",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3 :: Only",
30+
"Programming Language :: Python :: 3.8",
31+
"Programming Language :: Python :: 3.9",
32+
"Programming Language :: Python :: 3.10",
33+
"Programming Language :: Python :: 3.11",
34+
"Programming Language :: Python :: 3.12",
35+
"Programming Language :: Python :: 3.13",
36+
]
37+
38+
[project.urls]
39+
Documentation = "https://docs.passage.id/complete"
40+
"Bug Tracker" = "https://github.com/passageidentity/.github/blob/main/SUPPORT.md"
41+
42+
[project.license]
43+
file = "LICENSE"
44+
45+
[project.optional-dependencies]
46+
test = [
47+
"pytest ~= 8.3",
48+
]
49+
lint = [
50+
"ruff ~= 0.8",
51+
]
52+
dev = [
53+
"passage-identity[test,lint]",
54+
]
55+
56+
[tool.ruff]
57+
exclude = [
58+
".eggs",
59+
".git",
60+
".pytest_cache",
61+
".ruff_cache",
62+
".venv",
63+
".vscode",
64+
"__pypackages__",
65+
"dist",
66+
"passageidentity/openapi_client",
67+
]
68+
line-length = 120
69+
indent-width = 4
70+
target-version = "py38"
71+
72+
[tool.ruff.lint]
73+
select = ["ALL"]
74+
ignore = []
75+
fixable = ["ALL"]
76+
unfixable = []
77+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
78+
79+
[tool.ruff.lint.per-file-ignores]
80+
"tests/**.py" = ["D", "S101", "PLR2004"]
81+
82+
[tool.ruff.format]
83+
quote-style = "double"
84+
indent-style = "space"
85+
skip-magic-trailing-comma = false
86+
line-ending = "auto"

ruff.toml

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

setup.py

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

0 commit comments

Comments
 (0)