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

Upgrade pants, Makefile, CI, and scripts #188

Merged
merged 4 commits into from
Nov 21, 2023

Conversation

haydenbaker
Copy link
Contributor

@haydenbaker haydenbaker commented Nov 20, 2023

pants

The latest version of pants is fairly different from the version we were using - much has changed.

  • linters/fixers/etc options (in pants.toml) have changed a bit
  • lockfile recommendations have changed, we'll use a single lockfile for the repo (python-default.lock)
    • install_from_resolve must be set to use plugins (like pytest-async, pytest-cov, etc.) for supported tools
      • Setting this means that pants uses the requirements given in the resolve
  • pants no longer recommends checking in the pants runner script, and instead recommends using a get-pants installer script to pull in the latest binary
    • It's packaged as a PEX, and no longer requires a specific version of python (3.9) to be installed to run it
    • The binary will use the pants-version as specified by the pants.toml file
  • Since we use make, pants will be installed to the repo root and can be ran using ./pants (similar to before)
  • The init-pants action is now used, it will set up pants for CI
    • The installation dir is not configurable in the action, so a wrapper script is copied in the repo-root as part of the pants make-recipe IF it is detected that we're in a CI environment (CI env-var is set to true)
  • pants fix runs all the formatters/fixers, whereas pants format only runs the formatters

make

As part of upgrading pants, several new recipes are added. Also, to make CI more ergonomic, I've transitioned our workflows to use make as much as possible.

examples

An example model (examples/weather) is added with configuration to generate a rest-json python client

  • With the smithy-cli installed, you can run smithy build to generate the client

isort issue

When upgrading pants, isort begins to behave strangely

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@haydenbaker haydenbaker requested a review from a team as a code owner November 20, 2023 18:03
@codecov-commenter
Copy link

codecov-commenter commented Nov 20, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (94fdd7d) 94.62% compared to head (08ec194) 94.64%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #188      +/-   ##
===========================================
+ Coverage    94.62%   94.64%   +0.02%     
===========================================
  Files           35       35              
  Lines         1675     1682       +7     
===========================================
+ Hits          1585     1592       +7     
  Misses          90       90              
Flag Coverage Δ
unittests 94.64% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

JordonPhillips
JordonPhillips previously approved these changes Nov 21, 2023
uses: actions/setup-python@v4
with:
python-version: 3.9
uses: actions/checkout@v3
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Run pre-commit
uses: pre-commit/[email protected]
- name: Checkout Repository
uses: actions/checkout@v1
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
uses: actions/checkout@v1
uses: actions/checkout@v4

Copy link
Contributor Author

@haydenbaker haydenbaker Nov 21, 2023

Choose a reason for hiding this comment

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

Whoops, I meant to update all the usages of checkout. Good catch!

@JordonPhillips JordonPhillips merged commit 50e7b02 into smithy-lang:develop Nov 21, 2023
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.

3 participants