Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: migrate from setup.py to pyproject.toml #144

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ctran88
Copy link
Contributor

@ctran88 ctran88 commented Feb 24, 2025

What's New?

  • migrates setup.py -> pyproject.toml
  • updates the ruff GHA from v1 -> v3
    • no applicable breaking changes since we don't specify any further ruff versions or configs in the GHA (v2 and v3 notes)

used these refs when writing the toml:

Screenshots (if appropriate):

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have manually tested my code thoroughly
  • I have added/updated inline documentation for public facing interfaces if relevant
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing integration and unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Additional context

@ctran88 ctran88 force-pushed the PSG-4874-update-build-system branch 3 times, most recently from 6ca69d4 to 79715a7 Compare February 24, 2025 18:29
@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem necessary to try to upgrade pip just to install build

python setup.py pytest
```

### Publish the package
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

people outside the org can't publish anyways, so removing this block

]
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 = [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these were pulled from https://pypi.org/classifiers/

"Bug Tracker" = "https://github.com/passageidentity/.github/blob/main/SUPPORT.md"

[project.license]
file = "LICENSE"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[project]
license-files = ["LICENSE"]

the above syntax is noted in the docs but hasn't been adopted by setuptools yet, so we are using the legacy syntax for now

pyproject.toml Outdated
Comment on lines 56 to 57
[tool.setuptools.packages.find]
where = ["passageidentity"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should take care of the packages and package_dir blocks from the old setup.py:

passage-python/setup.py

Lines 38 to 51 in f359061

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",
},

@ctran88 ctran88 force-pushed the PSG-4874-update-build-system branch 2 times, most recently from a38885e to 46a7024 Compare February 25, 2025 20:39
@ctran88 ctran88 force-pushed the PSG-4874-update-build-system branch from 46a7024 to 60c4cdb Compare February 25, 2025 20:42
Comment on lines -38 to -51
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",
},
Copy link
Contributor Author

@ctran88 ctran88 Feb 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manually specifying these is no longer necessary with automatic discovery

i inspected the build artifact and it included everything from the root passageidentity folder and did not include the tests folder

@ctran88 ctran88 marked this pull request as ready for review February 25, 2025 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant