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

Pulumi: Migrate pyproject to PyPA standard and hatch #1506

Merged
merged 86 commits into from
Jul 27, 2023

Conversation

JimMadge
Copy link
Member

@JimMadge JimMadge commented Jul 17, 2023

✅ Checklist

  • You have given your pull request a meaningful title (e.g. Enable foobar integration rather than 515 foobar).
  • You are targeting the appropriate branch. If you're not certain which one this is, it should be develop.
  • Your branch is up-to-date with the target branch (it probably was when you started, but it may have changed since then).
  • You have marked this pull request as a draft and added '[WIP]' to the title if needed (if you're not yet ready to merge).
  • You have formatted your code using appropriate automated tools (for example ./tests/AutoFormat_Powershell.ps1 -TargetPath <path to file or directory> for Powershell).

⤴️ Summary

Migrate to hatch/hatchling.

  • Use hatchling for build backend
  • Use hatch for development
  • Use standards PEP508, PEP440, PEP621
  • Demonstrate using hatch environments for, linting, testing, building, etc.

🌂 Related issues

Check #1510 before merging

🔬 Tests

@JimMadge
Copy link
Member Author

@jemrobinson This is not ready for review yet but would like your thoughts.

Especially on how to merge this (if we want to) without disrupting other work on the pulumi branch.

Copy link
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

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

Mostly happy but a few questions on details. Also, we should check for compatibility with #1509 which adds some dependencies.

data_safe_haven/__about__.py Outdated Show resolved Hide resolved
pyproject.toml Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@JimMadge JimMadge mentioned this pull request Jul 21, 2023
5 tasks
@JimMadge
Copy link
Member Author

Mostly happy but a few questions on details. Also, we should check for compatibility with #1509 which adds some dependencies.

👍 Can we agree to hold work on the python-migration branch after #1509 merges to let me get linting passing on this branch and merge it?

@jemrobinson
Copy link
Member

I think this and #1509 can be merged in either order. Just need to be aware that they are inter-dependent.

@JimMadge
Copy link
Member Author

No, because I'll need to fix all the black and ruff errors to not break CI in main. That will involve touching (potentially) every Python file in the repo.

That's why I want other work on this branch to stop before I start fixing the linting errors. Resolving merge conflicts will be too difficult otherwise.

Copy link
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

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

Typer requires Optional[type] rather than type | None. Otherwise you get the message:

RuntimeError: Type not yet supported: str | None

Typer does not support newer union syntax
fastapi/typer#522

Co-authored-by: James Robinson <[email protected]>
@JimMadge JimMadge force-pushed the hatch branch 2 times, most recently from c4fe081 to 18c7732 Compare July 26, 2023 08:16
Copy link
Member

@jemrobinson jemrobinson left a comment

Choose a reason for hiding this comment

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

Tested by redeploying an SHM and SRE.

@jemrobinson jemrobinson merged commit ed154d1 into python-migration Jul 27, 2023
6 checks passed
@jemrobinson jemrobinson deleted the hatch branch July 27, 2023 08:45
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.

2 participants