diff --git a/.github/workflows/on-pull-request.yml b/.github/workflows/on-pull-request.yml index 9febae5..6e6a9c8 100644 --- a/.github/workflows/on-pull-request.yml +++ b/.github/workflows/on-pull-request.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: astral-sh/ruff-action@v1 + - uses: astral-sh/ruff-action@v3 with: args: check format: @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: astral-sh/ruff-action@v1 + - uses: astral-sh/ruff-action@v3 with: args: format --check test: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cdc9266..3477797 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,9 +27,7 @@ jobs: if: ${{ steps.release.outputs.release_created }} - name: Install dependencies if: ${{ steps.release.outputs.release_created }} - run: | - python -m pip install --upgrade pip - pip install build + run: pip install build - name: Build if: ${{ steps.release.outputs.release_created }} run: python -m build diff --git a/BUILD.md b/BUILD.md index d1154cf..1fe1938 100644 --- a/BUILD.md +++ b/BUILD.md @@ -1,4 +1,4 @@ -# Instructions for Deploying +# Instructions for Building ### Install dependencies @@ -7,34 +7,20 @@ Use a virtual environment and install dependencies ``` > python3 -m venv venv > source venv/bin/activate -> pip install twine build python-dotenv +> pip install build -python3 -m venv venv; source venv/bin/activate; pip install twine build python-dotenv +python3 -m venv venv; source venv/bin/activate; pip install build ``` ### Build the project This will create the `/dist` directory ``` -python setup.py sdist bdist_wheel +python -m build ``` ### Run tests ``` -python setup.py pytest -``` - -### Publish the package - -To publish the package, you need an API key on pypi.org. You can save this API key in a `.pypirc` file - -``` -[pypi] - username = __token__ - password = pypi__abc... -``` - -``` -python3 -m twine upload dist/* +pytest ``` diff --git a/pyproject.toml b/pyproject.toml index 374b58c..1b3b8a5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,86 @@ [build-system] -requires = [ - "setuptools>=42", - "wheel" -] +requires = ["setuptools >= 75.0"] build-backend = "setuptools.build_meta" + +[project] +name = "passage-identity" +version = "3.0.1" +dependencies = [ + "cryptography ~= 44.0", # used by pyjwt + "pydantic ~= 2.10", # used by codgen + "pyjwt ~= 2.9", + "python-dateutil ~= 2.9", # used by codegen + "requests ~= 2.32", +] +requires-python = ">=3.8" +authors = [ + { name = "Passage by 1Password", email = "support@passage.id" }, +] +description = "Passkey Complete for Python - Integrate into your Python API or service to enable a completely passwordless standalone auth solution with Passage by 1Password" +readme = "README.md" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Topic :: Security", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.8", + "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", +] + +[project.urls] +Documentation = "https://docs.passage.id/complete" +"Bug Tracker" = "https://github.com/passageidentity/.github/blob/main/SUPPORT.md" + +[project.license] +file = "LICENSE" + +[project.optional-dependencies] +test = [ + "pytest ~= 8.3", +] +lint = [ + "ruff ~= 0.8", +] +dev = [ + "passage-identity[test,lint]", +] + +[tool.ruff] +exclude = [ + ".eggs", + ".git", + ".pytest_cache", + ".ruff_cache", + ".venv", + ".vscode", + "__pypackages__", + "dist", + "passageidentity/openapi_client", +] +line-length = 120 +indent-width = 4 +target-version = "py38" + +[tool.ruff.lint] +select = ["ALL"] +ignore = [] +fixable = ["ALL"] +unfixable = [] +dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" + +[tool.ruff.lint.per-file-ignores] +"tests/**.py" = ["D", "S101", "PLR2004"] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +skip-magic-trailing-comma = false +line-ending = "auto" diff --git a/ruff.toml b/ruff.toml deleted file mode 100644 index 561412e..0000000 --- a/ruff.toml +++ /dev/null @@ -1,68 +0,0 @@ -# Exclude a variety of commonly ignored directories. -exclude = [ - ".bzr", - ".direnv", - ".eggs", - ".git", - ".git-rewrite", - ".hg", - ".ipynb_checkpoints", - ".mypy_cache", - ".nox", - ".pants.d", - ".pyenv", - ".pytest_cache", - ".pytype", - ".ruff_cache", - ".svn", - ".tox", - ".venv", - ".vscode", - "__pypackages__", - "_build", - "buck-out", - "build", - "dist", - "node_modules", - "site-packages", - "venv", - "passageidentity/openapi_client", - "passageidentity/models/update_magic_link_auth_method.py", - "passageidentity/models/update_otp_auth_method.py", - "passageidentity/models/update_passkey_auth_method.py", -] - -# Same as Black. -line-length = 120 -indent-width = 4 - -# Assume Python 3.8 -target-version = "py38" - -[lint] -# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. -select = ["ALL"] -ignore = [] - -# Allow fix for all enabled rules (when `--fix`) is provided. -fixable = ["ALL"] -unfixable = [] - -# Allow unused variables when underscore-prefixed. -dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" - -[lint.per-file-ignores] -"tests/**.py" = ["D", "S101", "PLR2004"] - -[format] -# Like Black, use double quotes for strings. -quote-style = "double" - -# Like Black, indent with spaces, rather than tabs. -indent-style = "space" - -# Like Black, respect magic trailing commas. -skip-magic-trailing-comma = false - -# Like Black, automatically detect the appropriate line ending. -line-ending = "auto" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index ed17713..0000000 --- a/setup.py +++ /dev/null @@ -1,71 +0,0 @@ -"""Setup configuration for the Passage Identity Python package.""" - -from pathlib import Path - -import setuptools - -with Path("README.md").open(encoding="utf-8") as fh: - long_description = fh.read() - -setuptools.setup( - name="passage-identity", - version="3.0.1", - author="Passage by 1Password", - author_email="support@passage.id", - description=( - "Passkey Complete for Python - Integrate into your Python API or service to enable " - "a completely passwordless standalone auth solution with Passage by 1Password" - ), - long_description=long_description, - long_description_content_type="text/markdown", - url="https://docs.passage.id/complete", - project_urls={ - "Bug Tracker": "https://github.com/passageidentity/.github/blob/main/SUPPORT.md", - }, - classifiers=[ - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", - "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", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", - ], - packages=[ - "passageidentity", - "passageidentity.models", - "passageidentity.openapi_client", - "passageidentity.openapi_client.api", - "passageidentity.openapi_client.models", - ], - package_dir={ - "passageidentity": "passageidentity", - "passageidentity.models": "passageidentity/models", - "passageidentity.openapi_client": "passageidentity/openapi_client", - "passageidentity.openapi_client.api": "passageidentity/openapi_client/api", - "passageidentity.openapi_client.models": "passageidentity/openapi_client/models", - }, - install_requires=[ - "cryptography ~= 44.0", # used by pyjwt - "pydantic ~= 2.10", # used by codgen - "pyjwt ~= 2.9", - "python-dateutil ~= 2.9", # used by codegen - "requests ~= 2.32", - ], - extras_require={ - "dev": [ - "pytest ~= 8.3", - "faker ~= 33.1", - "build ~= 1.2", - "ruff ~= 0.8", - ], - }, - setup_requires=["pytest-runner"], - tests_require=["pytest"], - test_suite="tests", - python_requires=">=3.8", -)